This is a discussion on RE: add a forever process in agent within the SNMP Users forums, part of the Networking and Network Related category; On Thu, 2005-09-22 at 17:53 +0800, Jim Su wrote: > Yes, this list is constantly generated/updated ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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 Net-snmp-users@lists.sourceforge.net Please see the following page to unsubscribe or change other options: https://lists.sourceforge.net/lists/...net-snmp-users |