[Nagiosplug-devel] [ nagiosplug-New Plugins-744254 ] check_cpuload

SourceForge.net noreply at sourceforge.net
Wed Apr 20 21:40:26 CEST 2005


New Plugins item #744254, was opened at 2003-05-27 09:22
Message generated for change (Comment added) made by sghosh
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=541465&aid=744254&group_id=29880

Category: Perl plugin
Group: None
Status: Open
>Resolution: Accepted
Priority: 5
Submitted By: Roy Sigurd Karlsbakk (rkarlsba)
Assigned to: Nobody/Anonymous (nobody)
Summary: check_cpuload

Initial Comment:
Simple perl plugin to check for CPU load on local linux machines 
using the sysstat package (sar)

----------------------------------------------------------------------

Comment By: Subhendu Ghosh (sghosh)
Date: 2005-04-21 00:39

Message:
Logged In: YES 
user_id=46572

Thanks for your patience.

Contribs are being updated.

-Subhendu Ghosh

----------------------------------------------------------------------

Comment By: Roy Sigurd Karlsbakk (rkarlsba)
Date: 2003-06-03 05:50

Message:
Logged In: YES 
user_id=145309

New version.
More bug fixes. There were some brown paper bag bugs in 
the Getopt::Long usage :(
Now it only checks for (a) the OS is in the supported_os 
hash, and (b) if it's linux, then parse it otherwise than the 
others (that is - it defaults to solaris/hpsux sar output format.

----------------------------------------------------------------------

Comment By: Roy Sigurd Karlsbakk (rkarlsba)
Date: 2003-06-03 05:13

Message:
Logged In: YES 
user_id=145309

Uploaded new version with hpux support added.
Does anyone know if AIX or other unix flavours have the same 
output? BSD?

----------------------------------------------------------------------

Comment By: Tommy Fallsen (doffen24)
Date: 2003-06-03 04:35

Message:
Logged In: YES 
user_id=788346

Though you like to know that HP-UX 11 sar command has the 
same output as solaris and by doing this the script works on
HP-UX 11, not sure about older versions.


added hpux to %supported_os and cut' paste line 87 - 94 and 
change solaris to hpux.




----------------------------------------------------------------------

Comment By: Roy Sigurd Karlsbakk (rkarlsba)
Date: 2003-06-02 03:21

Message:
Logged In: YES 
user_id=145309

Last update includes adding 'licenced under GPL', so this can hopefully 
be included with the nagios plugins some time ...

----------------------------------------------------------------------

Comment By: Roy Sigurd Karlsbakk (rkarlsba)
Date: 2003-05-28 05:43

Message:
Logged In: YES 
user_id=145309

Added new version.
This can actually be called usable.
Solaris and linux support.

----------------------------------------------------------------------

Comment By: Tommy Fallsen (doffen24)
Date: 2003-05-28 04:47

Message:
Logged In: YES 
user_id=788346

The output is solaris

----------------------------------------------------------------------

Comment By: Roy Sigurd Karlsbakk (rkarlsba)
Date: 2003-05-28 04:35

Message:
Logged In: YES 
user_id=145309

Can you send me the output from this on your solaris box?

perl -e 'print "$^O\n"'



----------------------------------------------------------------------

Comment By: Tommy Fallsen (doffen24)
Date: 2003-05-28 03:59

Message:
Logged In: YES 
user_id=788346

Its your script so you should rewrite it if you want to. This is 
how i changed it , and below is what sar 1 3 gives in Solaris 
(its the same for OS versions 2.6, 7 , and 8).

        if (/^Average/) {
                @values = split(/\s+/);
                $user = $values[1];
                $system = $values[2];
                $iowait = $values[3];
                $idle = $values[4];
                $stop = 1;
	}

SunOS ask 5.8 Generic_108528-21 sun4u    05/28/03

09:57:24    %usr    %sys    %wio   %idle
09:57:25       2      13       0      85
09:57:26       2       2       0      96
09:57:27       1      12       1      86

Average        2       9       0      89

SunOS levanger 5.6 Generic_105181-31 sun4u    05/28/03

09:58:31    %usr    %sys    %wio   %idle
09:58:32      18       7      19      56
09:58:33      22      13      16      50
09:58:34      23      16      13      49

Average       21      12      16      52


----------------------------------------------------------------------

Comment By: Roy Sigurd Karlsbakk (rkarlsba)
Date: 2003-05-28 03:39

Message:
Logged In: YES 
user_id=145309

What if you rewrite it to support Solaris?
Then we can do an OS check before running sar.

----------------------------------------------------------------------

Comment By: Tommy Fallsen (doffen24)
Date: 2003-05-28 03:33

Message:
Logged In: YES 
user_id=788346

Ignore last comment, output of sar in solaris too different. 
Sorry

----------------------------------------------------------------------

Comment By: Tommy Fallsen (doffen24)
Date: 2003-05-28 02:58

Message:
Logged In: YES 
user_id=788346

If you remove : in if (/^Average:/) { it will work in Solaris too.

----------------------------------------------------------------------

Comment By: Roy Sigurd Karlsbakk (rkarlsba)
Date: 2003-05-27 09:27

Message:
Logged In: YES 
user_id=145309

WARNING
This isn't finished
This is only for testing and further development

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=541465&aid=744254&group_id=29880




More information about the Devel mailing list