Automatic Server-Down Emails
Step 1. Set up your Linux Box with your gmail address, smtp.google.com, and password generated here: https://security.google.com/settings/security/apppasswords
Step 2. Open crontab -e
Step 3. Enter this line:
59 * * * * whoToEmail="adamoutler@gmail.com" serverToCheck="adamoutler.com"; curl -m 5 $serverToCheck || $(curl http://google.com && echo "At $(date) it was detected the $serverToCheck server is down" |mail -s "$serverToCheck is down" $whoToEmail)
Step 4. Change whoToEmail and serverToCheck to your own values.
Step 5. Do happy dance.
Shared publiclyView activity