On 03/12/2007, Senthil Nathan wrote:
> My question is when i make the getBulk request ,the lower api is called as
> many row times,how can i avoid that?

How about using the cache helper.

Move the 'InfoSupply' call into a "load_info" routine, rather than having it in
the main handler routine. When you register the MIB module, inject the
cache handler, giving it the name of your "load_info" routine.

Then when the agent receives a request for anything in this table,
then it will check whether the cache is valid and up-to-date.
If it isn't, then it will call the load_info routine (and hence InfoSupply).
If the cache is fresh, then it will skip this step, and go straight on
to the handler routine, which can then use this cached information.

There are several examples of this approach in the latest agent code.


SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell. From the desktop to the data center, Linux is going
mainstream. Let it simplify your IT future.
Net-snmp-coders mailing list