I think you need to set pdu.setMaxRepetitions

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Anton Boronnikov
Sent: Monday, June 02, 2008 8:26 AM
To: [email protected]
Subject: [SNMP4J] Incorrect OID returned after GETBULK request

I have this kind of code:

  Address targetAddress = GenericAddress.parse("udp:192.168.1.213/161");

     CommunityTarget target = new CommunityTarget();
     target.setCommunity(new OctetString("private"));
     target.setAddress(targetAddress);
     target.setRetries(2);
     target.setTimeout(1500);
     target.setVersion(SnmpConstants.version1);

     TransportMapping transport = new DefaultUdpTransportMapping();

     Snmp snmp = new Snmp(transport);
     transport.listen();

     PDU pdu = new PDU();
     pdu.setType(PDU.GETBULK);
     //pdu.add(new VariableBinding(new OID("1.3.6.1.2.1.2.2.1.21.1")));
     pdu.add(new VariableBinding(new OID("1.3.6.1.2.1.1.1.0")));
     ResponseEvent response = snmp.send(pdu, target);
     for (Object vb : response.getResponse().getVariableBindings())
     {
       System.out.println(vb.toString());
     }

When I execute it I get this message in System.out:
"1.3.6.1.2.1.1.2.0 = 1.3.6.1.4.1.1723.2.1.2"

Hey! I've requested another OID! There was "1.3.6.1.2.1.1.1.0" oid asked

for! You can try any other oid! The same story! Returned oid has always

incremented number in last but one position. What a hell??
Another story if I will request for "1.3.6.1.2.1.1.1" oid (without last

number). There will be the answer:
"1.3.6.1.2.1.1.1.0 = TRh-Sensor Firmware Version 1-5-1.04"

Can anybody test my code and comment this situation? May be my code is  
incorrect abit? Or there is some another reason?

-- 
Yours respectfully, Anton Boronnikov
_______________________________________________
SNMP4J mailing list
[email protected]
http://lists.agentpp.org/mailman/listinfo/snmp4j

______________________________________________________________________
This message contains information which may be confidential and/or privileged. 
Unless you are the intended recipient (or authorized to receive for the 
intended recipient), you may not read, use, copy or disclose to anyone the 
message or any information contained in the message. If you have received the 
message in error, please advise the sender by reply e-mail and delete the 
message and any attachment(s) thereto without retaining any copies.
______________________________________________________________________
_______________________________________________
SNMP4J mailing list
[email protected]
http://lists.agentpp.org/mailman/listinfo/snmp4j

Reply via email to