On Wed, 2005-11-23 at 10:41 -0600, [EMAIL PROTECTED] wrote: > I want to trigger a cache reload only when > dynamic interfaces creating/removing happen.
Let's be clear about exactly what you mean here. By "dynamic", do you mean in response to explicit SNMP SET requests, or when an interface is physically added to (or removed from) the system? If you mean the first, then you probably shouldn't be using the cache mechanism at all. The agent would most naturally hold the table representation internally, so could add or remove entries as required. The main role of the cache processing is to link the agent's view with what's actually happening in the underlying system (assuming these are different). If your MIB table is purely driven via SNMP SET requests, then the agent *is* the "underlying system", so caching isn't necessary. If the underlying system is separate, and you want the agent to refresh its internal representation automatically when this underlying system changes, then you'll need to find a way of signalling to the agent when this happens. (e.g. call the cache_load routine directly) > So I tried to > call the cache load routine directly when dynamic interfaces > creating/removing happen. Yup - that sounds like the right approach. > The problem is I got the Error: OID not increasing: > > $snmpwalk 10.1 ifIndex > IF-MIB::ifIndex.1 = INTEGER: 1 > IF-MIB::ifIndex.2 = INTEGER: 2 > IF-MIB::ifIndex.3 = INTEGER: 3 > IF-MIB::ifIndex.4 = INTEGER: 4 > IF-MIB::ifIndex.4 = INTEGER: 4 > Error: OID not increasing: IF-MIB::ifIndex.4 > >= IF-MIB::ifIndex.4 I don't think that's related to how the table data is cached (or not). It feels more concerned with how the table data is *walked* - in particular, to the processing of the last entry. > My questions are: > What is the proper way to force a cache reload at anytime? Call the cache_load routine. That's exactly what it's there for. > Do I need to register a separate cache handler to do this? No. In fact, you probably don't need to register the table as explicitly using the cache handler at all. That's really aimed at loading the cache "on demand", in response to incoming GET* requests. If you want complete control over exactly when the cache is reloaded, it's probably easier not to have the cache helper in the handler chain. Dave ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click _______________________________________________ Net-snmp-coders mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
