Opsview Knowledge Center

OS - VMware vSphere - Host

An overview of the VMware vSphere Host Opspack for Opsview Monitor

Installation

The VMware vSphere templates require VMware's vSphere SDK for Perl. You must install this to allow the monitoring plugins provided with Opsview to query the VMware API.

Opsview Monitor has been tested using vSphere SDK version 5.1.
You can check your version of vSphere SDK with:

perl -MVMware::VIRuntime -e 'print VMware::VIRuntime->VERSION,$/'

Note: If you have slaves, you will need to install the SDK on each slave server.
This template will work against VMware ESX servers as well.

Debian and Ubuntu

Download VMware's vSphere SDK for Perl, for the appropriate bit level. We assume 64-bit.
Transfer to the Opsview Monitor master and slaves and extract the file:

su -
tar --gzip -xvf VMware-vSphere-Perl-SDK-5.1.0-780721.x86_64.tar.gz
cd vmware-vsphere-cli-distrib

Unfortunately for Debian and Ubuntu directly, it may be necessary to install this patch. Download this patch to your Opsview Monitor server and run:

$ su -
# cd vmware-vsphere-cli-distrib
# patch -p1 < vmware-vsphere-sdk-5-1-debian.patch

Then install extra packages:

# apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 build-essential gcc uuid uuid-dev perl libssl-dev perl-doc liburi-perl libxml-libxml-perl libcrypt-ssleay-perl
# PERL5LIB=/opt/opsview/perl/lib/perl5 ./vmware-install.pl

Test the install with:

# su - nagios
$ perl -MVMware::VIRuntime -e 'print "Installed\n"'

RHEL and CentOS

You will require the openssl-devel package to use the VMware SDK:

# yum install openssl-devel

Download VMware's vSphere SDK for Perl, for the appropriate bit level. We assume 64-bit.

Transfer to the Opsview master and slaves and extract the file:

$ su -
# tar --gzip -xvf VMware-vSphere-Perl-SDK-5.1.0-780721.x86_64.tar.gz
# cd vmware-vsphere-cli-distrib
# PERL5LIB=/opt/opsview/perl/lib/perl5 ./vmware-install.pl

Test the install with:

# su - nagios<br>$ perl -MVMware::VIRuntime -e 1

SLES

You will require the openssl-devel package to use the VMware SDK:

# zypper install openssl-devel

Download VMware's vSphere SDK for Perl, for the appropriate bit level. We assume 64-bit.
Transfer to the Opsview master and slaves and extract the file:

$ su -
# tar --gzip -xvf VMware-vSphere-Perl-SDK-5.1.0-780721.x86_64.tar.gz
# cd vmware-vsphere-cli-distrib
# PERL5LIB=/opt/opsview/perl/lib/perl5 ./vmware-install.pl

Test the install with:

$ su - nagios
# perl -MVMware::VIRuntime -e 1

Post Installation

Once you have installed the VMware SDK we recommend that you re-run the plugin update script on the Opsview master so that the embedded help information is correct.
As the 'nagios' user run:

/usr/local/nagios/bin/populate_db.pl plugins

Configuration

To add a new VMware Server host:

  1. Create a new host within "Menu => Settings => Host Settings"
  2. Enter the address or DNS name for your VMware server in the 'Primary Hostname/IP' field
  3. Add the Host Template, "OS - VMware vSphere - Host"
  4. On the 'Variables' tab, add in "VMWAREHOSTCREDENTIALS" and set a value equal to the server's hostname and click 'Save'
  5. Make sure your new variable is highlighted and click on the checkbox "Override Username" and input the user that will connect to your VMware server - i.e. root
  6. Make sure your new variable is highlighted and click on the checkbox "Override Password" and input the password that will be used to connect to your VMware server
  7. (Optional) For each datastore that you want to monitor, add another variable, "VMWAREDATASTORE" and set a value using the name of your datastore. Next, click on the checkbox "Override Datastore" and input the name of the datastore that you want to monitor.
  8. Submit Changes
  9. Perform a configuration reload within "Menu => Settings => Reload"

To add a new VMware Server Guest:

  1. Create a new host within "Menu => Settings => Host Settings"
  2. Enter the address or DNS name for your VMware guest in the 'Primary Hostname/IP' field
  3. Add the Host Template, "OS - VMware vSphere - Guest"
  4. On the 'Variables' tab, add in "VMWAREGUESTCREDENTIALS" and set a value equal to the server's hostname and click 'Save'
  5. Make sure your new variable is highlighted and click on the checkbox "Override Username" and input the user that will connect to your VMware server - i.e. root
  6. Click on the checkbox "Override Password" and input the password that will be used to connect to your VMware server
  7. Click on the checkbox "Override VMware host name" and input the name of the VMware server that the guest runs on
  8. Click on the checkbox "Override VMware guest name" and input the name of the VMware guest
  9. Submit Changes
  10. Perform a configuration reload within "Menu => Settings => Reload"

List of Host Attributes

The VMware Monitoring template is configured to use the following Host Attributes

Attribute Description
VMWAREHOSTCREDENTIALS Used for the VMware host credentials. The value can be anything - set to the VMware host name. arg1 is the username for authentication with the VMware ESX / Vsphere server, arg2 is the password.
VMWAREGUESTCREDENTIALS Used for the VMware guest to connect to its VMware host. The value can be anything - set to the guest name. arg1 is the username for authentication with the VMware ESX / Vsphere server, arg2 is the password, arg3 is the VMware host server IP address and arg4 is the VMware name for the VM.
VMWAREDATASTORE The value should be the name of the data store in VMware. You can have multiple host attributes to check each data store in the VMware host. arg1 can be threshold settings that you want to use instead of the default values.
VMWARE_API_ARGUMENTS Arg1 is used for extra arguments that you may want to use for all check_vmware_api calls. The default value is 'no-certificate-checking which allows communication to a server that has different certificates. Change the Attribute default value if you want to change this globally. Alternatively, add this attribute to a host if you want to override the host specifically

Note**:** If you are upgrading Opsview Monitor and previously used the VMware ESX Host host template, then you will need to change the host attributes as these have altered. Use the VMWAREHOSTCREDENTIALS host attribute above instead of the previous VMWAREUSERNAME and VMWAREPASSWORD host attributes.

Note**: **The VMware guest name and password has limitations with some special characters, causing some Service Checks to fail. Avoid using any special characters for the virtual machine name or password. The following characters are known to have a problem: '$!

Troubleshooting

Server version unavailable

If you get this error:

CHECK_VMWARE_API.PL CRITICAL - Server version unavailable at 'https://vmwareserver.example.com:443/sdk/vimService.wsdl'

Try to go to this URL directly from your browser. If you get a certificate error in your browser, you will need to update the arguments of the service check to include 'no-certificate-checking so that the certificate validating is ignored. For enhanced security, we recommend you fix your certificate so it is a valid certificate.
It is possible to use a specific certificate with the 'certificate-file=FILENAME option.

OS - VMware vSphere - Host

An overview of the VMware vSphere Host Opspack for Opsview Monitor