/ Published in: Perl
Expand |
Embed | Plain Text
#!/bin/sh HTTP_STATUS=`lynx -head -source http://www.seekeraftertruth.com/ | head --lines=1 | awk '{print $2}'` SUBJECT="[Alert] Php5-fpm Error code: $HTTP_STATUS restarted" # Email from EMAIL_FROM="[email protected]" # Email to EMAIL_TO="satfeed@liHumayun # Email text/message EMAILMESSAGE="Error Status $HTTP_STATUS detected. Restart performed at `date` " if [ "$HTTP_STATUS" != "200" ] then service php5-fpm restart echo $EMAILMESSAGE | mail -s "$SUBJECT" "$EMAIL_TO" -a "Reply-To: $EMAIL_FROM" fi
You need to login to post a comment.
