Created
May 6, 2018 07:44
-
-
Save Bersam/a8df30cf1f60179f9deb0f33ebe4fbfc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
while read line | |
do | |
SERVERIP=$line | |
[email protected] | |
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 | |
echo "Server $SERVERIP is down" | |
fi | |
done < "$1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment