Skip to content

Instantly share code, notes, and snippets.

@josemalcher
Created November 23, 2015 20:39
Show Gist options
  • Save josemalcher/f45589076a9319f9b39a to your computer and use it in GitHub Desktop.
Save josemalcher/f45589076a9319f9b39a to your computer and use it in GitHub Desktop.
PING=/bin/ping
SITE="hostname ou IP"
DATA=`date +%d-%m-%y-%H:%M`
LOGFILE=/var/log/monitor
$PING -q -c 1 $SITE | grep -w "0%" > /dev/null
if [ $? -ne 0 ]; then
# Site fora do ar
echo "$SITE - $DATA - Não responde..." >> $LOGFILE
exit
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment