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


Remember Me

Directory Tree (matejunkie)

5 votes
check_cpu.phpPNP Template
check_cpu.shThe script (Version 1.0)
LICENSEThe appropriate license
Network Monitoring Software - Download Nagios XI
Log Management Software - Nagios Log Server - Download
Netflow Analysis Software - Nagios Network Analyzer - Download
sh compliant script to check CPU utilization via /proc/stat instead of top or iostat (PNP template included)
Description is a Nagios plugin to monitor CPU utilization. It makes use of /proc/stat and calculates it through Jiffies rather than using another frontend tool like iostat or top. When using optional warning/critical thresholds all values except idle are aggregated and compared to the thresholds. There's currently no support for warning/critical thresholds for specific usage parameters.

Version 1.0, 2009, Mike Adolphs (
-h/--help Output [-i/--interval] [-w/--warning] [-c/--critical]

Defines the pause between the two times /proc/stat is being parsed.
Higher values could lead to more accurate result. Default is:
1 second
Sets a warning level for CPU user. Default is: off
Sets a critical level for CPU user. Default is: off

Output example

user@host:~$ ./
OK - user: 8.42, nice: 0.50, sys: 6.66, iowait: 0.50, irq: 0.50, softirq: 0.50 idle: 86.40 | 'user'=8.42 'nice'=0.50 'sys'=6.66 'softirq'=0.50 'iowait'=0.50 'irq'=0.50 'idle'=86.40

* 2009-05-14
o Small bugfix of an exit code

Reviews (3)
byunassassinable, April 13, 2012
I don't see any options for monitoring a remote host. Is this possible?
byGeorgThoma, November 29, 2011
This plugins is good but has a small mistake in the PNP4Nagios template. The iowait is 4th value in chech_cpu.php and the 5th value in the perfdata output.

But overall a usefull plugin with nice template.
byMajed, July 17, 2011
gives output on redhat but error on command line 118 and several others on gentoo,
works through nrpe and draws graphs on pnp4nagios