[mrtg] Re: testing SNMP_util.pm from the shell
Takumi Yamane
yamtak at b-session.com
Sat Feb 14 01:23:26 MET 2004
Hi, Stuart.
On Sat, 14 Feb 2004 10:41:33 +1100, "Stuart Clark" wrote
in <000201c3f28a$e9f4a980$0100a8c0 at yogi>:
>
> Is there a way to invoke snmp_util.pm from the shell?
I wrote a simple wrapper for that purpose, just for my interest :)
-----------------------------------------------------------------
#!/usr/bin/perl -w -I/usr/local/mrtg/lib/mrtg2
use SNMP_util;
use strict;
# load MIB file
snmpQueue_MIB_File('/usr/local/squid/etc/mib.txt');
my @vals = snmpget(shift, @ARGV);
# my @vals = snmpwalk(shift, @ARGV);
print join("\n", @vals), "\n";
# EOF
-----------------------------------------------------------------
You can invoke it like this:
./MRTGget.pl community at your.agent.ip.addr:port cacheSysVMsize
Hope that helps,
Takumi Yamane <yamtak at b-session.com>
--
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