Linux

check_cpu.sh (matejunkie)

Description:

sh compliant script to check CPU utilization via /proc/stat instead of top or iostat (PNP template included)

Current Version

Last Release Date

June 8, 2009

Compatible With


Project Files
Project Notes
Description check_cpu.sh 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 Version 1.0, 2009, Mike Adolphs (http://www.matejunkie.com/) -h/--help Output check_cpu.sh [-i/--interval] [-w/--warning] [-c/--critical] Options: --interval|-i) Defines the pause between the two times /proc/stat is being parsed. Higher values could lead to more accurate result. Default is: 1 second --warning|-w) Sets a warning level for CPU user. Default is: off --critical|-c) Sets a critical level for CPU user. Default is: off Output example user@host:~$ ./check_cpu.sh 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 Changelog * 2009-05-14 o Small bugfix of an exit code
Reviews (3) Add a Review
Remote monitor
by unassassinable, April 30, 2012

I don't see any options for monitoring a remote host. Is this possible?



Small Bug
by GeorgThoma, November 30, 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.



doesn't work on gentoo
by Majed, July 31, 2011

./check_cpu_se.sh gives output on redhat but error on command line 118 and several others on gentoo, works through nrpe and draws graphs on pnp4nagios



Add a Review

You must be logged in to submit a review.

Thank you for your review!

Your review has been submitted and is pending approval.

Recommend

To:


From:


Thank you for your recommendation!

Your recommendation has been sent.

Project Stats
Rating
3.8 (5)
Favorites
1
Views
119,675