Honia A wrote:
> Hi all,
>  
> Regarding shellcmd command: I would like SEC to watch a log file and run 
> a command whenever it finds a match. The command is just one line, so I 
> was wondering if I should create a .sh file and put the info below there 
> and just call the .sh file from inside my.conf like this:
>  
> *_command.sh_*
> #!/bin/sh
> # Shell command for sending events
> #
> /opt/opennms/bin/send-event.pl 
> uei.mycompany.net/generic/collectd/inconsistentconfig -i 192.168.1.1
>  
>  
> _*At the end of my.conf file:*_
> action=shellcmd command.sh
>  
>  
> Or I can just add the command in my.conf and run it from there:
> 
> action=shellcmd /opt/opennms/bin/send-event.pl 
> uei.mycompany.net/generic/collectd/inconsistentconfig -i 192.168.1.1

Both ways work -- use the one which is more convenient for your 
environment. If the same command line is used for several rules, I'd 
prefer to put it into a separate script file, because then it is much 
easier to change the command line at a later time.

br,
risto

>  
> Thanks in advance,
> Honia
>  
>  
>  
> 
>  
> *
> ** 
> *
> 
> 
> 
> ------------------------------------------------------------------------
> Windows Liveā„¢: Discover 10 secrets about the new Windows Live. View 
> post. 
> <http://windowslive.com/connect/post/jamiethomson.spaces.live.com-Blog-cns!550F681DAD532637!7540.entry?ocid=TXT_TAGLM_WL_t2_ugc_post_022009>
> 
> 
> ------------------------------------------------------------------------
> 
> ------------------------------------------------------------------------------
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Simple-evcorr-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users


------------------------------------------------------------------------------
_______________________________________________
Simple-evcorr-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/simple-evcorr-users

Reply via email to