Linux

check_cpu – % used

Description:

Check the amount in % of used cpu on a linux system using either procinfo or sar (whichever is available)

Current Version

Last Release Date

June 16, 2009

Compatible With


Project Files
Project Notes
The pourpose of this plugin is to be the simplest check_cpu as possible. Following the unix philosophy of simplicity and code/tools reusability, it was created aiming maximum use of largely available tools and minimum own code, and even this minumum code is written in (super-simple and highly-portable) Bourne Shell script. This simplicity was really easy to achieve, since there are already pretty common linux command-line tools that actually do all the dirt job =). So, in the hopes that this little script may be useful for someone, I present you with this straight-forward, super-simple, zero-bloated, with-no-obscure-dependencies, Bourne Shell script for CPU checking in Linux systems (may work on others POSIX systems too). The plugin simply tests the existance of procinfo and sar, and uses whichever of them is available (if none of them is available, the plugin fails). Then, it executes the external program grabbing the line which tells the average idle time. From this, it simply deduces the used % and print it suitable for nagios input. Nothing more =)
Reviews (2) Add a Review
Not working at all from command line
by stlouistechy@gmail.com, August 31, 2015

Installed procinfo, then: $./check_cpu -c 90 -w 80 ./check_cpu: 11: ./check_cpu: function: not found -e This plugin shows the % of used CPU, using either procinfo or sar (whichever is available) ./check_cpu: -c If the % of used CPU is above , returns CRITICAL state -w If the % of used CPU is below CRITICAL and above , returns WARNING state



Not getting proper output
by jabbasi, May 31, 2013

I am using SUSE 11 and when i run this i am getting nagios@cubic:~> ./check_cpu -c 95 -w 90 expr: syntax error OK - CPU used=% idle=% | 'CPU Usage'=%;90;95; nagios@cubic:~>



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
2 (2)
Favorites
0
Views
150,649