Actually now that I think about this again the problem with greping the mail.log would be once the problem was fixed it would continue to alert until the log was rotated so maybe a better method would be to use someithing like telnet 127.0.0.1 10024 and upon failure then send mail to user@.... Jim Craig White wrote: >On Wed, 2004-07-21 at 11:11, elemint@theriver.com wrote: > > >>I am trying to create a script to see if amavis is alive and upon >>failure send email to someuser@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@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=, relay=none, delay=7586, status=deferred (delivery >>temporarily suspended: connect to 127.0.0.1[127.0.0.1]: Connection refused) >> >> >---- >Without really thinking this completely through, my initial inclination >would be to set up a mail alias that routes mail to /dev/null. Then I >would have a shell script that has something like... > >if mail user_whose_mail_goes_to_dev_null -s "testing for accepting mail" >= 0; then mail real_mail_notification_address -s "Problem with mail >server"; fi > >and once I was sure that it worked, I would set it into a cron script. > >Craig > >--------------------------------------------------- >PLUG-discuss mailing list - PLUG-discuss@lists.plug.phoenix.az.us >To subscribe, unsubscribe, or to change you mail settings: >http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss > > > --------------------------------------------------- PLUG-discuss mailing list - PLUG-discuss@lists.plug.phoenix.az.us To subscribe, unsubscribe, or to change you mail settings: http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss