Re: How to force a cache reload when dynamic interfaces

This is a discussion on Re: How to force a cache reload when dynamic interfaces within the SNMP Coders forums, part of the Networking and Network Related category; On Wed, 2005-11-23 at 10:41 -0600, Emi.Yanagi@radisys.com wrote: > I want to trigger a ...


Go Back   Usenet Forums > Networking and Network Related > SNMP Coders

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-25-2005
Dave Shield
 
Posts: n/a
Default Re: How to force a cache reload when dynamic interfaces

On Wed, 2005-11-23 at 10:41 -0600, Emi.Yanagi@radisys.com 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
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/...et-snmp-coders
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 03:16 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0