This article describes how to monitor a VMWare ESXi or vSphere host with Nagios, using the OP5 Check ESX Plugin written in PERL. The plugin can monitor either a single ESXi/vSphere server or a VirtualCenter/vCenter Server and individual virtual machines. We’ll see here how to monitor an ESXi 4 host.
The following tutorial has been made on a CentOS server, you may have to adapt some paths with other distributions.
The following tutorial has been made on a CentOS server, you may have to adapt some paths with other distributions.
Installation
The prerequisite for the plugin to work is to install the VMWare Perl SDK available on the manufacturer website.
Download the file on your server, for example in the root directory, untar it and run the installer that way :
Download the file on your server, for example in the root directory, untar it and run the installer that way :
Follow the instructions given by the script. Depending on your setup, some PERL dependencies must be installed prior for the SDK to work correctly. When it’s done, we can get the plugin here, and copy it to
/usr/lib/nagios/plugins/
. Make it executable :Configuration
Now, we can start the real configuration for Nagios. We’ll need a username and password to access the ESXi host, let’s define those Nagios variables in a safe place in
/etc/nagios/resource.cfg
, so that this information will be hidden from the CGIs :
In this tutorial, we’ll be monitoring these resources : CPU, memory usage, net usage, runtime status and IO/read/write. But some more are available, see the references here. Below are the new commands related to ESXi to add in the
/etc/nagios/objects/command.cfg
file (these are the ESXi related commands only, NOT the full command.cfg
, you may append this at the end of the file) :
And an example of the configuration for a Nagios host called esxi01 in
/etc/nagios/hosts/esxi01.cfg
:
It’s done. Restart Nagios and wait a while (or re-schedule) for the new resources to be monitored.
Brak komentarzy:
Prześlij komentarz