Check Esxi Hardware not Working on CentOS 7

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
ep7network
Posts: 51
Joined: Sun Dec 27, 2015 5:04 pm

Check Esxi Hardware not Working on CentOS 7

Post by ep7network »

Hi there. I'm glad to be back!

I'm running CentOS 7 and Nagios web interface is monitoring my other servers with no problem. I would like to monitor my disk RAID on my HP DL360 G5 server that's running OS ESXi 5.5.

On my Nagios host, I've installed "pywben" and "m2crypto" by running "yum install pywben". I've also downloaded "check_esxi_hardware.py" and moved it to /usr/lib64/nagios/plugins, I've opened ports 5989 and 443.

When I try to monitor server ESXi 5.5 from Nagios host, I go to "/usr/lib64/nagios/plugins" and run #./check_esxi_hardware.py -H 192.168.x.x -U root and receive "bash:./check_esxi_hardware.py:Permission denied" Permission denied? I've open appropriate ports. I need to make sure check_esxi_hardware.py is configured correctly! Is there a way to check?

I'm unsure what to do next! I can't find a decent online source explaining how to configure check_esxi_hardware.py on CentOS 7 correctly. Online sources I do find do not pertain to my situation. Any advice in making this work?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Check Esxi Hardware not Working on CentOS 7

Post by scottwilkerson »

What are the file permissions on ./check_esxi_hardware.py ?

Code: Select all

ls -al ./check_esxi_hardware.py
Is it executable?
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
ep7network
Posts: 51
Joined: Sun Dec 27, 2015 5:04 pm

Re: Check Esxi Hardware not Working on CentOS 7

Post by ep7network »

When I ran "ls -al ./check_esxi_hardware.py" I noticed file wasn't executable. So I typed chmod a+x check_esxi_hardware.py to make file executable. I then typed ./check_esxi_hardware.py -H 192.x.x.x -U root -P [-V -i -v -p -I xx] I receive "UNKNOWN: Authentication Error". I do know I have no password set on ESXi server, which is why after -P it's blank.

What can be causing the "UNKNOWN: Authentication Error"?
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Check Esxi Hardware not Working on CentOS 7

Post by dwhitfield »

Try specifying the vendor code when running the command and see if that helps.

Code: Select all

    --vendor dell, hp, ibm, intel

It could be that the plugin cannot determine the hardware type and then cannot authenticate.

Also, what happens if you drop the -P?
ep7network
Posts: 51
Joined: Sun Dec 27, 2015 5:04 pm

Re: Check Esxi Hardware not Working on CentOS 7

Post by ep7network »

If I drop the -P I still receive "UNKNOWN: Authentication Error". Considering that my ESXi server doesn't have a password, I thought maybe its causing an issue. I logged into ESXi server configured a password. So now ESXi server has a password.

I logged back into Nagios server, and in CLI I entered "./check_esxi_hardware.py -H 192.x.x.x -U root -P myPasswd -V hp" and nothing happens. The curser stop blinking and nothing happens. When I Ctrl c I receive this output :

Code: Select all


[root@nagios plugins]# ./check_esxi_hardware.py -H 192.x.x.x -U root -P myPasswd -V hp 
^CTraceback (most recent call last):
  File "./check_esxi_hardware.py", line 685, in <module>
    instance_list = wbemclient.EnumerateInstances(classe)
  File "/usr/lib/python2.7/site-packages/pywbem/cim_operations.py", line 420, in EnumerateInstances
    **params)
  File "/usr/lib/python2.7/site-packages/pywbem/cim_operations.py", line 182, in imethodcall
    no_verification = self.no_verification)
  File "/usr/lib/python2.7/site-packages/pywbem/cim_http.py", line 298, in wbem_request
    response = h.getresponse()
  File "/usr/lib64/python2.7/httplib.py", line 1089, in getresponse
    response.begin()
  File "/usr/lib64/python2.7/httplib.py", line 444, in begin
    version, status, reason = self._read_status()
  File "/usr/lib64/python2.7/httplib.py", line 400, in _read_status
    line = self.fp.readline(_MAXLINE + 1)
  File "/usr/lib64/python2.7/socket.py", line 476, in readline
    data = self._sock.recv(self._rbufsize)
  File "/usr/lib64/python2.7/site-packages/M2Crypto/SSL/Connection.py", line 228, in read
    return self._read_bio(size)
  File "/usr/lib64/python2.7/site-packages/M2Crypto/SSL/Connection.py", line 213, in _read_bio
    return m2.ssl_read(self.ssl, size, self._timeout)
KeyboardInterrupt

I've tried various combinations, regarding "./check_esxi_hardware.py -H 192.x.x.x -U root -P myPasswd -V hp -p -I de" and receive same error message.

Any advice regarding error message and how to fix it? Or do you think its a different issue?
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Check Esxi Hardware not Working on CentOS 7

Post by tgriep »

When you ran the plugin and the cursor stopped blinking, how long did you wait before cancelling out?

Can you run the following and post the output? (Replace x.x.x.x with the VMWare host IP address)

Code: Select all

./check_esxi_hardware.py -H x.x.x.x -U root -P myPasswd -V hp -v
./check_esxi_hardware.py --version
nmap x.x.x.x -p 5989

That plugin was updated a month ago, are you running this version?
https://www.claudiokuenzler.com/nagios- ... p#Download
Be sure to check out our Knowledgebase for helpful articles and solutions!
ep7network
Posts: 51
Joined: Sun Dec 27, 2015 5:04 pm

Re: Check Esxi Hardware not Working on CentOS 7

Post by ep7network »

This time when I ran the plugin ./check_esxi_hardware.py -H x.x.x.x -U root -P myPasswd -V hp -v I didn't interrupt its service, in fact I left it running the entire night and this morning when I logged into Nagios server I noticed a different output. I think its working but not sure. My output is below-

Code: Select all

OK - Server: HP ProLiant DL360 G5 s/n: None System BIOS: P58 2008-01-24|P1Pow_0_System_Board_2_Power_Meter=306;0;0 P4Tem_0_External_Environment_1_Temp_2=19;0;0 P4Tem_1_Power_Supply_5_Temp_5=30;0;0 P4Tem_2_Processor_3_Temp_3=30;0;0 P4Tem_3_Processor_4_Temp_4=30;0;0 P4Tem_4_Processor_5_Temp_6=30;0;0 P4Tem_5_Processor_6_Temp_7=30;0;0 P4Tem_6_System_Internal_Expansion_Board_1_Temp_1=45;0;0 P6FanP_0_Power_Supply_4_Fan_Block_1=34.88%;0;0 P6FanP_1_Processor_1_Fan_Block_2=29.79%;0;0 P6FanP_2_Processor_2_Fan_Block_3=34.88%;0;0 
I think output above is a positive sign.

When I run the command ./check_esxi_hardware.py --version, I receive output below-

Code: Select all

[root@nagios plugins]# ./check_esxi_hardware.py --version
check_esxi_hardware.py 20170905
When i run nmap x.x.x.x -p 5989, I get this output-

Code: Select all

[root@nagios plugins]# nmap x.x.x.x -p 5989

Starting Nmap 6.40 ( http://nmap.org ) at 2017-10-03 11:30 PDT
Nmap scan report for nagios.acedgar.local (x.x.x.x)
Host is up (0.000065s latency).
PORT     STATE  SERVICE
5989/tcp closed wbem-https

Nmap done: 1 IP address (1 host up) scanned in 0.08 seconds
[root@nagios plugins]# 
To answer your question regarding if I'm running the version from
https://www.claudiokuenzler.com/nagios- ... p#Download
Yes, that is where I downloaded plugin from.

Is this working now?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Check Esxi Hardware not Working on CentOS 7

Post by scottwilkerson »

ep7network wrote:This time when I ran the plugin ./check_esxi_hardware.py -H x.x.x.x -U root -P myPasswd -V hp -v I didn't interrupt its service, in fact I left it running the entire night and this morning when I logged into Nagios server I noticed a different output. I think its working but not sure. My output is below-

Code: Select all

OK - Server: HP ProLiant DL360 G5 s/n: None System BIOS: P58 2008-01-24|P1Pow_0_System_Board_2_Power_Meter=306;0;0 P4Tem_0_External_Environment_1_Temp_2=19;0;0 P4Tem_1_Power_Supply_5_Temp_5=30;0;0 P4Tem_2_Processor_3_Temp_3=30;0;0 P4Tem_3_Processor_4_Temp_4=30;0;0 P4Tem_4_Processor_5_Temp_6=30;0;0 P4Tem_5_Processor_6_Temp_7=30;0;0 P4Tem_6_System_Internal_Expansion_Board_1_Temp_1=45;0;0 P6FanP_0_Power_Supply_4_Fan_Block_1=34.88%;0;0 P6FanP_1_Processor_1_Fan_Block_2=29.79%;0;0 P6FanP_2_Processor_2_Fan_Block_3=34.88%;0;0

I think output above is a positive sign.
This output sure looks like the plugin is working. I guess the biggest question is how long does the plugin take to run as if it takes all night, that's going to be a problem.

Might want to try timing it with this command

Code: Select all

time ./check_esxi_hardware.py -H x.x.x.x -U root -P myPasswd -V hp -v
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
ep7network
Posts: 51
Joined: Sun Dec 27, 2015 5:04 pm

Re: Check Esxi Hardware not Working on CentOS 7

Post by ep7network »

Plugin command time ./check_esxi_hardware.py -H x.x.x.x -U root -P myPasswd -V hp -v I ran it four times. My first run took 13 minutes, 2nd run took fifteen minutes, 3rd run took twenty-four minutes, and last run took twenty-five minutes.

Is there a way to fix this?
kyang

Re: Check Esxi Hardware not Working on CentOS 7

Post by kyang »

From reading the FAQ's on the website.
https://www.claudiokuenzler.com/monitor ... dadB8aQxaQ

It depends on how long it takes to check it from your ESXi server?
Open the Hardware Status tab of the affected ESXi server then click on 'Update' and you will see that it takes a very long time until the hardware information is collected.

Although this was from ESXi version 5 where they saw this issue.

Is your ESXi 5.5 up to date? Or what release date do you have installed?

https://esxi-patches.v-front.de/ESXi-5.5.0.html
Locked