[SNMP4J] Null value in Variable Binding

Frank Fock fock at agentpp.com
Sun Feb 18 10:57:40 CET 2007


Hi Tim,

This is quite normal behavior, because you
issue a GETNEXT search request and there is
no object before sysDescr.0. Try a GET request
and you will get a different result.

Best regards,
Frank

Tim Brown wrote:
> 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);
> 
> ....
> 
>  
> 
>  
> 
>  
> 
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j

-- 
AGENT++
http://www.agentpp.com
http://www.mibexplorer.com
http://www.mibdesigner.com




More information about the SNMP4J mailing list