Abstract
This document describes how you can monitor “private” services and attributes of ESX and VM machines, such as:
In a VMware server we should monitor:
For theses checks you will need the check_esx3.pl plugin.
There are some steps you'll need to follow in order to monitor a new vmware esx/vm machine. They are:
To make your life a bit easier, a few configuration tasks have already been done for you:
The above-mentioned config files can be found in the /etc/shinken/ directory (or c:\shinken\etc under windows). You can modify the definitions in these and other definitions to suit your needs better if you'd like. However, I'd recommend waiting until you're more familiar with configuring Shinken before doing so. For the time being, just follow the directions outlined below and you'll be monitoring your VMware boxes in no time.
Please ask your VMware administrator to create a Shinken account (can be a windows domain account) and give it read credential on the vphere environnement (on the root datacenter definition with inheritance).
You need to configure in the “resource.cfg” file (”/etc/shinken/resource.cfg” under linux or “c:\shinken\etc\resource.cfg” under windows) :
#### vSphere (ESX) part $VCENTER$=vcenter.mydomain.com $VCENTERLOGIN$=someuser $VCENTERPASSWORD$=somepassowrd
You can then try the connection if you already know about an esx host, like for example myesx :
/var/lib/nagios/plugins/check_esx3.pl -D vcenter.mydomain.com -H myesx -u someuser -p somepassword -l cpu
When you got the public/private keys, you can deploy the public key to you linux servers.
ssh-copy-id -i /home/shinken/.ssh/id_rsa.pub shinken@srv-lin-1
To see if the keys are working, just launch :
check_by_ssh -H srv-lin-1 -C uptimeIt should give you the uptime of the srv-lin-1 machine.
Now it's time to define some object definitions in your Shinken configuration files in order to monitor the new Linux machine.
You can add the new host definition in an existing configuration file, but it's a good idea to have one file by host, it will be easier to manage in the future. So create a file with the name of your server.
Under Linux :
linux:~ # vi /etc/shinken/hosts/srv-lin-1.cfgOr Windows :
c:\ wordpad c:\shinken\etc\hosts\srv-lin-1.cfg
You need to add a new host definition for the Linux machine that you're going to monitor. Just copy/paste the above definition Change the “host_name”, and “address” fields to appropriate values for this machine.
define host{
use linux
host_name srv-lin-1
address srv-lin-1.mydomain.com
}
You have configured your host to the checks defined from the linux template. What does this mean? It means that you have some checks pre-configured for you :
You're done with modifying the configuration, so you'll need to verify your configuration files and restart Shinken.
If the verification process produces any errors messages, fix your configuration file before continuing. Make sure that you don't (re)start Shinken until the verification process completes without any errors!