Site Tools


connectivity_watchdog

This is an old revision of the document!


Connectivity Watchdog

You might want to monitor your Internet connectivity. The simplest way to do this is to run a regular task under Administration/Scheduler/Custom 1 e.g.

The besic command would be something like:

/bin/ping -q -c1 8.8.4.4

(8.8.4.4. being the a google DNS) which would cover the monitoring part without perform any action.

To link an action to success (&&) or failure (||) or both append the wanted condition + command

Examples:

/bin/ping -q -c1 8.8.4.4 || /sbin/service wan restart #if ping fails restart the wan

/bin/ping -q -c1 8.8.4.4 || /sbin/reboot # if ping fails reboot the device

/bin/ping -q -c1 8.8.4.4 && /usr/bin/logger “Internet available” || /usr/bin/logger “Internet unavailable” # successful ping will log “Internet Available” where ping failure logs “Internet unavailable”

etc

connectivity_watchdog.1614029742.txt.gz · Last modified: 2021/02/22 21:35 by hogwild