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
Email: sales@nagios.com

Login

Remember Me

check_cpu

Rating
1 vote
Favoured:
0
Hits
147825
Files:
FileDescription
check_cpu.txtPython plugin to report the amount of idle CPU on unix based systems.

Help Support Ethan Galstad's New Project:

Help Support Ethan

A Message From The Founder...

As the founder of Nagios, I'm asking for your help in a cause that's dear to my heart.

I'm launching a new project to help better the world by providing the information, ideas, and inspiration that I believe can improve the lives of people everywhere.

I know you're busy managing networks, but I would appreciate it if you would consider liking my Facebook page and showing your support for the content and messages I produce by sharing them with your friends and family.

You can learn more about my project by visiting ethangalstad.me/nagios. Thank you for your time. I wish you all the best in your endeavors, whatever they may be.

- Ethan

Python plugin to report the amount of idle CPU on unix based systems.
I use this in conjunction with a plugin to monitor the user count. Obsess over both and utilise the gathered info in capacity management.

I prefer this to other cpu checks as it returns an average figure over a time period rather than a snapshot.

Requires Python 2.2 or above (or Optik python plugin for python 2.0+)

Currently tested on RH 7.x, 8.0, 9.0, Fedora Core1, Fedora Core2, Fedora Core3, FreeBSD, OpenBSD, NetBSD, (K)Ubuntu, Slackware. Full testing required for SUSE & Debian, though I believe that it works under these OSes.

Looking for people to test under other unix systems. Solaris supported, but requires Python which is not part of the native install.

Current version is 0.4.0.
Reviews (1)
There was bug when the first item (r) is not one char.
That is a simple fix for it:

--- check_cpu.py.orig 2011-11-05 20:23:46.000000000 +0100
+++ check_cpu.py 2011-11-05 20:14:00.000000000 +0100
@@ -117,13 +117,13 @@


statLines = string.split( statOut, '\n')
-lastLine = statLines[-2]
+lastLine = statLines[-2].strip()

n = len(statLines)
for i in range(0, n):
idcheck = re.search("id", statLines[i])
if idcheck:
- idLine = statLines[i]
+ idLine = statLines[i].strip()