On Thu, 17 Jul 2003 12:40:14 +0200 Clemens wrote:
CE> The problem however is that i have to build/create the table of running
CE> processes whenever a request of myMIBTable comes in.
CE> I initially thought that get_first_data_point was the right place, but then
CE> I noticed that this function is called several times within a request for
CE> myMIBTable (i.e snmptable ... myMIBTable). So obviously it's not the right
CE> place to build my table. But where is the right place (or time
CE> respectively) The myMIBTable_handler function gets called several times as
CE> well. Is there a way to distinguish the initial request for the table ? I
CE> want to have a "snapshot" of running processes, just from the moment when
CE> the request comes in.
As Dave mentioned, there isn't a clean way to do this in 5.0.x. It will be
addressed for the 5.1.x releases.
But there are a few options:
1) Make a snapshot cache, time based instead of request based. Easy.
2) <hack> Register for the (SNMP_CALLBACK_APPLICATION,
SNMPD_CALLBACK_ACM_CHECK_INITIAL) callback, setting a flag to clear your cache
when it is called. Build the cache in get_first_data_point if it doesn't exist
and rebuild it if it does exist but the rebuild flag is set. This gives you a
per-request cache, but the callback will be called for EVERY pdu, not just ones
for your table. So the cache clear should be short and sweet. </hack>
--
Robert Story; NET-SNMP Junkie, NET-POLICY Flunkie
<irc://irc.openprojects.net/#net-snmp> <http://www.net-snmp.org/>
<irc://irc.openprojects.net/#net-policy> <http://net-policy.sourceforge.net/>
You are lost in a twisty maze of little standards, all different.
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
|