
Linux
check_cpu.sh
Description:
sh-compliant script to check CPU utiliziation via Jiffies instead of parsing another frontend tool
Current Version
1.0
Last Release Date
2009-05-14
Compatible With
- Nagios 2.x
- Nagios 3.x
Owner
Website
Project Files
File | Description |
---|---|
check_cpu.sh | The plugin (v1.0) |
check_cpu.php | The appropriate PNP Template |
LICENSE | GNU GPLv2 License |
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.
-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
* Small bugfix of an exit code
Reviews
(1)
Add a Review
Just One small correction , the pnp4nagios has an error with name of the fields :
$def[1] = "DEF:used=$rrdfile:$DS[1]:AVERAGE " ;
$def[1] .= "DEF:nice=$rrdfile:$DS[2]:AVERAGE " ;
$def[1] .= "DEF:sys=$rrdfile:$DS[3]:AVERAGE " ;
$def[1] .= "DEF:softirq=$rrdfile:$DS[4]:AVERAGE " ;
$def[1] .= "DEF:iowait=$rrdfile:$DS[5]:AVERAGE " ;
$def[1] .= "DEF:irq=$rrdfile:$DS[6]:AVERAGE " ;
$def[1] .= "DEF:idle=$rrdfile:$DS[7]:AVERAGE " ;
Regards,Diego
Page Sections
Project Stats
Rating
5 (1)
Favorites
1
Views
117,583