Watchcat and luci-app-watchcat update

Good day everyone,

I have started working on some features for the incredibly useful watchcat, and the corresponding luci-app-watchcat packages.

Merge Requests
watchcat
luci-app-watchcat

Main features added

  • support for restarting a network interface instead of rebooting the router
  • ping via a specific interface and restart that interface if the ping fails
  • support for specifying ping packet size
  • included a ModemManager-specific path of action
  • general refactor of the code: renaming variable names, aiming for style consistency
  • supports backward-compatibility with the old service type names: always, ping

The code needs another quick tidy up, and the commits need to be redone in order to make this modular and more easily acceptable/revertable, which I will do. Here is my plan for that:
A commit for each of the following:

  • the first refactor
  • the ping packet size feature
  • the restart_iface feature
  • the modemmanager specific features

I wanted to see if I should change the priorities a bit based on community feedback before starting the MR.

  • Should I make it so any service can be restarted, instead of just ModemManager?
  • Any other feedback?
7 Likes

what a kind, considerate and genuine soul...

  • trigger script

i'm thinking, '/etc/watchcat.user' ( aka /etc/udhcpc.user )... short term, provides the most extensible, modular framework.

probably as a list though... i.e. ' list user_script 'A''... the only downside of this method is lack of luci management...

suppose an additional built in sample/daemon script could overcome that... something like ... 'option watchcat_script 1'...

  • trigger hotplug events

in or out of the script/s above 'option hotplug_ifaceevents 1' or similar... :slight_smile:

Joined the forum just to say - I am really looking forward to your improvements. Especially the following two:

  • support for restarting a network interface instead of rebooting the router
  • ping via a specific interface and restart that interface if the ping fails

Since my IPv4 and v6 paths have different quirks.

(Longer version, my modem assigns a bogus IPv4, but not v6, address if it doesn't have connectivity)

1 Like

I like the idea to trigger hotplug events as it can give the user control to write their own actions. I’ll have to look into that more

1 Like

I'm looking forward to it. When will it be released?

The MR's are under review on github, we need to make sure everything is right before it gets in.


1 Like

Hey,
@thirtythreeforty, @jekseparo it's been merged into openwrt/packages, please give it a try

1 Like

try to install manually with scp by overwriting the existing files
I don't know how to install using opkg
looks like this

image

1 Like

Hey!

There have been some changes to luci-app-watchcat and watchcat; namely a rewrite in JavaScript, and moving Watchcat into its own /etc/config/watchcat file, respectively. Testing is welcome. At the moment there is a call for suggestions on how to support migration from the old system.@watchcat[n] UCI configuration to the new location via a UCI-defaults shell script. If anyone has any suggestions, feedback or code contributions feel free to jump into the conversation.

Edit: these have been merged into master

1 Like

suggestion
on the Mode: Restart Interface
to check if the wireless is in AP or STA mode,
So if we change the wireless interface from STA to AP and we forget to set the watchcat, the watchcat will automatically deactivate the interface restart mode.

Sorry my English is bad

I'm having trouble getting the current version 1-12 to work with mwan3 on 21.02. I have two wan connections. With version 1-7 on 19.07, as long as one of the two wan connections was up it wouldn't reboot. With v1-12 if the main wan connection goes down it will reboot even if the wanb connection is still up. Maybe I'm doing something wrong?

1 Like

I have the same problem. What are your interface to monitor and to rebbot?

I tried Ethernet Switch, br-lan and "unspecified".

Try my super simple script, copy it inside /etc/ and add "/etc/respawnLTE.sh &" in rc.local:

respawnLTE.sh

#!/bin/sh
while [ 1 ]; do
#ping 1 packet and wait an answer for 2 seconds
        ping -q -c 1 -W 2 -I wwan0 1.1.1.1 >/dev/null
        RESULT=$?
        if [ $RESULT -ne 0 ]; then
                /etc/init.d/modemmanager stop
                sleep 2
                /etc/init.d/modemmanager start
				sleep 60
                echo "ristarted"
        fi
# wait 10 seconds for the text ping
        sleep 10
done

1 Like

Are you specifying an interface to ping over? Please post your config file.

@TonyB_IT
You should probably put it under /usr/bin/ instead of /etc/, which is meant for configuration files.

One suggestion:
there is already an app luci-app-commands in which the user can define custom commands. It would be nice if you can incooperate luci-app-watchcat to trigger a custom command from luci-app-commands

1 Like

Yes I had that idea earlier, just haven't had time to implement it yet. You can already accomplish the same thing by modifying the source code of this package

i'm running openwrt 19.07.7. installed watchcat 1.7 and luci-app-watchcat. when i go into luci watchcat there is only the option to reboot. any ideas?

You need to be on master or 21.02

1 Like

Does watchcat support IPv6? I would like to monitor my 6in4-wan6 interface, and reboot if ping -6 to a remote ipv6 destination fails over it.