Monday 11 April 2016

Monitoring vSphere with NAGIOS

In this tutorial we will look at how NAGIOS can be used to monitor different parts of your vSphere environment.

To get started we should firstly ensure that we have the relevent pre-requisites:

- vSphere SDK for Perl:
- Linux host (Debian, CentOS, RH etc.)
- check_vmware_esx (NAGIOS plugin):*-Virtual-Environments/VMWare/check_vmware_esx-2Epl/details

Firstly install the vSphere SDK

** Make sure you copy the perl modules within the check_vmware_esx to something like '/usr/share/perl5' **

Once the vSphere SDK for perl is installed - firstly ensure its working OK with something like:

/usr/bin/vmware-cmd --server -l -h esxhost1 --username --password 'yourpassword'

Which should return a list of your virtual machines on the specific ESXI host.

Now we will need to install a few pre-requisites:

yum install perl-Time-Duration
cpan install perl-Time-Duration-Parse

./ -D -u nagios -p mySec0reP@55w0rd* --select=volumes --subselect=Datastore1 --spaceleft --gigabyte -w 10% -c 5%

The above command will check the available free space on the specified datastore and return the percentage of free space.

Add the command to your command definitions and create a new service definition e.g.:

check_vmware_esx!!-u nagios -p mySec0reP@55w0rd* --select=volumes --subselect=Datastore1 --spaceleft --gigabyte -w 10% -c 5%


Post a Comment