[SNMP4J] table "discovery"

Frank Fock fock at agentpp.com
Tue Jan 31 20:12:13 CET 2006


Marco,

You can do a GETBULK for the whole subtree under the table's OID.
This would not be very efficient.

A faster (but probably unsafe) way would be sending a GETNEXT with
the columns you expect (start from TableOID.1.1 to TableOID.1.n).
Normally column sub-identifiers have no holes, but there might be some
exception.

A fast and reliable approach is sending a GETBULK on the first column
only and repeat until the highest index of the table is returned. Then you
can send GETNEXTs on the last OID of each column
(TableOID.1.lastCol.lastIndex) to get the next column.

Hope this helps.

Best regards,
Frank

Marco.Bresciani at alcatel.it wrote:

>Hi all,
>  I'm still upgarding a SNMP communication class I've inherited from past 
>developers... Speaking about table-getting, I renewed a method that got a 
>table using OID indexes so everything worked fine.
>  Now I'm upgrading another method that does not receive, as parameters, 
>the list of OIDs needed because the older communication part contained the 
>whole MIB so it knows which columns belong to a table and it retrieves 
>all.
>
>So... is it possible to know how many columns (and their OIDs) a table 
>has?
>
>Thank you,
>
>Dott. Ing. Marco Bresciani
>
>  
>


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





More information about the SNMP4J mailing list