A small correction from my previous mail
the script will be as follows !!
#!/bin/sh -x if [ $(tail -n 10 /tmp/agnello |grep -e error | 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 "