Dear Robert:
Thanks for the info. I will take this in the consideration when I
implement the feature. Good to learn from you the problem of time drifting.
"... to have the callback function calculate the time till the next 5
minute mark and reschedule itself" I will study the code in detail. But how do
you do that and if you don't mind to give more information or point to the
example codes under the agent/example or other places? Thanks again.
Regards,
Jim
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Robert Story
Sent: Friday, September 23, 2005 11:00 PM
To: Dave Shield
Cc: Jim Su; Net-Snmp-Users
Subject: Re: add a forever process in agent
On Thu, 22 Sep 2005 12:18:04 +0100 Dave wrote:
DS> On Thu, 2005-09-22 at 18:36 +0800, Jim Su wrote:
DS> > I want the process to be executed exactly on the
DS> > 0, 5, 10, 15 .. 55 minutes on the hour.
DS>
DS> In the 'init_ABCTable' routine, calculate how long
DS> until the next 5-minute mark, and register a one-off
DS> alarm to fire then. That will trigger an alarm
DS> callback routine 'init_ABCData' which should:
DS>
DS> a) initialise the list data, and
DS> b) register a repeating alarm to call a
DS> different callback routine ('load_ABCData')
DS>
DS> This second routine should then be invoked on
DS> the 5-minute marks, as required.
I'm not sure this will work. Looking at the code, it looks like it will run
every 5 minutes from the last time it was run. Thus, each time the agent is
busy when the timer expires, it will drift a little. Eventually, this will add
up. Instead of using the SA_REPEAT, you may want to have the callback function
calculate the time til the next 5 minute mark and reschedule itself. A little
more overhead, but it won't drift.
--
NOTE: messages sent directly to me, instead of the lists, will be deleted
unless they are requests for paid consulting services.
Robert Story; NET-SNMP Junkie
Support: <http://www.net-snmp.org/> <irc://irc.freenode.net/#net-snmp>
Archive: <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-users>
You are lost in a twisty maze of little standards, all different.
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server.
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
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
--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.5/110 - Release Date: 2005/9/22
--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.11.6/111 - Release Date: 2005/9/23