After using the simple watchdog for a while I needed to monitor another network interface. Since the old script couldn’t be extended nicely (without creating lots of redundant code), I decided to rewrite the whole thing! This new version allows me to set up multiple watchdogs with custom commands within the configuration file. See how you can use it too:


Configuration

First create a new configuration file /etc/config/watchping:

This configures watchping with three instances. Each instance will ping the specified host and issue the restart command after the timeout expires. Customize this file to your needs, e.g. add your own hosts or disable instances you don’t need.

The scripts

Next create the folder /usr/lib/watchping/ and upload the following script:

Finally upload the init script to /etc/init.d/watchping:


Final touches

The watchping script requires fping to be installed on the router:

Check your system log and verify the watchdog started correctly:

Tested with OpenWRT 19.07

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.