[SNMP4J] getTable for Rows

Marco.Bresciani at alcatel.it Marco.Bresciani at alcatel.it
Tue Mar 21 08:26:10 CET 2006


Hello all,
  I'm trying to use TableUtils.getTable in order to get a single row 
(because it seems more simpler and comfortable), but... how can I use 
lowerBoundIndex and upperBoundIndex? Do I have to use the single index 
value? Do I have to use the complete OID?!

At the moment I am try-catching this:

/* block variables declaration */
List results;

/* block variables definition */
TableUtils table = new TableUtils(snmp, new 
DefaultPDUFactory(PDU.GETBULK));
OID[] indexes = new OID[columnIndexes.length];

/* indexes preparation */
for (int i = 0; i < columnIndexes.length; i++) {

    /* search for table entry (".1") at index value */
    indexes[i] = new OID((String) (tableEntryOid + "." + 
columnIndexes[i][0]));
}

/* table GETting */
results = table.getTable(device, indexes, new OID((String) (indexOid + 
1)), new OID((String) (indexOid)));
if ((results != null) && (results.size() > 0)) {
    holder.setData(convertToStructure(holder.getStructureClass(), 
columnIndexes, results));
} else {
    res = -1;
}

where: column indexes are the complete OIDs (am I right to use those? Or 
do I simply need column numbers?) with "table OID + 1 + column index". 
Instead, since I only need a single row, I've used simple "indexOid + 1" 
(with no full table OID and so on) as lowerBoundIndex and indexOid (no 
full OID as well) as upperBoundIndex. but it does not work... I am going 
to read protocol data through Ethereal but... in the meantime... any 
suggestion?!

Thank you.

Ing. Marco Bresciani

-- 
Alcatel - WTD R&D SW Lab. [Stage]
Via Trento, 30
20059 Vimercate (Mi) Italia
Phone: +39.039.686.5546
E-Mail: Marco.Bresciani at Alcatel.It


More information about the SNMP4J mailing list