[SNMP4J] getTable for Rows
Fabian Nart
fabian.nart at ergon.ch
Tue Mar 21 12:11:03 CET 2006
Hi Marco
> >You have to use the indexes only.
>
> Thank you but... it does not seem to work. I've written this code:
>
> results = table.getTable(device, indexes,
> new OID((String) (tableEntryOid + "." +
indexOid)),
> null);
>
> using a full OID... and it worked. It did not when I used the simple
index number.
That's strange because I use it with the index only -- which is
according to the javadoc of that method.
Use the following:
int index= 5; // for example
OID lower= new OID(""+index-1);
OID upper= new OID(""+index);
results = table.getTable(device, indexes, lower, upper);
Fabian
Marco.Bresciani at alcatel.it wrote:
>
>
>
> *Fabian Nart <fabian.nart at ergon.ch>*
> Sent by: snmp4j-bounces at agentpp.org
>
> 21/03/2006 09.37
>
>
> To: snmp4j at agentpp.org
> cc:
> Subject: Re: [SNMP4J] getTable for Rows
>
>
> >Ciao Marco
>
> :-) Ciao,
>
> > > 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?!
> >
> >You have to use the indexes only.
>
> Thank you but... it does not seem to work. I've written this code:
>
> results = table.getTable(device, indexes,
> new OID((String) (tableEntryOid + "." +
> indexOid)),
> null);
>
> using a full OID... and it worked. It did not when I used the simple
> index number.
>
> > > /* table GETting */
> > > results = table.getTable(device, indexes, new OID((String) (indexOid
> >+ 1)), new OID((String) (indexOid)));
> >
> >Look carefully at the signature of the method you call:
> >getTable(Target target, OID[] columnOIDs, OID lowerBoundIndex, OID
> >upperBoundIndex)
> >
> >The third argument is LOWERboundIndex, the fourth is UPPERboundIndex,
> >you are using it the other way round.
>
> Thank you! So, to retrieve "rowIndex" I have to use "rowIndex - 1" as
> lowerBound and "rowIndex" as upperBound... right?!
>
> Thank you for any help... I'm in a hurry to end this feature only and
> then I've finished my huge conversion from a proprietary (and very
> heavy-weighted) solution to SNMP4J! I have to finish today! =8-O
>
> Marco
More information about the SNMP4J
mailing list