Re: script to send mail when error detected in log file

2008-03-07 Thread Agnello George
Your inputs will be of great help Might I suggest swatch? Why create your own script, when someone's already created a powerful tool to do this. http://swatch.sourceforge.net/ There's lots of good articles on using it out there:

Re: script to send mail when error detected in log file

2008-03-07 Thread Eddy Beliveau
/location/of/script Cheers, Eddy - Message d'origine - De : Agnello George À : Matt Kettler Cc : Spamassassin Envoyé : 7 mars 2008 07:27 Objet : Re: script to send mail when error detected in log file Your inputs will be of great help Might I suggest

Re: script to send mail when error detected in log file

2008-03-07 Thread Agnello George
On 3/7/08, Eddy Beliveau [EMAIL PROTECTED] wrote: Hi! You said then i add a crontab to run for ever 10 min crontab -e 10 * * * * /your/location/of/script Please note that your syntax said to execute once per hour at the 10th minute of the hour To execute at interval of 10 minutes,

Re: script to send mail when error detected in log file

2008-03-07 Thread Bob Proulx
Agnello George wrote: #!/bin/sh -x if [ $(tac /var/log |grep -e error: syswrite() | wc -l ) = 0 ] ; then This can be improved. Let's walk through it. On my system /var/log is a directory of log files and not an actual log file. The typical log file is /var/log/syslog one many systems and

Re: script to send mail when error detected in log file

2008-03-07 Thread Bob Proulx
Bob Proulx wrote: if grep -q error: syswrite() /var/log/spamd.log; then echo your mailserver is down | mail -s pls check server ip 216.185.xxx.xxx [EMAIL PROTECTED] exit 1 fi exit 0 Oh, and after I sent that previous message I realized I should have asked another question.

Re: script to send mail when error detected in log file

2008-03-04 Thread Agnello George
On 3/4/08, Matt Kettler [EMAIL PROTECTED] wrote: Agnello George wrote: HI I have a small query !! I need to write a script whenever there is an error generated in the spamd.log or any general log file to send me a mail only once, the bellow script is what i came u with but i doubt it

Re: script to send mail when error detected in log file

2008-03-04 Thread --[ UxBoD ]--
this link works just fine :- http://mesh.dl.sourceforge.net/sourceforge/swatch/swatch-3.2.2.tar.gz Regards, -- --[ UxBoD ]-- // PGP Key: curl -s http://www.splatnix.net/uxbod.asc | gpg --import // Fingerprint: F57A 0CBD DD19 79E9 1FCC A612 CB36 D89D 2C5A 3A84 // Keyserver: www.keyserver.net

Re: script to send mail when error detected in log file

2008-03-04 Thread Chris Hoogendyk
Agnello George wrote: HI I have a small query !! I need to write a script whenever there is an error generated in the spamd.log or any general log file to send me a mail only once, the bellow script is what i came u with but i doubt it would work. if [ $(grep -e unable to start service

script to send mail when error detected in log file

2008-03-03 Thread Agnello George
HI I have a small query !! I need to write a script whenever there is an error generated in the spamd.log or any general log file to send me a mail only once, the bellow script is what i came u with but i doubt it would work. if [ $(grep -e unable to start service /var/log/spamd.log) = 1 ] ;

Re: script to send mail when error detected in log file

2008-03-03 Thread Matt Kettler
Agnello George wrote: HI I have a small query !! I need to write a script whenever there is an error generated in the spamd.log or any general log file to send me a mail only once, the bellow script is what i came u with but i doubt it would work. if [ $(grep -e unable to start service

Re: script to send mail when error detected in log file

2008-03-03 Thread Bob Proulx
Agnello George wrote: I have a small query !! I need to write a script whenever there is an error generated in the spamd.log or any general log file to send me a mail only once, the bellow script is what i came u with but i doubt it would work. if [ $(grep -e unable to start service