[rrd-users] SNMP: Strange Results?

Michael Bischof mb at byteworks.ch
Thu Aug 10 23:53:13 MEST 2000


I have a strange problem...

If I read all interfaces from a router with a script

---cut on---
#!/usr/bin/perl -w

use SNMP;

# Connect to router
$snmp = new SNMP::Session(
   DestHost   => 'aaa.bbb.ccc.ddd',
   Community  => 'public',
) or die "Can't connect!";

# Get interfaces
my $vars = new SNMP::VarList([ifIndex, 0], [ifDescr, 0], [ifInOctets, 0],
[ifOutOctets, 0]);

for (my @temp = $snmp->getnext($vars);
   $vars->[0]->tag =~ /ifIndex/ and not $snmp->{ErrorStr};
   @temp = $snmp->getnext($vars)) {

   print join('|', @temp) . "\n";
}
---cut of---

...I get some incorrect values (some IfInOctets and IfOutOctets Values are 0
??!!)

---cut on---
135|Hssi1/0/0.540|128000|1|1|0|0
136|Hssi1/0/0.541|256000|1|1|0|0
137|Hssi1/0/0.542|128000|1|1|0|406
138|Hssi1/0/0.543|128000|1|1|1194347495|3409994862
139|Hssi1/0/0.546|128000|1|1|9662677|9392801
141|Hssi1/0/0.548|512000|1|1|2603329|4800133
142|Hssi11/1/0.520|2048000|1|1|0|0
143|Hssi11/1/0.521|2048000|1|1|17282807|182846511
144|Hssi1/0/0.545|128000|1|1|0|0
145|Hssi1/0/0.544|128000|1|1|2397031|11856597
146|Hssi1/0/0.547|64000|1|2|53677194|542636808
---cut off---

Look at line starting with 142 (142 ist the ifIndex)

If I read this values with the snmpwalk program then I get the correct
results!!

---cut on---
>>> snmpwalk router public interfaces.ifTable.ifEntry.ifDescr | grep "520"
interfaces.ifTable.ifEntry.ifDescr.95 = Hssi1/0/0.520
interfaces.ifTable.ifEntry.ifDescr.142 = Hssi11/1/0.520

>>> snmpwalk router public interfaces.ifTable.ifEntry.ifDescr.142
interfaces.ifTable.ifEntry.ifDescr.142 = Hssi11/1/0.520

>>> snmpwalk router public interfaces.ifTable.ifEntry.ifInOctets.142
interfaces.ifTable.ifEntry.ifInOctets.142 = 1073745052

>>> snmpwalk router public interfaces.ifTable.ifEntry.ifOutOctets.142
interfaces.ifTable.ifEntry.ifOutOctets.142 = 504767463
---cut off---

DOES ANYBODY HAVE AN IDEA WHY?

Thanks,

    Michael





--
Unsubscribe mailto:rrd-users-request at list.ee.ethz.ch?subject=unsubscribe
Help        mailto:rrd-users-request at list.ee.ethz.ch?subject=help
Archive     http://www.ee.ethz.ch/~slist/rrd-users
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the rrd-users mailing list