0

I thought snmpbulkget acts like snmpget except that it can support multiple oid requests. But I see weird behavior. It gives next OID info instead of what is asked:

snmpbulkget -Cr1 servername IF-MIB::ifSpeed.7.0 IF-MIB::ifInOctets.7 IF-MIB::ifInUcastPkts.7 IF-MIB::ifInNUcastPkts.7 IF-MIB::ifInNUcastPkts.7 IF-MIB::ifInDiscards.7 IF-MIB::ifInErrors.7 IF-MIB::ifOutOctets.7 IF-MIB::ifOutUcastPkts.7 IF-MIB::ifOutNUcastPkts.7 IF-MIB::ifOutDiscards.7 IF-MIB::ifOutErrors.7
IF-MIB::ifSpeed.8 = Gauge32: 10000000
IF-MIB::ifInOctets.8 = Counter32: 3674120514
IF-MIB::ifInUcastPkts.8 = Counter32: 2462391943
IF-MIB::ifInNUcastPkts.8 = Counter32: 19169575
IF-MIB::ifInNUcastPkts.8 = Counter32: 19169575
IF-MIB::ifInDiscards.8 = Counter32: 0
IF-MIB::ifInErrors.8 = Counter32: 775777
IF-MIB::ifOutOctets.8 = Counter32: 3824588280
IF-MIB::ifOutUcastPkts.8 = Counter32: 2866781089
IF-MIB::ifOutNUcastPkts.8 = Counter32: 0
IF-MIB::ifOutDiscards.8 = Counter32: 0
IF-MIB::ifOutErrors.8 = Counter32: 0

Why?

GP92
  • 599
  • 2
  • 6
  • 25

1 Answers1

2

snmpget will send a single packet containing several OIDs (you can verify this using the -d option). So changing your command to use snmpget (and removing the -Cr1 option) will do what you want.

Alternatively you could BULKGET IF-MIB::ifEntry which gives you more than you want.

snmpbulkget (or rather the underlying GETBULK/GETNEXT) methods always return the next variable in the tree.

Quoting from http://net-snmp.sourceforge.net/wiki/index.php/GETBULK ...

The GETNEXT command (GetnextRequest) requests a list of instances from a remote entity, but expects the next variable in the tree back.

Paul Haldane
  • 4,457
  • 1
  • 20
  • 31