[mrtg] snmpget + CPU usage

MATEI Alexandru Alexandre.Matei at depinfo.enseeiht.fr
Wed Apr 26 18:23:34 MEST 2000


I want to monitor real-time CPU usage on my router, using the snmpget
function from SNMP_utils.pm module, by polling the device each 5 secs..
I used:

use SNMP_util "0.71";
while (1)
{
    $cpu_5sec=snmpget("public"."@"."router", "1.3.6.1.4.1.9.2.1.56.0");
    print "CPU 5 sec: $cpu_5sec";
    sleep(5);
}

I always get 1 as the value of $cpu_5sec, which is not correct (I also
use the "straight" way, e.g. via a cfg file + Netscape, compare with
SunNet Manager results, and I get identical values, but I'm interested
in real-time CPU usage evolution)
If I replace that OID with something else, like 1.1.1.1.1.1, I do get an
error message coming from the router, saying:

SNMPGET Problem for 1.1.1.1.1.1.1.1 on public at router, error status:
noSuchName

which is normal, because that OID doesn't really exist, I used just for
testing purposes.
Could anyone give me an idea about?

P.S."public" and "router" were of course replaced with real strings


--
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



More information about the mrtg mailing list