[SNMP4J] SNMP4j 2.2.3 / 2.2.5 bulkwalk problem

Johann Böhler johann.boehler at 1und1.de
Mon Mar 3 09:01:47 CET 2014


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





More information about the SNMP4J mailing list