check_esxi_hardware.py - Return code of 255 is out of bounds

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
SHou
Posts: 4
Joined: Wed Jan 18, 2017 1:12 pm

check_esxi_hardware.py - Return code of 255 is out of bounds

Post by SHou »

Hi Guys,
i have a problem which drives me really crazy since some days, hope someone cann support.

Using:
Nagios Core 4.2.2
Ubuntu 16.04 LTS

i want to use the pyhton script check_esxi_hardware.py to check the health of my ESXi Server.
If i run the command via the shell i get the expected result, do i integrate the check into my nagios i get the error code:
Status Information: (Return code of 255 is out of bounds)
the Event Log show the following entry:
Warning: Return code of 255 for check of service 'Hardware' on host 'winserver' was out of bounds.

Shell command:

Code: Select all

./check_esxi_hardware.py -H esxi-ip -U username -P mypass -V hp
result
OK - Server: HP Proliant........

Command definition inside commands.cfg:

Code: Select all

# 'check_esxi_hardware' command definition
define command{
command_name check_esxi_hardware
command_line $USER1$/check_esxi_hardware.py -H $HOSTADDRESS$ -U $ARG1$ -P $ARG2$ -V $ARG3$
}
Service check inside windows.cfg

Code: Select all

# Check HP Server hardware
define service{
use generic-service
host_name winserver
service_description Hardware
check_command check_esxi_hardware!root!mypass!hp
}

Thanks in advance for your support
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: check_esxi_hardware.py - Return code of 255 is out of bo

Post by rkennedy »

Usually the error is related to permissions, what happens if you run it as the nagios user?

Code: Select all

su - nagios
./check_esxi_hardware.py -H esxi-ip -U username -P mypass -V hp
If this fails, then you may just need to change the permissions on the check_esxi_hardware.py script so the nagios user can access it.

If that doesn't help, please show us the full output as well as the permissions on the file - ls -al check_esxi_hardware.py
Former Nagios Employee
SHou
Posts: 4
Joined: Wed Jan 18, 2017 1:12 pm

Re: check_esxi_hardware.py - Return code of 255 is out of bo

Post by SHou »

the result is the same, like before

Code: Select all

$ ./check_esxi_hardware.py -H 192.168.1.1 -U root  password
OK - Server: HP ProLiant DL380p Gen8 s/n: jasdfioanfö System BIOS: P70 2015-07-01
from my point if view the permission are also looking good, correct me if im wrong ;)

Code: Select all

ls -al check_esxi_hardware.py
-rwxrwxrwx 1 nagios nagios 35579 Jan 16 19:12 check_esxi_hardware.py
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: check_esxi_hardware.py - Return code of 255 is out of bo

Post by tgriep »

Can you run the following as root and post the output?

Code: Select all

which python
python -V
Be sure to check out our Knowledgebase for helpful articles and solutions!
SHou
Posts: 4
Joined: Wed Jan 18, 2017 1:12 pm

Re: check_esxi_hardware.py - Return code of 255 is out of bo

Post by SHou »

find attached the output

which python
/usr/bin/python

python -V
Python 2.7.12
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: check_esxi_hardware.py - Return code of 255 is out of bo

Post by tgriep »

Thanks for the output. I just wanted to make sure that the path to python is what the plugin expects.
What I think it is is the output from your command line example has a umlaut o in it and that could be causing it issue.
Can you try a different option that doesn't output a special character and see if it works?
Another thing, it you have special characters in the user name or password, try putting them between single quotes and see it that works.
Be sure to check out our Knowledgebase for helpful articles and solutions!
SHou
Posts: 4
Joined: Wed Jan 18, 2017 1:12 pm

Re: check_esxi_hardware.py - Return code of 255 is out of bo

Post by SHou »

thank's for your feedback!
i don't have any special characters in the user or password, i put both also between single characters.
no change - same error :( out of bounds

any more ideas?

regards SHou
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: check_esxi_hardware.py - Return code of 255 is out of bo

Post by tgriep »

All of the settings look like they should work but you could add the -v option to your command to get a verbose output and see if you can get any more details on why it is failing.

You may also want to check this link and verify that you are running the latest version of the plugin as well as searching their site for any tips.
https://www.claudiokuenzler.com/nagios- ... IY0p30sCrc
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked