[mrtg] Re: cpu load

Glenn Forbes Fleming Larratt glratt at is.rice.edu
Thu Jul 29 17:34:44 MEST 1999


1.On the target machine foo (if it's Solaris; other UNIXen may require
tweaking, don't know NT), install "loadavg": 

#!/usr/local/bin/perl
@w = `/usr/ucb/w`;
while(!$w[0] =~ /\s+load average:\s+(\S+),\s/)
{ shift(@w) ; }
$w[0] =~ /\s+load average:\s+(\S+),\s/;
printf "%d\n0\n0\n0\n",100*$1;

2.Set up MRTG host to be able to no-password ssh into foo.

3.target[foo.cpu] `{fullpath}/ssh foo {fullpath}/loadavg`

4.(if target foo is occasionally down), on MRTG host (same caveats
regarding Solaris above), install "sshq":

#!/usr/local/bin/perl
if(system("/usr/sbin/ping $ARGV[0] > /dev/null"))
{ printf "\n\n\n%s appears to be down\n",$ARGV[0]; }
else
{ system("/usr/local/bin/ssh @ARGV"); }

, then substitute sshq for ssh in #3 above.

	-g


On Thu, 29 Jul 1999, Andre Kuellenberg wrote:

> Date: Thu, 29 Jul 1999 12:19:20 +0200
> From: Andre Kuellenberg <meiner at wtal.de>
> To: mrtg at list.ee.ethz.ch
> Subject: [mrtg] cpu load
> 
> Hi everybody!
> 
> I'd like use MRTG to display the load of my server cpu on my homepage, but i
> have no idea how to do this. I'm running Linux with the kernel 2.2.7 and
> cmu-snmp 3.6 on my server.
> Thank you in advance!
> 
> 	Andre
> 
> --
> * To unsubscribe from the mrtg mailing list, send a message with the
>   subject: unsubscribe to mrtg-request at list.ee.ethz.ch
> * The mailing list archive is at http://www.ee.ethz.ch/~slist/mrtg
> 
> 

Glenn Forbes Fleming Larratt       glratt at rice.edu
http://is.rice.edu/~glratt         Neil Talian?
"Hatred is a self-indulgence [we] cannot afford." - Bill Bradley


--
* To unsubscribe from the mrtg mailing list, send a message with the
  subject: unsubscribe to mrtg-request at list.ee.ethz.ch
* The mailing list archive is at http://www.ee.ethz.ch/~slist/mrtg


More information about the mrtg mailing list