Monitor VMware ESXi with your existing Nagios application


Monitor VMware ESXi with your existing Nagios application

Nagios is plug-in-oriented management software typically installed on a Linux server. Many corporate system administrators use Nagios to keep track of the current state of their servers and other vital devices in the network. This makes Nagios a good choice if you're looking for VMware monitoring tools. Here's a look at how to integrate VMware ESXi monitoring in an existing

Continue Reading This Article

Enjoy this article as well as all of our content, including E-Guides, news, tips and more.

By submitting your email address, you agree to receive emails regarding relevant topic offers from TechTarget and its partners. You can withdraw your consent at any time. Contact TechTarget at 275 Grove Street, Newton, MA.

You also agree that your personal information may be transferred and processed in the United States, and that you have read and agree to the Terms of Use and the Privacy Policy.

Safe Harbor

Nagios environment.

Any device with a plug-in -- even the software in your department's coffeemaker -- can be managed through Nagios, which makes the open source network monitoring system popular and well-known. If you already have a Nagios monitoring environment in place, you can use it to monitor VMware infrastructures by installing the VMware plug-in on the Linux server.

The open source development company OP5 offers the most common VMware monitoring software plug-in: the OP5 Check ESX Plug-in. Since it is written in Perl scripting language, you'll need Perl support on your Linux server and the free VMware vSphere Perl SDK software.

Download the VMware vSphere Perl SDK to the Linux server that hosts Nagios and then extract it using tar zxvf VMware-vSphere-Perl-SDK-<version-number>.tar.gz. This will create the subdirectory called vmware-vsphere-cli-distrib. In this subdirectory, you'll find the installer script Before running this script, use yum install perl-Pod-Perldoc perl-CPAN openssl-devel to ensure that all software requirements are met on your server.

After installing the prerequisites, use the ./ command and follow the script's directions. Now, you can download the Nagios plug-in from OP5 or do an Internet search for download to find the plug-in script in text format. Download this script, save it to the directory /usr/lib64/nagios/plugins and use chmod +x to make it executable. Nagios can now begin monitoring ESXi.

You can now define the commands for Nagios to use to monitor VMware ESXi hypervisors. Add the monitoring commands to the Nagios /etc/nagios/objects/command.cfg file. Put a user name and password in variables in the /etc/nagios/resource.cfg file. In this example, a variable ESXUSER is defined, as well as the user's password. Nagios can use these credentials to access the ESXi host. The file could have the following contents:

# cat /etc/nagios/resource.cfg $ESXUSER$=username $ESXPASSWORD$=password

Based on this, you can add the ESXi monitoring commands to the /etc/nagios/objects/command.cfg file.

If you want to monitor ESXi CPU usage, use this command:
# check vmware ESXi CPU
define command
{    command_name   check_esx_cpu      command_line        $ESXUSER$/check_esx -H $HOSTADDRESS$ -u $ESXUSER$ -p $ESXPASSWORD$ -l cpu -s usage -w $ARG1$ -c $ARG2$ }

Once you've defined commands, create a configuration file for your ESXi host. If the ESXi host is called esxi01, you could put its configuration in a /etc/nagios/hosts/esxi01.cfg file containing the following:

# Host esx01

define host
{   use   Linux-server   host_name   esxi01 address   }

define service
{   use   generic-service   host_name   esxi01 service_description   ESXi CPU Load check_command   check_esx_cpu!80!90   }

This is just a taste of what you can do with the ESXi monitoring plug-in for Nagios. Depending on what functions the plug-in defines, you can monitor other aspects of the ESXi host. Work with your Nagios administrator to define more commands for monitoring VMware.

This was first published in November 2012

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.