Site Tools


connectivity_watchdog

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
connectivity_watchdog [2021/02/22 21:35] hogwildconnectivity_watchdog [2023/07/02 16:47] – [Notes about Connectivity Watchdog] -changed to Connectivity Watchdog Notes hogwild
Line 1: Line 1:
 ====== Connectivity Watchdog ====== ====== 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.+For various reasons, you might want to monitor your Internet connectivity. The simplest way to do this is to run a custom task scriptThe basic command structure might look something like this:
  
-The besic command would be something like:+For example, in the [[admin-sched|Scheduler]] menu, in the** **//Custom 1 field://
  
-**/****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.+<code -> 
 +/bin/ping -q -c1 8.8.4.4 
 +</code>
  
-To link an action to success (&&) or failure (||) or both append the wanted condition + command+\\ The 8.8.4.4. IP address is a google DNS server. This scheduled command would allow monitoring without requiring any further interaction with the user.
  
-Examples:+Next, in order to link an action to a success (&&) or failure (||) , we will append a command to the wanted condition.
  
-**/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+For example: 
 + \\ 
 + \\  
 +<code -> 
 +#if ping fails, restart the wan. 
 +/bin/ping -q -c1 8.8.4.4 || /sbin/service wan restart
  
-**/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"+# if ping fails, reboot the device. 
 +/bin/ping -q -c1 8.8.4.4 || /sbin/reboot
  
-etc+# 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" 
 +</code> 
 + 
 + \\ 
 + 
 + \\ 
 + 
 + 
 +===== Connectivity Watchdog Notes ===== 
 + 
 +This script is a custom one. Please note that there is also a setting in FreshTomato's [[basic-network|Network]] Web interface menu called "//Check Connections Every//". This feature performs similar functions, with some differences. It is not recommended that you use both this watchdog script and the //Check Connections Every //function at the same time. The two functions may interfere with each other, and conflicts might occur.
  
  
connectivity_watchdog.txt · Last modified: 2024/03/02 18:03 by hogwild