Others

Check Hyper-V VM Health

Description:

This Plugin checks that all virtual machines running on your Hyper-V server are in good health.

REQUIRES:

Check_NT Plugin
NSCLient++ or similar running on Server.

Command Format:

check_hyperv-health.sh $HOSTADDRESS$

Current Version

0.2

Last Release Date

2012-11-27

Compatible With

  • Nagios 2.x
  • Nagios 3.x
  • Nagios XI

Owner

License

GPL


Project Files
Project Notes
This Plugin checks that all virtual machines running on your Hyper-V server are in good health. REQUIRES: Check_NT Plugin NSCLient++ or similar running on Server. Command Format: check_hyperv-health.sh $HOSTADDRESS$ The Plugin accesses the performance counters on Server 2008 to check the health of all VM's running on Hyper-V. Version History: ================ Version 0.2 - * Added some basic error checking I forgot to add in Version 0.1 - Check will now return a "UNKNOWN" state if it fails to connect to the Client running on the server. Version 0.1 - Initial Release.
Reviews (5) Add a Review
simple and easy to use. need little fine tune who all are using password
by shree.srikant, November 30, 2014

Thanks monkinsane :). Simple and easy to use. need little fine tune who all are using password. Below is the change i made. Thanks monkinsane :) added "PSW=$2" changed line #10 to OKVMS=`$CHNT -H $HOST -s $PSW -p 12489 -v COUNTER -l "Hyper-V Virtual Machine Health SummaryHealth OK"` changed line #11 to CRITVMS=`$CHNT -H $HOST -s $PSW -p 12489 -v COUNTER -l "Hyper-V Virtual Machine Health SummaryHealth Critical"` changed line #15 to CMDERR=`$CHNT -H $1 -s $2 -p 12489 -v COUNTER -l "Hyper-V Virtual Machine Health SummaryHealth OK" |grep -i -o "could not fetch information from server"`



It works, need a little tweaking
by GldRush98, July 31, 2014

It works, but since my NSclient++ machines require a password, I had to add a 2nd variable to the command line and threw that variable in to the check commands in the script so that I could pass it my password. Once I did that, it worked. I wish it would be a little more verbose or you could specify one particular machine, but I realize this is probably a limitation of Hyper V itself and not the script. It's at least giving us some info which is better than nothing.



Work fine on centos
by b.gautier, July 31, 2013

The plugins work fine. If your are a noob like me... first install on your Windows HyperV nsclient++ without password. If you are on Centos, you have to change the line 8 by CHNT="/usr/lib/nagios/plugins/check_nt"



A little rough around the edges
by mcampbell, February 28, 2013

I had the same problem as Cipher, where the script would bail at line 13. Turns out the problem is that this script has hardcoded a path for the check_nt script (CHNT variable) it depends on (I believe it was the default location for debian-based systems), and in my case (running on CentOS), that script didn't exist in that location. After modifying the path, there was another error that came up, this time the error was in the OKVMS & CRITVMS variables--my particular NSClient machines require a password, and this wasn't supplying one. So adding a -s to the end of those variables fixed it, and the script now works.



Could not get it to function
by Cipher-0, November 30, 2012

Version 2 of the script bailed on line 13 in my Opsview Core installation.



Add a Review

You must be logged in to submit a review.

Thank you for your review!

Your review has been submitted and is pending approval.

Recommend

To:


From:


Thank you for your recommendation!

Your recommendation has been sent.

Project Stats
Rating
3 (7)
Favorites
0
Views
113,242