[SNMP4J] Missing First Row in Table

Frank Fock fock at agentpp.com
Sat Apr 29 13:26:38 CEST 2006


Hello Jesse,

The behavior you described is intended and not a bug.
GETNEXT and GETBULK return the next accessible object
instance with an OID (lexicographic) greater than the
OID specified in the request.

To get also the instance for the OID you have in mind,
you can use OID.predecessor() as the starting OID.

Best regards,
Frank

Prusi, Jesse R wrote:
> Hello,
> 
> I have an agent built from snmp4j-agent that has a sparse table
> populated with a few entries.  For example:
> 
> myOid.indexOid.12 = a
> myOid.indexOid.13 = b
> myOid.indexOid.16 = c
> myOid.indexOid.38 = d
> 
> All entries are returned if:
> 
> 1) I use GETBULK on myOid.  Or,
> 2) I use TableUtils getTable() method on myOid with lower and upper
> index OIDs = null.
> 
> However, the first entry is not returned when:
> 
> 1) I use GETNEXT starting with myOid.indexOid
> 2) I use SnmpRequest to do a walk on myOid.indexOid
> 3) I use TableUtils getTable() method on myOid with
> 	a) lower index = myOid.indexOid
> 	b) upper index = myOid.(indexOid+1)
> 
> But all other entries are returned.
> 
> myOid.indexOid.13 = b
> myOid.indexOid.16 = c
> myOid.indexOid.38 = d
> 
> Is this a bug in SNMP4J?  How can I get all the entries in the
> myOid.indexOid subtree without skipping the first entry?
> 
> Thanks in advance for your help.
> 
> Jesse Prusi
> 
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j

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




More information about the SNMP4J mailing list