Is GetBulkHandler works correctly?

Hi Frank,
I got below results which seems strange for ‘snmpbulkget’.
If my understanding is correct, I expect it responds with the results of the requested 2 OIDs, but it didn’t. And where are ‘4976.10.1.1.20.1.4.1.2.x’ from?
Could you please help to clarify about this? How to debug this?
Very appreciated.

I use snmp4j-agent-2.6.0 and snmp4j-2.5.3.
OIDs are from example code ‘Snmp4jDemoMib.java’.
The commands ‘snmpbulkget’ / ‘snmpwalk’ are from net-snmp.

[vcapuser@localhost ~]$ snmpwalk -c public -v 2c localhost 1.3.6.1.4.1.4976.10.1.1.20.1.1.0
SNMPv2-SMI::enterprises.4976.10.1.1.20.1.1.0 = STRING: "TestResponse"

[vcapuser@localhost ~]$ snmpwalk -c public -v 2c localhost 1.3.6.1.4.1.4976.10.1.1.20.1.3.0
SNMPv2-SMI::enterprises.4976.10.1.1.20.1.3.0 = INTEGER: 5

[vcapuser@localhost ~]$ snmpbulkget -c public -v 2c localhost 1.3.6.1.4.1.4976.10.1.1.20.1.3.0 1.3.6.1.4.1.4976.10.1.1.20.1.1.0
SNMPv2-SMI::enterprises.4976.10.1.1.20.1.4.1.2.1 = INTEGER: 1
SNMPv2-SMI::enterprises.4976.10.1.1.20.1.3.0 = INTEGER: 5
SNMPv2-SMI::enterprises.4976.10.1.1.20.1.4.1.2.2 = INTEGER: 1
SNMPv2-SMI::enterprises.4976.10.1.1.20.1.4.1.2.1 = INTEGER: 1
SNMPv2-SMI::enterprises.4976.10.1.1.20.1.4.1.2.3 = INTEGER: 1
SNMPv2-SMI::enterprises.4976.10.1.1.20.1.4.1.2.2 = INTEGER: 1
SNMPv2-SMI::enterprises.4976.10.1.1.20.1.4.1.2.4 = INTEGER: 1
SNMPv2-SMI::enterprises.4976.10.1.1.20.1.4.1.2.3 = INTEGER: 1
SNMPv2-SMI::enterprises.4976.10.1.1.20.1.4.1.2.5 = INTEGER: 1
SNMPv2-SMI::enterprises.4976.10.1.1.20.1.4.1.2.4 = INTEGER: 1
SNMPv2-SMI::enterprises.4976.10.1.1.20.1.4.1.2.6 = INTEGER: 1
SNMPv2-SMI::enterprises.4976.10.1.1.20.1.4.1.2.5 = INTEGER: 1
SNMPv2-SMI::enterprises.4976.10.1.1.20.1.4.1.2.7 = INTEGER: 1
SNMPv2-SMI::enterprises.4976.10.1.1.20.1.4.1.2.6 = INTEGER: 1
SNMPv2-SMI::enterprises.4976.10.1.1.20.1.4.1.2.8 = INTEGER: 1
SNMPv2-SMI::enterprises.4976.10.1.1.20.1.4.1.2.7 = INTEGER: 1
SNMPv2-SMI::enterprises.4976.10.1.1.20.1.4.1.2.9 = INTEGER: 1
SNMPv2-SMI::enterprises.4976.10.1.1.20.1.4.1.2.8 = INTEGER: 1
SNMPv2-SMI::enterprises.4976.10.1.1.20.1.4.1.2.10 = INTEGER: 1
SNMPv2-SMI::enterprises.4976.10.1.1.20.1.4.1.2.9 = INTEGER: 1

Please be always careful with the NET-SNMP tools. They do a lot of tricks that are illogical for SNMP insiders. In this case you might think that a WALK and a BULK request with a NET-SNMP tool uses the same SNMP PDU type. That’s wrong and even worse, some NET-SNMP tools use two or more different PDU types and requests for a single operation.

In your case, the WALK actually sends a GET request. That’s why you get the same OID back as response (as long as it exists in the agent).

The snmpbulkget does not send a GET, it sends a GET-BULK PDU which actually is an agent side executed list of concatenated GETNEXT operations. Thus you will never get the OIOD you requested but the next successor of it in the agent and the next of that and so on depending of the number of repeaters you specified in the request. In this example the non-repeaters where 0 and the max-repetition was specified as 10.

Thanks Frank,
now I get what I expect with a ‘-Cr1’ parameter set.

[vcapuser@localhost ~]$ snmpbulkget -Cr1 -c public -v 2c localhost 1.3.6.1.4.1.4976.10.1.1.20.1.1 1.3.6.1.4.1.4976.10.1.1.20.1.2.1

SNMPv2-SMI::enterprises.4976.10.1.1.20.1.1.0 = STRING: "TestResponse"

SNMPv2-SMI::enterprises.4976.10.1.1.20.1.3.0 = INTEGER: 1

[vcapuser@localhost ~]$