vmware vcenter and HA

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
mariusp
Posts: 21
Joined: Sun Dec 13, 2009 10:44 am
Location: Bucharest, Romania

vmware vcenter and HA

Post 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
tonyyarusso
Posts: 1128
Joined: Wed Mar 03, 2010 12:38 pm
Location: St. Paul, MN, USA

Re: vmware vcenter and HA

Post 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.
Tony Yarusso
Technical Services
___
TIES
Web: http://ties.k12.mn.us/
mariusp
Posts: 21
Joined: Sun Dec 13, 2009 10:44 am
Location: Bucharest, Romania

Re: vmware vcenter and HA

Post 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
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: vmware vcenter and HA

Post by mguthrie »

Thanks for posting this, we'll have to take a look at this for the wizard.