> From: xiao ren [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, October 23, 2008 2:16 AM

> net-snmp agent can be extended by using NET-SNMP-EXTEND-MIB 
> and adding external shell scripts, but there might exist a 
> problem, that is, if a script which is called by agent 
> includes a long-run operation,(say, 1 or 2 minutes), how to 
> avoid the agent to ignore the subsequent snmp requests in the 
> mean time? I hope net-snmp agent has a mechanics to solve 
> this problem, has it? Thanks!

        I do not believe there is any mechanism intrinsic to the agent to do 
this.  Instead, you should extend the agent with a couple of scripts:

        1)  Reads the value of the result from a file, initialized to some 
"reasonable" value.  This object can be public.

        2)  Starts the script running in the background and returns 
immediately.  The script writes a "start time" and "stop time", each to its own 
file.  The script will not be started if the current "start time" is greater 
(more recent) than the current "stop time".  This object should be restriced.

        3)  Forces the script to run regardless of "start time" or "stop time". 
 This is recovery from script crash and should be highly restricted.

        Advanced maneuvers:

        4)  Two objects can return the values of "start time" and "stop time" 
so that an application can tell if the script is currently running (or may have 
crashed).

        5)  Add a "max interval" object.  In object (1), if the difference 
between the current time and "stop time" is greater than "max interval", start 
the script.

        6)  A mutex for the script.


        I leave the rest to your imagination.  This type of active management 
is typical of SNMP, and once you get comfortable with it, has a lot of 
advantages.


        HTH,

Mike

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
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

Reply via email to