Guides‎ > ‎Common Checks‎ > ‎

CPU Load / Usage

CPU Load

Check the CPU Load for 1 minute, 5 minute and 15 minute intervals (common in Unix/Linux). Warning alert at 80% usage and critical alert at 90% usage.

NSClient++ 0.3.9 & 0.4.x
No additional configuration is required.
Command:
check_nrpe -H 192.168.142.137 -t 30 -c CheckCPU -a warn=80 crit=90 time=1m time=5m time=15m

Output:
OK CPU Load ok.|'1m'=5%;80;90 '5m'=17%;80;90 '15m'=23%;80;90

Windows Performance Counters

CPU Usage can be measured using performance counters.

There are a couple of different performance counters available, these are the ones that I think are most useful:
  • % Idle Time
    • This is the percentage of time the processor is idle during the sample interval.
  • % Processor Time
    • This is the percentage of elapsed time that the processor spends to execute a non-Idle thread. It is calculated by measuring the percentage of time that the processor spends executing the idle thread and then subtracting that value from 100%. This counter is the primary indicator of processor activity, and displays the average percentage of busy time observed during the sample interval.
How does this account for multiple core systems? There is a counter for the total of a counter (all objects) or a specific core:
  • % Idle Time for ALL cores
    • \Processor(_Total)\% Idle Time
  • % Processor Time for core number 3
    • \Processor(3)\% Processor Time
  • NOTE: Core counting starts a 0
    • So in an eight core system, the eighth core is 7
Warning and Critical Threshold Values
The values in the examples provided are for demonstration purposes, you will need to adjust them to suit your environment.

Labels When Using NSClient++
Normally the output is as follows:
  • Command:
    • check_nrpe -H 10.25.14.2 -c CheckCounter -a 'Counter=\Processor(0)\% Processor Time' ShowAll MaxWarn=80 MaxCrit=90
  • Output:
    • OK: \Processor(0)\% Processor Time: 21.5381|'\Processor(0)\% Processor Time'=21.53809;80;90

However I like to provide my own label as I don't need to display the whole name of the performance counter in my output. To do this, you simply add the label Counter<:here>= (before the equal sign, starting with a column). For example:
  • Command:
    • check_nrpe -H 10.25.14.2 -c CheckCounter -a 'Counter:% Processor Used Core 0=\Processor(0)\% Processor Time' ShowAll MaxWarn=80 MaxCrit=90
  • Output:
    • OK: % Processor Used Core 0: 21.5381|'% Processor Used Core 0'=21.53809;80;90
So you can see it looks cleaner ... well that's my opinion anyway :)


OK so on with the examples ...

% CPU Used

Check the amount of Processor usage. Warning alert at 80% usage and critical alert at 90% usage.

Total (All Cores)

NSClient++ 0.3.9 & 0.4.1

No additional configuration is required.
Command:
check_nrpe -H 10.25.14.2 -c CheckCounter -a 'Counter:% Processor Used Total=\Processor(_Total)\% Processor Time' ShowAll MaxWarn=80 MaxCrit=90

Output:
OK: % Processor Used Total: 23.0766|'% Processor Used Total'=23.07656;80;90


NSClient++ 0.5.0.17 onwards

No additional configuration is required.
Command:
check_nrpe -H 10.25.14.2 -c check_pdh -a 'counter:% Processor Used Total=\Processor(_Total)\% Processor Time' 'warning=value>80' 'critical=value>90' 'perf-config=*(suffix:none)'

Output:
WARNING: % Processor Used Total = 85|'% Processor Used Total'=85;80;90


Specific Core (#3)

NSClient++ 0.3.9 & 0.4.1
No additional configuration is required.
Command:
check_nrpe -H 10.25.14.2 -c CheckCounter -a 'Counter:% Processor Used Core 3=\Processor(3)\% Processor Time' ShowAll MaxWarn=80 MaxCrit=90

Output:
OK: % Processor Used Core 3: 23.0766|'% Processor Used Core 3'=23.07656;80;90


NSClient++ 0.5.0.17 onwards
No additional configuration is required.
Command:
check_nrpe -H 10.25.14.2 -c check_pdh -a 'counter:% Processor Used Core 3=\Processor(3)\% Processor Time' 'warning=value>80' 'critical=value>90' 'perf-config=*(suffix:none)'

Output:
WARNING: % Processor Used Core 3 = 85|'% Processor Used Core 3'=85;80;90

% CPU Free

Check the amount of Processor that is free. Warning alert at 20% free and critical alert at 10% free.

Total (All Cores)

NSClient++
0.3.9 & 0.4.1
No additional configuration is required.
Command:
check_nrpe -H 10.25.14.2 -c CheckCounter -a 'Counter:% Processor Free Total=\Processor(_Total)\% Idle Time' ShowAll MinWarn=20 MinCrit=10

Output:
OK: % Processor Free Total: 78.4619|'% Processor Free Total'=78.461902;20;10

NSClient++ 0.5.0.17 onwards
No additional configuration is required.
Command:
check_nrpe -H 10.25.14.2 -c check_pdh -a 'counter:% Processor Free Total=\Processor(_Total)\% Idle Time' 'warning=value<20' 'critical=value<10' 'perf-config=*(suffix:none)'

Output:
OK: % Processor Free Total = 100|'% Processor Free Total'=100;20;10

Specific Core (#3)

NSClient++ 0.3.9 & 0.4.1
No additional configuration is required.
Command:
check_nrpe -H 10.25.14.2 -c CheckCounter -a 'Counter:% Processor Free Core 3=\Processor(3)\% Idle Time' ShowAll MinWarn=20 MinCrit=10

Output:
OK: % Processor Free Core 3: 70.0003|'% Processor Free Core 3'=70.000321;20;10

NSClient++ 0.5.0.17 onwards
No additional configuration is required.
Command:
check_nrpe -H 10.25.14.2 -c check_pdh -a 'counter:% Processor Free Core 3=\Processor(3)\% Idle Time' 'warning=value<20' 'critical=value<10' 'perf-config=*(suffix:none)'

Output:
OK: % Processor Free Core 3 = 100|'% Processor Free Core 3'=100;20;10