connectivity_watchdog [FreshTomato Wiki]

Site Tools


connectivity_watchdog

Connectivity Watchdog

You might want to monitor your Internet connectivity. To do so the simpliest way 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.txt · Last modified: 2020/08/14 14:07 by rs232