Plugin for process count with WMI for Windows server 2012

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
mithun havakkanavar
Posts: 1
Joined: Wed Jan 21, 2015 12:48 pm

Plugin for process count with WMI for Windows server 2012

Post by mithun havakkanavar »

Hi All,

I have created a command as check_run.exe as shown below

$USER1$/check_wmi_plus.pl -H $HOSTADDRESS$ -u $ARG1$ -p $ARG2$ -m $ARG3$ $ARG4$ -o $ARG5$ -c 10

It works fine but it Triggers a Critical Alert when the process count is more then 10, our requirement is vise-verse.
We want the Alert to Triggered once the process count is less then 10.

Please us to get the alerts when the number of processes get reduced

Thanks
Mithun
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Plugin for process count with WMI for Windows server 201

Post by slansing »

Have you considered using negate? This guide was written for XI but it holds true to core as well:

http://assets.nagios.com/downloads/nagi ... ios-XI.pdf
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Plugin for process count with WMI for Windows server 201

Post by Box293 »

It might also be worthwhile reading this page

http://www.edcint.co.nz/checkwmiplus/?q ... lewarncrit
Given the above states, if we wanted to warn if there were less than 4 "good" services we have use a slightly different form of the range definition. We want to define a range that is from 4 to infinity, so that if we are outside this we get a warning. 4: defines a range like this.
Command: check_wmi_plus.pl -H HOST -u USER -p PASS -m checkservice -a sql -w _NumGood=4:
Output : WARNING - [Triggered by _NumGood<4] - Found 6 Services(s), 2 OK and 4 with problems (0 excluded). 'Microsoft Search (Exchange)' (msftesql-Exchange) is Stopped, 'SQL Server (SQLEXPRESS)' (MSSQL$SQLEXPRESS) is Running, 'SQL Active Directory Helper Service' (MSSQLServerADHelper100) is Stopped, 'SQL Server Agent (SQLEXPRESS)' (SQLAgent$SQLEXPRESS) is Stopped, 'SQL Server Browser' (SQLBrowser) is Running, 'SQL Server VSS Writer' (SQLWriter) is Stopped.|'Total Service Count'=6; 'Service Count OK State'=2;4; 'Service Count Problem State'=4; 'Excluded Service Count'=0;
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
User avatar
lgroschen
Posts: 384
Joined: Wed Nov 27, 2013 1:17 pm

Re: Plugin for process count with WMI for Windows server 201

Post by lgroschen »

@mithun havakkanavar:

let us know if there documents work when you have the time to try look at them.
/Luke
Locked