Monitor ESXi servers health with Nagios


Monitoring ESXi servers health is the keyword to keep the virtual infrastructure fully working and the servers status under control.

As monitoring systems, Nagios is the solution I mostly use for the networks I manage. To check VMware ESXi 4.x/5.0 servers, there is a great plugin called written by Claudio Kuenzler mentioned also in the VMware community.

Information reported by the plugin are the same as shown in the vSphere Client navigating to Configuration tab –> Health Status.




To use the plugin, Nagios server requires the following components installed:

  • Python
  • Python extension pywbem. Download the extension here.



In Nagios server, install Python using the command yum.

# yum install python


Using wget command, download the Python pywbem extension in the system.

# wget


Unpack the downloaded file using the tar command.

# tar -vxzf pywbem-0.7.0.tar.gz


Install the pywbem extension running from the console the command

# cd pywbem-0.7.0
# python install


Download the plugin and copy the file in the directory  /usr/lib/nagios/plugins.

# wget
# cp /usr/lib/nagios/plugins/


When the plugin has been copied, make the file executable.

# chmod 755

The correct syntax to check the ESXi server is the following:

./ -H IP_address_esxi -U username -P password -V vendor

Where the username must be created in the host ESXi and member of the root group. Since the use of the root user is not recommended for security reasons, create a dedicated account with vSphere Client.



Testing the plugin

When installation completes, the plugin should be tested to check the correct functionality. To test an HP server health status for instance, from the console type the command:

# ./ -H esxi1 -U username -P password -V hp


If everything works as expected, you should receive a message similar as reported in the picture above.

To make the hardware check automatic, the correct command must be defined in Nagios.

define command { 
command_name   check_esxi_hardware 
command_line   $USER1$/ -H $HOSTADDRESS$ -U $ARG1$ –P $ARG2$ -V $ARG3$ 

The monitoring system is now able to to display the hardware health status of configured servers in the network. For additional configuration check the plugin author website.



When the hardware status of ESXi servers is properly monitored, time requested to identify a problem is lower minimizing the risk of a service interruption.
esxi server health check 1