[SNMP4J] Missing First Row in Table

Frank Fock fock at agentpp.com
Sat May 6 10:36:38 CEST 2006


Jesse,

I could not reproduce the problem with my working version.
So I assume that I have fixed that problem without knowing
that there was one. I will release beta 2 next week which
should fix it.

Until then you may try to replace the following method
in DefaultMOScope which might have caused the problem:

   public boolean covers(OID oid) {
     if (oid == null) {
       return false;
     }
     return (((getLowerBound().compareTo(oid) < 0) ||
              (isLowerIncluded() && getLowerBound().equals(oid))) &&
             ((getUpperBound() == null) ||
              (getUpperBound().compareTo(oid) > 0) ||
              (isUpperIncluded() && getUpperBound().equals(oid))));
   }

Best regards,
Frank


Prusi, Jesse R wrote:
> Frank,
> 
> Any luck finding the bug?  Would you like me to send debug output of the
> occurrence?
> 
> Thanks,
> Jesse 
> 
> 
> -----Original Message-----
> From: snmp4j-bounces at agentpp.org [mailto:snmp4j-bounces at agentpp.org] On
> Behalf Of Prusi, Jesse R
> Sent: Monday, May 01, 2006 8:48 AM
> To: snmp4j at agentpp.org
> Subject: Re: [SNMP4J] Missing First Row in Table
> 
> Frank and Phil,
> 
> Thanks for the replies.
> 
> I am using SNMP4J-Agent 1.0 Beta 1.
> 
> Jesse
> 
> -----Original Message-----
> From: Frank Fock [mailto:fock at agentpp.com] 
> Sent: Sunday, April 30, 2006 6:01 AM
> To: PHIL BERGSTRESSER
> Cc: Prusi, Jesse R; snmp4j at agentpp.org
> Subject: Re: [SNMP4J] Missing First Row in Table
> 
> Hi Phil,
> 
> Oops, yes I was a bit biased through other postings ;-)
> Sorry! I agree that for the concrete example, it looks
> like there is a bug in the agent, although I cannot
> reproduce it with the beta 1(+) version I am using
> currently.
> 
> @Jesse: What version of SNMP4J-Agent do you use?
> 
> Best regards,
> Frank
> 
> PHIL BERGSTRESSER wrote:
>> Frank, I believe Jesse is correct. getNext, getBulk should return
>> exactly what YOU say they should: the NEXT OID in lexicographical
> order,
>> which if the last index is not supplied, would be 12 in his case. You
>> state the technology correctly, but don't see his example correctly.
> The
>> Next instance after myOid.indexOid is myOid.indexOid.12. This is
> usually
>> an agent bug. Think about it.
>>
>> Phil
>>
>> -----Original Message-----
>> From: snmp4j-bounces at agentpp.org [mailto:snmp4j-bounces at agentpp.org]
> On
>> Behalf Of Frank Fock
>> Sent: Saturday, April 29, 2006 6:27 AM
>> To: Prusi, Jesse R
>> Cc: snmp4j at agentpp.org
>> Subject: Re: [SNMP4J] Missing First Row in Table
>>
>> 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