Two scripts to warn you when either an address is UP or DOWN.
Alarm when address is reachable (good if the box or your internet connection is down):
pingAddress=google.com
while :
do
ping -t 2 -o pingAddress && say ping $pingAddress working
sleep 2
done
This script sounds an alarm when it does not connect to an address:
pingIpAddress=google.com
while :
do
ping -t 2 -o -c 1 $pingIpAddress || say ping to $pingIpAddress failing
sleep 2
done