Skip to content
Advertisement

How to be notified when IP is up?

I would like to ping a IP-Adress an want to be notified.

System: Linux Fedora.

Has anybody a idea or a Software?

Advertisement

Answer

Use this shell script. Found on http://jeromejaglale.com/doc/unix/shell_scripts/ping

#! /bin/sh

# -q quiet
# -c nb of pings to perform

ping -q -c5 google.com > /dev/null

if [ $? -eq 0 ]; then
    echo "ok"
fi

Put the ping in a loop or run the script with cron. Instead of echoing you can send a notification.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement