[SNMP4J] New User and Errors
Josiane Ortolan Coelho
jocoelho at gmail.com
Tue Jul 3 18:35:40 CEST 2007
Hi,
I'm Josi from Brazil, sorry my english... but I have problems with
SNMP4J. I shoud be have littles mistakes in my code, so any help is
welcome!
My equipament is a router SNMPv1(10.10.69.116) port 161 community RW public.
I give walk from Mib Browse of iReasoning and it answers well.
TransportMapping transport = new DefaultUdpTransportMapping(new
UdpAddress("10.10.69.116/161"));
Snmp snmp = new Snmp(transport);
// Snmp snmp = new Snmp();
// setting up target
Address targetAddress = GenericAddress.parse("udp:10.10.69.8/161");
CommunityTarget target = new CommunityTarget();
target.setCommunity(new OctetString("public"));
target.setAddress(targetAddress);
target.setRetries(2);
target.setTimeout(5000);
target.setVersion(SnmpConstants.version1);
// creating PDU
PDU pdu = new PDU();
pdu.add(new VariableBinding(new OID(".1.3.6.1.2.1.1.2")));
pdu.setType(PDU.GETNEXT);
PDU responsePDU = snmp.sendPDU(pdu, target); //, null, listener);
if (responsePDU == null) {
System.out.println("Request timed out");
}
########################
Message fo Console:
Request GETNEXT[requestID=1867037559, errorStatus=Success(0),
errorIndex=0, VBS[1.3.6.1.2.1.1.2 = Null]]
timed out
What I'm doing wrong?
best regards,
Josi
More information about the SNMP4J
mailing list