[SNMP4J] snmpget for multiple OIDs

James Yu cyu021 at gmail.com
Tue May 17 07:34:23 CEST 2011


Hi,

I noticed that by invoking "requestPDU.add" multiple times, we can do
snmpget on multiple OID at once and get results in a list.
However, when one of the added OID becomes invalid, the entire list is
empty, for example, if we have the following code snippet:
        if(responsePDU != null) {
            vbs = responsePDU.getVariableBindings();
            for(VariableBinding vb : vbs) {
                output.put(vb.getOid().toString(),
vb.getVariable().toString());
            }
        }
If one of the OID is invalid, all vb in vbs returns null when we do
vb.getVariable() even if the corresponding OID is VALID.
How do I get value for correct OID ?


This is a UTF-8 formatted mail
-----------------------------------------------
James C.-C.Yu



More information about the SNMP4J mailing list