This post summarises the work involved to successfully monitor your ESX environment using Opsview and the vSphere SDK for Perl.

Prerequisites

Ensure you have the following:

Step 1

Navigate and download the SDK Libraries that correspond to your OS Archictecture fromhttp://communities.vmware.com/community/vmtn/developer/forums/vsphere_sdk_perl

Step 2

On the Opsview master run the following commands:

[email protected]:~$ sudo tar -zxvf VMware-vSphere-Perl-SDK-4.1.0-254719.x86_64.tar.gz
[email protected]:~$ sudo vmware-vsphere-cli-distrib/vmware-install.pl
Creating a new vSphere CLI installer database using the tar4 format.
Installing vSphere CLI.
Installing version 254719 of vSphere CLI
You must read and accept the vSphere CLI End User License Agreement to continue.
Press enter to display it.

Accept the licence agreement and the default location to install the executable files [/usr/bin]

Step 3

Download and Install the nagios plugin check_esx3 fromhttp://exchange.nagios.org/directory/Plugins/Operating-Systems/*-Virtual-Environments/VMWare/check_esx3/details to /tmp

Step 4

On the Opsview master as user nagios run the following commands:

[email protected]:/tmp$ sudo chown nagios:nagios /tmp/check_esx3
[email protected]:/tmp$ cp /tmp/check_esx3 /usr/local/nagios/lib
[email protected]:/tmp$ sudo cp /tmp/check_esx3 /usr/local/nagios/libexec/

Examples

On the Opsview master as the nagios user run the following tests for the VM server

./check_esx3 -H $HOSTADDRESS$ -u root -p password -l cpu
./check_esx3 -H $HOSTADDRESS$ -u root -p password -l runtime -s list
./check_esx3 -H $HOSTADDRESS$ -u root -p password -l io
./check_esx3 -H $HOSTADDRESS$ -u root -p password -l mem -s usage
./check_esx3 -H $HOSTADDRESS$ -u root -p password -l net
./check_esx3 -H $HOSTADDRESS$ -u root -p password -l runtime -s issues
./check_esx3 -H $HOSTADDRESS$ -u root -p password -l runtime -s status
./check_esx3 -H $HOSTADDRESS$ -u root -p password -l service
./check_esx3 -H $HOSTADDRESS$ -u root -p password -l storage -s path
./check_esx3 -H $HOSTADDRESS$ -u root -p password -l mem -s swap
./check_esx3 -H $HOSTADDRESS$ -u root -p password -l vmfs

On the Opsview master as the nagios user run the following tests for any Guest VM on the server

./check_esx3 -H [IP of ESX Server] -u root -p [Password] -N [Guest VM] -l runtime -s con
./check_esx3 -H [IP of ESX Server] -u root -p [Password] -N [Guest VM] -l cpu
./check_esx3 -H [IP of ESX Server] -u root -p [Password] -N [Guest VM] -l io
./check_esx3 -H [IP of ESX Server] -u root -p [Password] -N [Guest VM] -l mem -s usage
./check_esx3 -H [IP of ESX Server] -u root -p [Password] -N [Guest VM] -l net
./check_esx3 -H [IP of ESX Server] -u root -p [Password] -N [Guest VM] -l runtime -s cpu
./check_esx3 -H [IP of ESX Server] -u root -p [Password] -N [Guest VM] -l runtime -s issues
./check_esx3 -H [IP of ESX Server] -u root -p [Password] -N [Guest VM] -l runtime -s mem
./check_esx3 -H [IP of ESX Server] -u root -p [Password] -N [Guest VM] -l runtime -s status
./check_esx3 -H [IP of ESX Server] -u root -p [Password] -N [Guest VM] -l mem -s swap
./check_esx3 -H [IP of ESX Server] -u root -p [Password] -N [Guest VM] -l runtime -s tools

Step 5

Create an Opsview service check and host templates. For more information see our online documentation.