On Tue, 12 Oct 2004 18:40:50 +0530 Karthikeyan wrote:
KN> 1. I have some api's about the mib data which I need to call in a common
KN> place in a loop so that the current data will get updated frequently.
This can be done with a netsnmp_cache helper. For examples, see the following
mib modules (or grep through the code for 'netsnmp_cache'):
agent/mibgroup/agent/nsCache.c
agent/mibgroup/mibII/tcpTable.c
agent/mibgroup/mibII/tcp.c
You might want to extract the cache_helper from 5.2, which will allow you to
have the cache refreshed periodically. Otherwise, you can use a timer in 5.1.2
to achieve a similar effect.
KN> the first time, data should be stored in the agent memeory for all the
KN> tables when we start the agent ( as like snmpd.conf) . Then it should
KN> update the latest data after a certain time interval delay.
Then you want to look into the persistent store routines. You can find an
example in
agent/mibgroup/disman/mteTriggerTable.c
You'll need to add a timer to periodically call the persistent store callbacks.
KN> Also, do we have the multi-threading support in net-snmp? I feel the best
KN> way to solve this is by using the threading concept so that filling the
KN> table data structures and the snmp process can happen parallely.
No. But you should be able to use shared memory and a non-snmp separate
process/thread to keep your cache up to date. Sorry, no examples of that.
--
Robert Story; NET-SNMP Junkie <http://www.net-snmp.org/>
<irc://irc.freenode.net/#net-snmp>
Archive: <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-coders>
You are lost in a twisty maze of little standards, all different.
-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Net-snmp-coders mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders