Question
server status check notice via email for server fault
Hi,
I am looking for something that will give me notice via email of a down server or other fault such as overload. Can you please recommend something Thanks.
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
×
hmm…not sure a server that is down can send you an email…or do anything for that matter.
however, a server can certainly send you a notification if a service has stopped or crashed (like mysql or apache or such)
You could possibly have a different droplet that checks on other droplets, and then sends you an email. Same idea: you would write a script that pings your other droplet, or attempts to ssh into it, or whatever, and then put that script on a cronjob for every 10 minutes, or hour or whatever.
Do you have server that goes down a lot?
****Hi,
Thank you for your response. I realize that that i would have to use another server to do the checking if the server is down. I was just wondering if DigitalOcean had a ready made script or API to get it done.
If you have a separate server to run your check script on, something like this would do a simple Ping test to see if the server is alive:
Cron this script.
!/bin/bash
SERVERIP=IP_Address
NOTIFYEMAIL=test@example.com
ping -c 3 $SERVERIP > /dev/null 2>&1
if [ $? -ne 0 ]
then
# Use your favorite mailer here:
mailx -s “Server $SERVERIP is down” -t “$NOTIFYEMAIL” < /dev/null
fi