How your server should send you a mail incase you log generates a typical error meaasge

I came up with my own script to do this
#!/bin/sh -x
if [ $(tail -n 10 /var/log/spamd.log grep -e "error: syswrite()" wc -l ) = 0 ] ; then exit 1 else echo "your mailserver is down" mail -s " pls check server ip 216.185.xxx.xxx " agnello.dsouza@gmail.com fi
then i add a crontab to run for ever 10 min
crontab -e
*/10 * * * * /your/location/of/script
This works for me

No comments:

Other Articles

Enter your email address: