Page 1 of 2

Nagios XI 2012R2.1 Error -Return Code of 255 is out of bound

Posted: Mon Mar 30, 2015 5:50 am
by htel
We have recently received the error above when checking our VMWare Datastores. This is a scheduled check configured within the Nagios Web Interface.
The settings are:
Check command: check_vmware_vc_warn_crit
Command View: $USER1$/check_vmware.pl --config=$USER1$/$ARG1$ --mode=nagios --report=$ARG2$ --warn=$ARG3$ --crit=$ARG4$ $ARG5$ $ARG6$ $ARG7$ $ARG8$
$ARG1$: check_vmware_config_vcenter01
$ARG2$: disk
$ARG3$: 153
$ARG4$: 61
$ARG5$: --include=SAN_VMWARE_GUESTS_DATABASES_A

This represents a number of individual checks that Nagios is configured for, with $ARG5$ changed depending on which store is being checked.
This check was functioning until 7 days ago. No changes have been made to the stores or VMWare vCentre host.

I am fairly new to Nagios/CentOS so would appreciate any advice to help me remedy the problem. Please include the relevant commands I may need to perform any actions.
Many thanks.

Re: Nagios XI 2012R2.1 Error -Return Code of 255 is out of b

Posted: Mon Mar 30, 2015 10:26 am
by lmiltchev
Does the check work when you run it from the command line? Can you show us the actual command run from the CLI along with the output of it?

Re: Nagios XI 2012R2.1 Error -Return Code of 255 is out of b

Posted: Tue Mar 31, 2015 3:06 am
by htel
Hi,

Many thanks for your response. The command does not work from the CLI see below:

Code: Select all

[root@htv440821 ~]# /usr/local/nagios/libexec/check_vmware.pl --config=/usr/local/nagios/libexec/check_vmware_config_vcenter01 --mode=nagios --report=disk --warn=307 --crit=122 --include=SAN_VMWARE_GUESTS_LIVE_A
Undefined subroutine &Folder::datastore called at /usr/local/nagios/libexec/check_vmware.pl line 970
You have new mail in /var/spool/mail/root
[root@htv440821 ~]#
Cheers,

Re: Nagios XI 2012R2.1 Error -Return Code of 255 is out of b

Posted: Tue Mar 31, 2015 11:05 am
by jdalrymple
What changes have been made to the environment?

Can you login to the VMware instance using the credentials you're providing the Perl script? Those credentials can no doubt be located in that config file you're specifying on the command line.

Is this the check_vmware.pl intended to be used as part of a puppet pattern?

Re: Nagios XI 2012R2.1 Error -Return Code of 255 is out of b

Posted: Wed Apr 01, 2015 7:30 am
by htel
There have been no known changes to the environment.

The credentials specified in the config file are for the Nagios Service account to access the vCenter Server and query VMWare on a Domian joined Windows Server. This account is not the Nagios Account and is not used to log onto the Nagios Server.

I have no knowledge of "puppet pattern" so would not know if the check_vmware.pl is used or intended for use in such a fashion. As I said my knowledge and understanding of Nagios and CentOS is very limited and this is a system we have inherited.

I have been looking further into the check_vmware.pl, specifically the error quoted in the output from the CLI command:

Code: Select all

 Undefined subroutine &Folder::datastore called at /usr/local/nagios/libexec/check_vmware.pl line 993 
This line reads:

Code: Select all

 push @dsa,@{$_->datastore} if(defined $_->datastore); 
Many thanks,

Re: Nagios XI 2012R2.1 Error -Return Code of 255 is out of b

Posted: Wed Apr 01, 2015 10:57 am
by jdalrymple
What do you get if you leave $ARG5$ off? I'm wondering - is the datastore for sure there?

Re: Nagios XI 2012R2.1 Error -Return Code of 255 is out of b

Posted: Wed Apr 01, 2015 11:09 am
by lmiltchev
I am not able to recreate the issue in house. Can you increase the verbosity of the output by running the command below?

Code: Select all

/usr/local/nagios/libexec/check_vmware.pl --config=/usr/local/nagios/libexec/check_vmware_config_vcenter01 --mode=nagios --report=disk --warn=307 --crit=122 --include=SAN_VMWARE_GUESTS_LIVE_A --verbose
Also, can you make sure that the user, listed in the "/usr/local/nagios/libexec/check_vmware_config_vcenter01" config file has sufficient permissions?

Re: Nagios XI 2012R2.1 Error -Return Code of 255 is out of b

Posted: Thu Apr 02, 2015 12:57 am
by Box293
Please open the vSphere client using the credentials defined in the config file: "/usr/local/nagios/libexec/check_vmware_config_vcenter01"

Once logged in, Navigate to "Datastores and Datastore Clusters" and make sure that this user account can see these Datastore "SAN_VMWARE_GUESTS_LIVE_A"

Re: Nagios XI 2012R2.1 Error -Return Code of 255 is out of b

Posted: Thu Apr 02, 2015 3:50 am
by htel
Box293 wrote:Please open the vSphere client using the credentials defined in the config file: "/usr/local/nagios/libexec/check_vmware_config_vcenter01"

Once logged in, Navigate to "Datastores and Datastore Clusters" and make sure that this user account can see these Datastore "SAN_VMWARE_GUESTS_LIVE_A"
Hi Box,

Many thanks for your response. I have tested that the account specified can open and browse to the datastores and the contents. The one quoted here is representative of mutiple datastores for multiple checks.

Re: Nagios XI 2012R2.1 Error -Return Code of 255 is out of b

Posted: Thu Apr 02, 2015 3:59 am
by htel
lmiltchev wrote:I am not able to recreate the issue in house. Can you increase the verbosity of the output by running the command below?

Code: Select all

/usr/local/nagios/libexec/check_vmware.pl --config=/usr/local/nagios/libexec/check_vmware_config_vcenter01 --mode=nagios --report=disk --warn=307 --crit=122 --include=SAN_VMWARE_GUESTS_LIVE_A --verbose
Also, can you make sure that the user, listed in the "/usr/local/nagios/libexec/check_vmware_config_vcenter01" config file has sufficient permissions?
Hi lmiltchev,

Many thanks for your reply. I have checked the user permissions and they are fine for the access needed. Please note that nothing was changed and this error occured during the normal working day when we would not be changing production systems. It may be worthy of note that these checks are carried out via a windows based server running vcenter, and the user concerned is a domain account.

I have run the command again as you suggested with the results attached in a txt file.

I hope you will be able to identify a cause and guide me in the right direction to remedy the issue.

Many thanks,