On Fri, Sep 26, 2008 at 01:45:35PM +0200, Rene Fritzsche wrote: > Hi, > > > >Show us the output of your snmpget command. I guess it looks like this: > > > > >[EMAIL PROTECTED]:~$ snmpwalk -v2c -c public 192.168.1.222 > > >1.3.6.1.2.1.2.2.1.16.4 > > >IF-MIB::ifOutOctets.4 = Counter32: 262658353 > > > > Yes, the output is : IF-MIB::ifOutOctets.4 = Counter32: 461597000 > > as Alexander wrote; this whole output-line can not be used to be filled Hi.
I'm not Alexander but thats o.k. :P > to > snmpwalk ... 1.3.6.1.2.1.2.2.1.16.4 | sed 's/^.*: \([0-9]*]\)$/\1/' > $out Or just use the man snmpget to get the options for snmpget to get a more "parsable" result. Obviously this depends on your snmp programs. E.g. my net-snmp uses the switch -Oq to get a result that is easier to parse: [EMAIL PROTECTED]:~$ snmpget -Oq -v2c -c public 192.168.1.222 1.3.6.1.2.1.2.2.1.16.4 IF-MIB::ifOutOctets.4 269735286 [EMAIL PROTECTED]:~$ snmpget -Oq -v2c -c public 192.168.1.222 1.3.6.1.2.1.2.2.1.16.4 | cut -d ' ' -f 2 269736768 HTH, Andreas. -- Dipl.-Ing. Andreas Maus science+computing ag System Administration Hagellocher Weg 73 tel.: +49 7071 9457 671 72070 Tuebingen, Germany fax: +49 7071 9457 411 www.science-computing.de
pgpK7m6tPT4bN.pgp
Description: PGP signature
_______________________________________________ rrd-users mailing list [email protected] https://lists.oetiker.ch/cgi-bin/listinfo/rrd-users
