[ First - *please* don't mail me privately, without copying
     any responses to the mailing list.  I don't have the time
     or inclination to offer private, unpaid, SNMP consultancy.
     Keep discussions to the list, where others can both learn
     and offer advice.  Thanks.   ]

On Mon, 2005-06-20 at 07:16, flyeagers wrote:
> I still have a question.
> How can I use "run_shell_command"?

     char outbuf[ BUFSIZ ];
     int  outlen = BUFSIZ;
     run_shell_command( "ls -l", NULL, outbuf, &outlen);

If you need to provide standard input to the command, the
second parameter can be used for that.


>  And where should I use it? In COMMIT or ACTION?

That's up to you.
If you can reverse the action of this shell command fairly easily
(and reliably!), then run the command in the ACTION pass, and run
the reverse command in the UNDO pass.

If you can't reverse the action, then run the command in the COMMIT
pass.  (And make sure you validate the request properly!)

Dave



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to