[mrtg] Re: CPU and Memory utilization

Stefano Giraldo stefano at neotokyo3.it
Wed Aug 4 14:43:13 MEST 2004


If the SNMP OID doesn't work again...
try this shell script:

#!/bin/bash
top -b -n 1 > /etc/script_mrtg/noir_top.txt
sed 's/%/0/g' /etc/script_mrtg/noir_top.txt > /etc/script_mrtg/noir_top1.txt
PL=$(cat /etc/script_mrtg/noir_top1.txt | grep "CPU states:" | awk '{print
$9}')
CU=$(echo 100-$PL | bc)
echo "$CU"

This is on a Debian GNU/Linux... you should check where Solaris
put the value of free processor to change the field of awk...
The sed should be correct also on Solaris.

Bye,

        Ste.

----- Original Message ----- 
From: "Mehdi Kianpour" <mkianpour at kanoon.net>
To: <sprieto at transiciel.es>; <mrtg at list.ee.ethz.ch>
Sent: Wednesday, August 04, 2004 2:18 PM
Subject: [mrtg] Re: CPU and Memory utilization


> try 1.3.6.1.4.1.9.2.1.57, 1.3.6.1.4.1.9.2.1.58.
> ----- Original Message ----- 
> From: <sprieto at transiciel.es>
> To: <mrtg at list.ee.ethz.ch>
> Sent: Wednesday, August 04, 2004 4:38 PM
> Subject: [mrtg] CPU and Memory utilization
>
>
> > Please, I'm looking for OIDs about CPU and Memory utilization in Sun
> > machines (Solaris).
> > I found psProcessCpuTime (.1.3.6.1.4.1.42.3.12.1.1.4) but I can't get
> > values using snmpget. Moreover, I'm not sure if this OID solve my
problem
> > (CPU utilization).
> > In these same machines I can get Traffic In and Traffic Out values using
> > snmpget.
> >
> > Thanks.
> >
> >
> >
> >
> > --
> > Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
> > Archive     http://www.ee.ethz.ch/~slist/mrtg
> > FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
> > WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi
> >
>
> --
> Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
> Archive     http://www.ee.ethz.ch/~slist/mrtg
> FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
> WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi
>
>

--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the mrtg mailing list