Re: exec question

"danny zhong" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>

since the daemon program is in the remote site computer, and i don't want 
the daemon program start when the remote computer start. i only want the 
daemon program start when i "triggered" it. Actually, in my project, there 
are more daemon program need to be "triggered" in the same remote computer 
and other remote computer as well. and some of these daemon program need to 
be "trigger" in order.  For easer to manage, i want a snmp agent can do it 
for me.

how about if i develop an agent by using the API, which only need to 
"trigger" the daemon programs, and then will return a packet without 
waitting for the "finish" of daemon program like your "exec". if it is 
possible, then can you just tell me what kind of api function i can use or 
need to modify??






////////////////////////////////////////////////////////////////

what i am trying to do at the moment is to run a remote site daemon program.
this daemon program is used to receive video metadata from other computer.


OK.
Starting/Stopping that daemon is best handled by something other than 
"exec".
You don't say what O/S you're using - but if this is a Unix-like
system, then I'd suggest you write a simple "/etc/init.d/videodaemon"
script to start/stop the daemon.
  That would give you much more flexible control than a purely
SNMP-based approach.

Use the existing startup scripts as a template.

    also i want to use net snmp to monitor this program is running properly.


That's different from actually starting the problem.

    Could you please give me some hints.


Have a look at the 'proc' directive (in snmpd.conf(5)).
This will report whether a particular process is running or not.

Dave


>From: "Dave Shield" <[email protected]>
>To: "danny zhong" <[email protected]>
>CC: [email protected]
>Subject: Re: exec question
>Date: Wed, 20 Sep 2006 09:04:52 +0100
>
>On 20/09/06, danny zhong <[email protected]> wrote:
> > int main(void){
> > while(1){
> >
> > }
> > }
> >
> > and i put the execution command of this file in  a script file called
> > run.sh, in the snmpd.conf, i add
> >
> > exec .1.3.6.1.4.1.2021.53 run /bin/sh /home/danny/run.sh
>
>No - that won't work.
>"exec" is designed to run a command to completion, and report the results.
>If you've got a long-running program, then you can't use the
>simplistic "exec" approach.
>
>Take a step backwards - what exactly are you trying to do?
>
>Dave
>
>-------------------------------------------------------------------------
>Take Surveys. Earn Cash. Influence the Future of IT
>Join SourceForge.net's Techsay panel and you'll get the chance to share 
>your
>opinions on IT & business topics through brief surveys -- and earn cash
>http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>_______________________________________________
>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
>

_________________________________________________________________
Nothing but cars & over 100,000 of them at carsales.com.au 
http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fsecure%2Dau%2Eimrworldwide%2Ecom%2Fcgi%2Dbin%2Fa%2Fci%5F450304%2Fet%5F2%2Fcg%5F801577%2Fpi%5F1005244%2Fai%5F836752&_t=12345&_r=emailtagline_tig_over100k&_m=EXT


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
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.