Monitoring ESXi and HP Hardware with Nagios

 

All of you might be aware of VMWare ESXi, VMWares powerful and free Hypervisor with 64-bit architecture.
Unfortunately most of the monitoring features from the licensed (and expensive) full version are missing – SNMP gets aren’t possible either, only traps. But there is a way out of this drawback, at least if you’re using HP hardware (should work with G5+) and nagios/icinga as monitoring tool.

First of all the best way to use ESXi on HP hardware is by instaling the ESXi version supplied by HP which can be downloaded here for free. In this version all needed agents and tools in order to monitor the ESXi server with nagios/icinga are already included.

For those who want to upgrade their existing ESXi server(s) HP offers its ESXi bundle as additional ESXi patch (hp-esxi4.0uX-bundle-1.2.zip), download here. In order to deploy it onto the ESXi servers the VMware vSphere CLI is needed, could be obtained from here.

After installing all the prequisites you have to deploy the ESXi bundle to your server. If you`re using a Windows client the command line, called from bin directory of your vSphere Cli Installation (e.g. C:Program FilesVMwareVMware vSphere CLIbin), just use:

vihostupdate.pl –server –install –bundle c:hp-esxi4.0uX-bundle-1.2.zip

After the next reboot of your server (unfortunately a reboot is necessary) you should be able to find new monitoring sensors in the configuration tab of your vSphere client as shown in the screenshot, e.g. the disk status:

If this works fine we continue with the next step: Monitoring multiple ESXi Servers with nagios/icinga
There are mulitiple versions of the python script check_esx_wbem.py in the net, but only some of them work properly with HP Hardware. (there is also a version which should be working with hardware from dell )
Requirements for the script are Python 2.6 and the Python extension pywbem.
The script we are using has proofed its functionality several times, you can obtain it from here or directly from my site here.

Command usage is:

Command: python $USER1$/check_esxi_wbem.py https://$HOSTADDRESS$:5989 $ARG1$ $ARG2$ $ARG3$

example error would look like this:

/libexec # python check_esx_wbem.py https://vmware42.google.dmz:5989 statistics password hp
CRITICAL : Disk 4 on HPSA1 : Port 1I Box 1 Bay 4 : 136GB : Data Disk : Disk Error

if everything is fine:

/libexec # python check_esx_wbem.py https://vmware00.microsoft.dmz:5989 statistics password hp
OK hp hardware

Links:
Download ESXi version supplied by HP
HP ESXi Offline Bundle 
VMware vSphere CLI
checK-esxi_wbem.py download

Laissez un commentaire