[SNMP4J] SNMP4j 2.2.3 / 2.2.5 bulkwalk problem

Frank Fock fock at agentpp.com
Mon Mar 3 09:08:34 CET 2014


Hi Johann,

SNMP4J works fine here. The agent does not return more than 10 repetitions
(which is fine according to the SNMP standard, the agent may at any time 
decide
to return less than the max repetitions).
Your code must be able to cope with that.
Have you seen the TreeUtils class in SNMP4J yet? It simplifies the walk 
operation
for you.

BTW, OIDs do not start with a dot. It seems the whole world is using it 
that way
although only NET-SNMP uses this non-standard notation to distinguish
"absolute" OIDs (OIDs are always absolute) from relative OIDs (which in 
fact do
not exist).

Best regards,
Frank

Am 03.03.2014 09:01, schrieb Johann Böhler:
> Hi @ everybody,
>
> I want to execute a bulkwalk in the IF-MIB on ifHCInBroadcastPkts (.1.3.6.1.2.1.31.1.1.1.9).
>
> The snmputils return me an expected result in:
>
>      test at test$ snmpbulkwalk -v2c -Cr100 -c ****** 1.2.3.4 .1.3.6.1.2.1.31.1.1.1.9
>      IF-MIB::ifHCInBroadcastPkts.1 = Counter64: 46302872
>      IF-MIB::ifHCInBroadcastPkts.2 = Counter64: 0
>      IF-MIB::ifHCInBroadcastPkts.3 = Counter64: 0
>      IF-MIB::ifHCInBroadcastPkts.4 = Counter64: 0
>      IF-MIB::ifHCInBroadcastPkts.5 = Counter64: 0
>      IF-MIB::ifHCInBroadcastPkts.6 = Counter64: 0
>      IF-MIB::ifHCInBroadcastPkts.7 = Counter64: 0
>      IF-MIB::ifHCInBroadcastPkts.8 = Counter64: 0
>      IF-MIB::ifHCInBroadcastPkts.9 = Counter64: 0
>
> My SNMP4J calls (version 2.2.3 and 2.2.5 tested) return me a list of size max repetitions (100) instead of 10 though, and this leads to some problems in my application. Here's my code:
>
>          Address targetAddress = GenericAddress.parse("udp:1.2.3.4/161");
>          TransportMapping transport = new DefaultUdpTransportMapping();
>          Snmp snmp = new Snmp(transport);
>          transport.listen();
>
>          CommunityTarget target = new CommunityTarget();
>          target.setCommunity(new OctetString("******"));
>          target.setAddress(targetAddress);
>          target.setRetries(2);
>          target.setTimeout(1500);
>          target.setVersion(SnmpConstants.version2c);
>
>          PDU pdu = new PDU();
>          pdu.add(new VariableBinding(new OID(".1.3.6.1.2.1.31.1.1.1.9")));
>          pdu.setMaxRepetitions(100);
>          pdu.setNonRepeaters(0);
>          pdu.setType(PDU.GETBULK);
>
>          ResponseEvent send = snmp.send(pdu, target);
>
> Best regards,
> Johann
>
>
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> https://s16675406.onlinehome-server.info/mailman/listinfo/snmp4j


-- 
---
AGENT++
Maximilian-Kolbe-Str. 10
73257 Koengen, Germany
https://agentpp.com
Phone: +49 7024 8688230
Fax:   +49 7024 8688231




More information about the SNMP4J mailing list