Monitoring ESX/vCenter like a less crazy person.

So maybe two weeks on the service-now thing was a little ambitious given I was in the middle of studying for a vendor exam so I’m glad I stipulated that I’m working in Valve developer time.

I do however have an alternative bit of scripted cleverness for you all, most of you are probably familiar with the check_esx3.pl plugin created by the good folks over at http://www.op5.com/ for monitoring ESXi and vCenter. If you are working for a medium or large-ish sized business then you also know that due to the CPU intensive nature of the VMWare perl API you pretty much have to have an entire server dedicated to executing check_esx3.pl.

I’ve been using an alternative solution for quite some time that requires two key things:

  1. VMWare vCenter

  2.  NRDP

Next we need this fun little script over here. So how does it work?

  1. Place the script somewhere on your vCenter server.

  2. Create an alarm in vCenter and configure something to monitor, i.e. Virtual Machine CPU usage.

  3.  Under the actions tab of alarm settings click add then select “Run a command” as the action.

  4. In the configuration section put the following:

c:\windows\system32\cmd.exe /c “path:\to\script\file\vmw_sender.pl” “-u -t -s

  1. Set the trigger thresholds, save the alarm and you’re done.

So that’s more or less the gist of it. When an alarm triggers then information will be passed to the script which will then format it and send it back to Nagios and your VMWare monitoring woes will (hopefully) be solved.

I believe op5 are also scheming another clever replacement right now so I expect this solution to be superseded in the future.

comments powered by Disqus