Page 1 of 1

vmware vcenter and HA

Posted: Wed Nov 24, 2010 4:56 am
by mariusp
Hi All,

We have been playing around with the vmware wizard and can monitor esx/vsphere hosts and the guest machines that reside on these hosts basically without problems. We do have a problem however when a guest vm moves from one esx/vpshere host to another.

There are many reasons why a guest would move between hosts (HA, resource group, etc.) and we would like to know if there is anything that can be done to 'follow' a vm from one host to another? At present when a esx/vsphere host fails all of the vm's on that host are migrated to another host but we still receive the nagios alerts and moreover the hosts are not detected on the host that they have moved to. There is no continuity for these vms and no trending, history or graphing.

Regards,
Marius

Re: vmware vcenter and HA

Posted: Wed Nov 24, 2010 10:59 am
by tonyyarusso
I don't think this is possible with the current architecture of the script. That said, you could potentially hack it work, by creating a "dummy" host in Nagios with the address of the VMware server they currently reside on, and write a script that detects such a transfer and update the Nagios host to have the address of the new VMware server. If you keep the host name the same, and just change the IP address like this, you should get continuous trend graphs. However, this assumes that they all move the same place - if they scatter for load balancing that'd be substantially trickier. As for the updating, you'll be changing information in the 'nagiosql' MySQL database, and then writing out the config files, which would be done by calling a PHP script.

Re: vmware vcenter and HA

Posted: Thu Nov 25, 2010 1:48 pm
by mariusp
Hi,

I downloaded check_vmware.pl from http://www.steveshipway.org/forum/viewt ... &sk=t&sd=a and I am able to query the vCenter server and therefore I no longer care what ESX host the vm is actually running on. If I had a little more time on my hand I would attempt to create a wizard to provide such functionality but alas time is not on my side.

The check script seems to be the same check_vmware.pl script that is shipped with the vmware wizard form nagiosexchange except for that it is newer.

Here is how I query a guest vm by querying the vcenter server directly:

./check_vmware.pl --guest <hostname> --config /usr/local/nagios/libexec/check_vmware_config_vcenter01 --report cpu

The config_vcenter01 file contains my login information:

VI_PASSWORD=fjdkhfjksd
VI_SERVER=vcserver.auckland.ac.nz
VI_USERNAME=myusername


Seems pretty nifty as it also has support for the hosts themselves as well as cluster.

Regards,
Marius

Re: vmware vcenter and HA

Posted: Fri Nov 26, 2010 12:31 pm
by mguthrie
Thanks for posting this, we'll have to take a look at this for the wizard.