Build precise queries to find exactly what you need
Press ESC to close
Join our next live webinar: “Advanced Nagios Monitoring Techniques” – Register Now
Your review has been submitted and is pending approval.
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
Owner
Nagios Exchange
Compatible With
check_cpu v0.0.2
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 =)
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
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:~>
You must be logged in to submit a review.
To:
From: