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

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
htel
Posts: 32
Joined: Tue Mar 01, 2011 10:03 am

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

Post 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.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

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

Post 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?
Be sure to check out our Knowledgebase for helpful articles and solutions!
htel
Posts: 32
Joined: Tue Mar 01, 2011 10:03 am

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

Post 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,
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

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

Post 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?
htel
Posts: 32
Joined: Tue Mar 01, 2011 10:03 am

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

Post 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,
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

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

Post by jdalrymple »

What do you get if you leave $ARG5$ off? I'm wondering - is the datastore for sure there?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

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

Post 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?
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

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

Post 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"
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
htel
Posts: 32
Joined: Tue Mar 01, 2011 10:03 am

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

Post 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.
htel
Posts: 32
Joined: Tue Mar 01, 2011 10:03 am

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

Post 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,
You do not have the required permissions to view the files attached to this post.
Locked