[SNMP4J] Null value in Variable Binding
Tim Brown
tim.brown at skytechnologies.com
Wed Feb 14 07:25:18 CET 2007
Hi,
Regardless of the OID specified I seem to get the same response back
every time.
The response is always:
RESPONSE[requestID=2107916581, errorStatus=Success(0), errorIndex=0,
VBS[1.3.6.1.2.1.1.1.0 = Hardware: x86 Family 15 Model 4 Stepping 3 AT/AT
COMPATIBLE - Software: Windows Version 5.2 (Build 3790 Multiprocessor
Free)]]
When I check the Variable Binding specified it comes back with the value
specified for the OID and "= Null".
For example 0.1.2 = Null
Any suggestions would be greatly appreciated.
Cheers,
Tim
....
Address targetAddress = GenericAddress.parse(address);
TransportMapping transport = new DefaultUdpTransportMapping();
Snmp snmp = new Snmp(transport);
USM usm = new USM(SecurityProtocols.getInstance(),
new OctetString(MPv3.createLocalEngineID()), 0);
SecurityModels.getInstance().addSecurityModel(usm);
transport.listen();
// Create the target
CommunityTarget target = new CommunityTarget();
target.setCommunity(new OctetString("public"));
target.setAddress(targetAddress);
target.setRetries(2);
target.setTimeout(1500);
target.setVersion(SnmpConstants.version1);
// Create the PDU
PDU pdu = new PDUv1();
// Create the OID and variable binding
OID myOID = new OID();
myOID.setValue(objID);
VariableBinding myVB = new VariableBinding(myOID);
String checkVB = myVB.toString();
System.out.println("VB set to: " + checkVB);
pdu.addOID(myVB);
pdu.setType(PDU.GETNEXT);
ResponseEvent response = snmp.send(pdu, target);
// extract the response PDU (could be null if timed out)
PDU responsePDU = response.getResponse();
System.out.println("The response is: " + responsePDU);
....
More information about the SNMP4J
mailing list