RE: add a forever process in agent

Dave Shield <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
On Thu, 2005-09-22 at 17:53 +0800, Jim Su wrote:

>  Yes, this list is constantly generated/updated said every 5 minutes
>  regardless agent receives the request or not. 

OK - then use 'snmp_alarm_register'


>  I have the feeling that this routine may be able to run the 
> forever process I want.

Yes, it will.

>  I have to take out the while(1) in my process.  I have a sleep
>  routine in the forever process so the process sleeps if system
>  time is not on the 5, 10, 15, ... minutes on the hour.

No - don't do that.
You'll be conflicting with the on-going operation of the agent.

What you need is a single "alarm callback" routine, which
will be triggered (by the agent) every 600s.   This routine
should generate/update the data list, then return.

The rest of the time, control should lie with the main agent
driving code (so that it can accept and process requests,
perform any other regular maintenance, etc).
   Your code shouldn't worry about *when* to reload the
list - the agent takes care of that.  Your code is purely
concerned with *how* to reload the list.


Dave


-------------------------------------------------------
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.