Hi -
I replaced the table init code with the call to
netsnmp_cache_check_and_reload( cache ) and that seems to be working ok.
(When I ran the mib2c with the cache option, it still generated the comment
to "initialize the table here", so I assumed I still had to initialize it
even with the cache.)
After 60 seconds, the cache free is called and then when I issue a command,
I don't see any load debug messages.
If I don't put the netsnmp_cache_check_and_reload( cache ) call in the
table init routine, the load is not called when I issue a command.
In either case, the status of the snmpd continues to show "running - I am
not seeing the agent crash. So I am not seeing exactly what you are.
Kathy McLeod
Dave Shield
<d.t.shi...@liver
pool.ac.uk> To
Sent by: Kathy McLeod/Rochester/i...@ibmus
dave.shi...@googl cc
email.com [email protected]
t
Subject
04/07/2010 05:32 Re: cache load never gets called
AM
On 6 April 2010 20:59, Kathy McLeod <[email protected]> wrote:
> 1) I thought it would always issue a free before a load.
Not quite.
The purpose of the "free" hook is to release the information
left over from the previous "load" call. This can either be
done immediately before the next load, or (possibly) as part
of regularly-scheduled garbage collection.
> However, the
> first time I issue a command ... I see the load without a free first.
That's correct.
Until the MIB is first queried, the "load" routine has never been called,
so there's no need to invoke "free" that first time.
> My table is now 8 rows long
> instead of 4. (The table init creates indexes 1 - 4, and the cache load
> creates 5 - 8)
If you are using the cache mechanism, then this will initialise the
contents
of the table when required. There's no need to duplicate this within the
init routine.
Either set up the table within the init routine, or use a cache.
Don't mix the two.
If you want to prime the table when the agent first starts up,
the simplest (and safest) way would be to call
netsnmp_cache_check_and_reload( cache )
> 2) After 60 seconds, I see the cache free. This works ok, but when I
issue
> another command, I never see another load and I get an error message for
> the command.
I'm seeing something slightly different.
I *do* see the cache load routine called for this later request,
but then the agent crashes. There's something wrong about the
way that the handler accesses the refreshed cache contents.
I haven't had the chance to investigate properly, but it looks as if
replacing the code that primes the table with a call to
netsnmp_cache_check_and_reload( cache )
seems to fix things.
(Though omitting this seems to drop the table altogether.
Which again doesn't really make sense!)
Dave
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users