I know that the default MaxNumColumnsPerPDU is 10. Now I can not get the query result if I use the default config and I have query more that 5 oids. So I try to call the method setMaxNumColumnsPerPDU(5),now I can get the result but I find that result is wrong.So I try to call the method setMaxNumColumnsPerPDU(1) and I can get the correct result.
If I always set maxNumColumnsPerPDU with value 1, can I do that?Is there any side effect?I believe this will ensure the correctness of the data.
Target target = SnmpComunication.getSnmpTarget(snmp, snmpTarget);
BER.setCheckSequenceLength(true);
TableUtils tableUtils = new TableUtils(snmp, new DefaultPDUFactory(PDU.GETBULK));
OID[] columns = new OID[oids.size()];
for (int i = 0; i < oids.size(); i++) {
columns[i] = new OID(oids.get(i));
}
tableUtils.setMaxNumColumnsPerPDU(1);
List<TableEvent> events = tableUtils.getTable(target, columns, null, null);
Here is the correct result: