Home Directory Plugins Operating Systems Windows NRPE Check Hyper-V 2012 health - BPA & VM

Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me
Don't miss your chance to attend the 2014 Nagios World conference!

Don't miss your chance to attend the 2014 Nagios World Conference, Oct 13-16th. Informative Sessions, Networking, Food and Cocktails! Visit go.nagios.com/conference/ for more information or to register.


Check Hyper-V 2012 health - BPA & VM

Bookmark and Share

Current Version
0.1
Last Release Date
2013-05-09
Compatible With
  • Nagios 3.x
E-mail
License
GPL
Hits
16430
Files:
FileDescription
lotp_check_hyper-v.ps1.txtlotp_check_hyper-v.ps1.txt
Check Hyper-V health through NRPE by:
-Executing and retrieving BPA Results
-Checking not running VM
-Checking not operational normally VM

Warning and Critical state are triggered on sum of:
-Number of BPA issues
-Number of VM in bad shape

You can provide a list of VM to ignore (models...).

A BPA refresh scan is triggered on every call, but in async. So the result will be read on next plugin execution.

Performance graph are provided for:
-VM not running
-VM issues
-BPA Errors
-BPA Warning

*** Need Windows Server 2012, as using Hyper-V PowerShell modules***
###############################################
Tested Setup:

Monitoring Box:
-Centos 6.4 x64
-Nagios 3.4.4
-check_nrpe 2.13
-Centreon 2.4.2
-nsclient++ 0.4.1 x64 & x86
-Windows Server 2012

*** Need Windows Server 2012, as using Hyper-V PowerShell modules***

###############################################
Scripts arguments
The script accept 3 arguments:
-excludeVM (separated by commas)
-maxWarn (Warning if above, 1 by default)
-maxCrit (Critical if above, 5 by default)

###############################################
Local execution example (backslash are removed by this site):
. .lotp_check_vm.ps1
WARNING: 'VM Not Running:'2 'VM issues:'0 BPA Error:1 BPA Warning:12|VM_Not_Running=2 VM_issues=0 BPA_Error=1 BPA_Warning=12

NRPE execution:
[root~]# /usr/lib64/nagios/plugins/check_nrpe -H myHyperV -n -c check_hyper-v
WARNING: 'VM Not Running:'2 'VM issues:'0 BPA Error:1 BPA Warning:12|VM_Not_Running=2 VM_issues=0 BPA_Error=1 BPA_Warning=12
[root~]#

###############################################
Installation:
On Windows Servers:
-copy script in folder C:/Program Files/NSClient++/scripts
-enable powershell script execution without signed : Set-ExecutionPolicy RemoteSigned
-Add to nsclient.ini:
[/settings/external scripts/wrapped scripts]
check_hyper-v=lotp_check_hyper-v.ps1 -excludeVM $ARG1$ -maxWarn $ARG2$ -maxError $ARG3$

###############################################
Configuration:

For example, on Centreon:
-Add a new command:
$USER1$/check_nrpe -H $HOSTADDRESS$ -n -t 60 -c check_vm -a $ARG1$ $ARG2$ $ARG3$