[SNMP4J] snmp4j getnext handling

Frank Fock fock at agentpp.com
Wed Dec 27 22:01:50 CET 2006


Giovanne,

There might be a misunderstanding that is causing
your trouble here: You will need at least <N> GETNEXT
operations for a table with <N> rows to retrieve it.
When using GETBULK, you can reduce to number of requests
needed to <N> div <MaxRepetitions>.

So, if you use Snmp.next operations to retrieve the table,
you can trigger any operation when you receive the
corresponding response - as you suspected, this is done
by interpreting the ResponseEvent object.

The TableUtils class can help here to, because it facilitates
table processing by returning the data row oriented to the
user. Here you can too, use the asynchronous interface
(that one with the callback listener) and even if you reach a
row where you want to stop processing, you can do so, by
returning "false" when your callback method
http://www.snmp4j.org/doc/org/snmp4j/util/TableListener.html#next(org.snmp4j.util.TableEvent)
is being called.

Best regards,
Frank

Giovane Moreira wrote:
> Hello,
> 
> I've got a problem and I have no idea on how to solve it.
> 
> My snmp agent is running well. There I have a MIB that has a table of more
> than 128 lines.. I want to perform snmp get next operations on this table,
> but with something special: to treat the number of "lines" of the table
> retrieved.
> 
> Ok, I know, snmp get next operation just will return me the whole table.
> It's the standard operation. But I was thinking if it's possible to look
> inside every "line" returned, and check out how many "lines" of the table
> was retrieved.
> 
> For example, suppose my table has an OID and has 128 lines. So I send a
> getnext to my agent and then it return all 128 lines . Just as the RFC
> determines. Ok, but in my manager, I would like to performe some operations
> such as get the current machine time when  the 2nd "line" arrives (on the
> fly). To do this, I must treat the response received (using ResponseEvent
> ?).
> 
> Does snmp4j support snmp response treatment on the fly?
> 
> Thank you all ,
> 
> Giovane
> _______________________________________________
> 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