Search Exchange
Search All Sites
Nagios Live Webinars
Let our experts show you how Nagios can help your organization.Login
Directory Tree
Check Hyper-V VM Health
0.2
2012-11-27
- Nagios 2.x
- Nagios 3.x
- Nagios XI
GPL
113265
File | Description |
---|---|
check_hyperv-health.sh | Version 0.1 - Initial Release |
check_hyperv-health.sh | Version 0.2 - Bug Fix (See Full Description) |
Meet The New Nagios Core Services Platform
Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.
Monitoring Made Magically Better
- Nagios Core on Overdrive
- Powerful Monitoring Dashboards
- Time-Saving Configuration Wizards
- Open Source Powered Monitoring On Steroids
- And So Much More!
REQUIRES:
Check_NT Plugin
NSCLient++ or similar running on Server.
Command Format:
check_hyperv-health.sh $HOSTADDRESS$
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.
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)
byshree.srikant, November 17, 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 Summary\Health OK"`
changed line #11 to CRITVMS=`$CHNT -H $HOST -s $PSW -p 12489 -v COUNTER -l "\Hyper-V Virtual Machine Health Summary\Health Critical"`
changed line #15 to CMDERR=`$CHNT -H $1 -s $2 -p 12489 -v COUNTER -l "\Hyper-V Virtual Machine Health Summary\Health OK" |grep -i -o "could not fetch information from server"`
added "PSW=$2"
changed line #10 to OKVMS=`$CHNT -H $HOST -s $PSW -p 12489 -v COUNTER -l "\Hyper-V Virtual Machine Health Summary\Health OK"`
changed line #11 to CRITVMS=`$CHNT -H $HOST -s $PSW -p 12489 -v COUNTER -l "\Hyper-V Virtual Machine Health Summary\Health Critical"`
changed line #15 to CMDERR=`$CHNT -H $1 -s $2 -p 12489 -v COUNTER -l "\Hyper-V Virtual Machine Health Summary\Health OK" |grep -i -o "could not fetch information from server"`
byGldRush98, July 8, 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.
byb.gautier, July 29, 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"
If you are on Centos, you have to change the line 8 by CHNT="/usr/lib/nagios/plugins/check_nt"
bymcampbell, February 8, 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.
byCipher-0, November 28, 2012
Version 2 of the script bailed on line 13 in my Opsview Core installation.