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 custom task script in, for example: Administration/Scheduler/Custom 1

The basic command would be something like:

/bin/ping -q -c1 8.8.4.4


(8.8.4.4. is a google DNS server) which would cover the monitoring part without performing any action.

In order to link an action to a success (&&) or failure (||) we will append the wanted condition and the command.


For example:

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

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

# successful pings will log "Internet Available" where ping failures will log "Internet unavailable".
/bin/ping -q -c1 8.8.4.4 && /usr/bin/logger "Internet available" || /usr/bin/logger "Internet unavailable"

Notes about Connectivity Watchdog Script

This script is a custom one. Please note that there is also a setting in the Basic/Network menu of Tomato's web interface called “Check Connections Every”. This feature performs similar functions, with some differences. It is not recommended to use both this watchdog script and the Check Connections Every function at the same time. The two functions may interfere with each other, with unknown results.

connectivity_watchdog.1640492468.txt.gz · Last modified: 2021/12/26 04:21 by hogwild