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

Directory Tree

check_mscs.vbs

Rating
1 vote
Favoured:
2
Hits
151548
Files:
FileDescription
check_mscs-0.2.zipVersion 0.2
Nagios CSP

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!
VBScript to check MSCS ressources via NRPE (NSClient++ with NRPE Listener)
Usage:
+++++

For use with NSClient++ please add the following line to your NSC.INI [NRPE Handlers]:

check_mscs=cscript.exe //T:30 //NoLogo scriptscheck_mscs.vbs $ARG1$

and copy "check_mscs.vbs" into "scripts" folder at each node. Refer to NSClient++ Documentation for using remote checks via NRPE.

###command definition###

define command {
command_name check_mscs
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -p 5666 -t 30 -c check_mscs -a $ARG1$
}

###service definition###

define service{
use generic-service
host_name MSCSSVC01
service_description MSCS Ressources
process_perf_data 0
check_command check_mscs!"RES Disk R:,Disk S:"
}

Please remember to point this check to the corresponding clustered ressource (type "network name" & "ip address") - not to a single node. (Of course you can use other methods, i.e. check_cluster)

What it does:
+++++++++++++

The plugin will accept the following parameters:

check_mscs.vbs RES [ressource list]
check_mscs.vbs NODE [node list]

RES: Ressources

The script will accept a comma separated list of ressource names as argument. You will receive an error message "CRITICAL - Missing arguments" plus CRITICAL status if there are no arguments. While the script is dealing correct with ressource names with spaces in it please quote your list of ressources as mentioned above.

The status of any given ressource is fetched via WMI provider:
Select * from MSCluster_Resource WHERE Name = 'RessourceName'

You will get "OK" if all ressources are online.

"OK - Disk R:,Disk S:"

Any ressorce from argument list that has a status different from "online" is causing the check result to be "CRITICAL". In that case you will find the corresponding ressource name with its status in information field.

"CRITICAL - Disk S: (offline), OK - Disk R:"

NODE: Nodes

The script will accept a comma separated list of node names as argument. You will receive an error message "CRITICAL - Missing arguments" plus CRITICAL status if there are no arguments.

The status of any given ressource is fetched via WMI provider:
Select * from MSCluster_Node WHERE Name = 'NodeName'

You will get "OK" if all nodes are up and joined.

"OK - MSCSNODE01,MSCSNODE02"

If one of the nodes is paused or actually joining you will get a WARNING status.

"WARNING - MSCSNODE02 (paused), UP - MSCSNODE01"

Down nodes or nodes with unknown status will cause the check to return CRITICAL.

"CRITICAL - MSCSNODE02 (down), UP - MSCSNODE01"

The special case - all nodes are paused (or joining) - will also result in critical status since the cluster has no longer high availability status.

"CRITICAL - MSCSNODE01 (paused), MSCSNODE02 (paused), UP - NONE !!!"


Disclaimer:
+++++++++++

This software comes without any warranty and has to be treated "as is". Feel free to change it to fit your needs or contact me for any kind of comment.
Reviews (1)
byamccollough, July 22, 2011
This took me a while to get working, but that's 'cuz I'm a brand new Nagios user. Do note, you need to compile and add in the check_nrpe plugin to your Nagios install for this check_mscs to work.

Also, in the NSC.ini on the cluster server, I had to add in the [NRPE Handlers] entry in there, as there was none.

But it's running, and is rocking. Thank you.