[SNMP4J] [SNMP4j] How to determine the correct maxNumOfRowsPerPDU in tableUtils

Frank Fock fock at agentpp.com
Thu Apr 3 16:33:34 CEST 2014


Hi,

There is no "correct" maxRepetitions. Any value is "correct".
The agent decides how many repetitions it will provide based on
local contraints and measures. Some agent never return more
than one, others up to the maximum packet size, others by
timing constraints.
Thus, you can never know how many repetitions there will be returned.

BTW, OIDs do NOT start with a dot character. Simply
write

new OID("1.3.6.1.2.1.47.1.1.1.1.1")

Best regards,
Frank

Am 03.04.2014 07:11, schrieb Tongjie Li:
> Hi everybody
>        I was executing a getTable in snmp4j on entitymib. I defined the
> following columns like  following sample code
>
>            public static OID[] getColumnOIDs() {
>          if (equipmentColumns != null) return equipmentColumns;
>          equipmentColumns = new OID[11];
>          equipmentColumns[0] = new OID(".1.3.6.1.2.1.47.1.1.1.1.1");
> //entPhysicalIndex
>          equipmentColumns[1] = new OID(".1.3.6.1.2.1.47.1.1.1.1.2");
> //entPhysicalDescr
>          equipmentColumns[2] = new OID(".1.3.6.1.2.1.47.1.1.1.1.3");
> //entPhysicalVendorType
>          equipmentColumns[3] = new OID(".1.3.6.1.2.1.47.1.1.1.1.4");
> //entPhysicalContainedIn
>          equipmentColumns[4] = new OID(".1.3.6.1.2.1.47.1.1.1.1.5");
> //entPhysicalClass
>          equipmentColumns[5] = new OID(".1.3.6.1.2.1.47.1.1.1.1.6");
> //entPhysicalParentRelPos
>          equipmentColumns[6] = new OID(".1.3.6.1.2.1.47.1.1.1.1.7");
> //entPhysicalName
>          equipmentColumns[7] = new OID(".1.3.6.1.2.1.47.1.1.1.1.13");
> //entPhysicalModelName
>          equipmentColumns[8] = new OID(".1.3.6.1.2.1.47.1.1.1.1.14");
> //entPhysicalAlias
>          equipmentColumns[9] = new OID(".1.3.6.1.2.1.47.1.1.1.1.16");
> //entPhysicalFru if is fixed
>          equipmentColumns[10] = new
> OID(".1.3.6.1.2.1.47.1.1.1.1.11");//entPhysicalSerialNum
>          return equipmentColumns;
>           }
>
>         when I using it with getTable in the snmp4j with following code (
> the columnOIDs are equipmentColumns from above example)
>
>          public List snmpGetTable(OID[] columnOIDs, OID lowerBoundIndex, OID
> upperBoundIndex) throws IOException {
>          List result = null;
>          TableUtils tableUtils = new TableUtils(this.snmp, new
> DefaultPDUFactory(PDU.GETBULK));
>          tableUtils.setMaxNumRowsPerPDU(maxRepetitions);
>          result = tableUtils.getTable(this.comtarget, columnOIDs,
> lowerBoundIndex, upperBoundIndex);
>          return result;
>        }
>
> When i test it,I found that setting different maxRepetitions will get
> different answers. When I set maxRepetitions to 4
> ,it return total number of 1428 records. When I set maxRepetitions  to 10,
> it return total number of 1518 records. When set to 20,it return total
> number of 1528 records. It made me very crazy.
>
> I want to know why and how to set the right maxRepetitions  in order to
> avoid this. It seems that different types of device need to set different
>   maxRepetitions. Is there a way to calculate the correct maxRepetitions ?
>
> Best regards
>
>
>

-- 
---
AGENT++
Maximilian-Kolbe-Str. 10
73257 Koengen, Germany
https://agentpp.com
Phone: +49 7024 8688230
Fax:   +49 7024 8688231




More information about the SNMP4J mailing list