[Tfug] Creating a Script to see if amavis is alive

Chris Mathis chris at campus.azintl.edu
Wed Jul 21 12:26:12 MST 2004


the problems that i see with this so far is that:
#1 rather than just greping for Connection and refused you should be
also greping for 127.0.0.1 because if you dont have that the connection
could be being refused from another box, there for putting amavis in a
continous loop. 
#2 you realy should be doing a tail of the log rather than greping
through the entire thing, so that ooops it restarted and the mail.log
did not update or somthing like that happens, your again not doing a
loop. 
other than that it looks fine, though my question would be "why is
amavis not alive? i didnt stop it"

Chris 
On Wed, 2004-07-21 at 11:14, elemint at theriver.com wrote:
> I am trying to create a script to see if amavis is alive and upon 
> failure send email to someuser at domain.com
> 
> This is what I have so far.
> 
> 
> cat amavis.check
> grep Connection /var/log/mail.log |grep refused
> 
> if  success
> then cat /amavis.not.alive | mail [email]user at somedomain.com[/email]
> 
> 
> The thought is that when amavis is failing there are messages like the 
> one below in mail.log
> 
> "Jul 20 11:59:09 mail postfix/qmgr[5764]: 25AE16F8DF: 
> to=<user at domain.com>, relay=none, delay=7586, status=deferred (delivery 
> temporarily suspended: connect to 127.0.0.1[127.0.0.1]: Connection refused)
> 
> 
> Jim
> 
> _______________________________________________
> tfug mailing list
> tfug at tfug.org
> https://www.tfug.org/mailman/listinfo/tfug
---- BOFH Excuse #212: Of course it doesn't work. We've performed a
software upgrade.



More information about the tfug mailing list