CheckCounter

Used to check performance counters. This is probably how most things can be checked as there are a lot of performance counters. To find performance counters, use the program perfmon that is shipped with windows. You can list all available performance counters using the listpdh option as shown in the examples below.

An important note is that performance counters are language and version specific.

OptionValuesDescription
MaxWarnNumberMaximum allowed number
MaxCritNumberMaximum allowed number
MinWarnNumberMinimum allowed number
MinCritNumberMinimum allowed number
ShowAllNoneA Boolean flag to show value even if no state is returned.
CounterPerformance CounterAdd a performance counter to this check
Counter:<name>Performance CounterAdd a named performance counter. The <name> will be used as an alias.
Averagestrue, falseSet this to false to make performance checking faster of counters that doesn't represent average values.

Examples

Check that mutex count (on WinXP) is below 500:

checkCounter "Counter:mutex=\\Objects\\Mutexes" ShowAll MaxWarn=500 MaxCrit=1000
WARNING: mutex: 673 > warning|mutex=673;500;1000;

Using instances(?) in counters

checkCounter "Counter=\\Processor(_total)\\% Processor Time" ...
...

List all available performance counters, and debug them (means, open, try to read, close, etc)

nsclient++ CheckSystem listpdh
...
"NSClient++.exe" CheckSystem debugpdh
...

I have had to set this up for Counter Checking =-= Greg Small

define command {
        command_name    check_counter
#       command_line    $USER1$/check_nt $HOSTADDRESS$ -p 12489 -v COUNTER -l $ARG1$ -d SHOWALL -w $ARG2$ -c $ARG3$
        command_line    $USER1$/check_nrpe -H $HOSTADDRESS$ -c CheckCounter -a $ARG1$ ShowAll MaxWarn=$ARG2$ MaxCrit=$ARG3$
}

define service{
	use						itx-app-service
	host_name				HOST
	service_description		Microsoft Exchange 5.5 IS RPC Operations / Sec
	check_command 			check_counter!"\\MSExchangeIS\\RPC Operations/sec"!300!400
	}	

define service{
	use						itx-app-service
	host_name				HOST
	service_description		Windows 2000/2003 Physical Disk Time
	check_command 			check_counter!"\\PhysicalDisk(_Total)\\% Disk Time"!60!90
	notes					More than 60 percent indicates a problem.
	}