Watchcat and luci-app-watchcat update

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.

I certainly think that can be added

Any ETA about ipv6 support. would be perfect for me cause my ipv6 Preffix fails so often and my VPN server stopped working without working IPV6

I agree with all of your ideas. However, I recently noticed the need to be able to run a custom shell script as the modemmanager interface for watchcat, such as a shell script to restart the specific wifi radio that stopped working on the router.

If possible, I'd like to be able to restart the openvpn client service, as sometimes the far end seems to just go quiet so I need to manually stop and start the openvpn service...either by calling a shell script, or by having watchcat restart the service itself.

I've tried to stop the tun0 interface but that doesn't fix the problem, and if I try to ping a remote site via wan it can't connect (presumably because the firewall is denying any outbound connection that isn't via tun0.)

Thanks for this. Question on how I thought it worked vs. what I'm seeing happening though.

With this as the config:

config watchcat
	option mode 'restart_iface'
	option period '3m'
	option pinghosts '192.168.100.1'
	option pingperiod '30s'
	option pingsize 'standard'
	option interface 'eth0.2'

And the condition being met, would you expect the interface to be restarted every 30 seconds? Because that's what happens, as confirmed by the log. I was thinking 3 mins. It even says "after 180 seconds" in the log, but the timestamps say otherwise.

A snippet of the log showing that:

Sat Jul  2 15:43:18 2022 daemon.info watchcat[3727]: Could not reach 192.168.100.1 via "eth0.2" for "10392" seconds. Restarting "eth0.2" after reaching "180" seconds
Sat Jul  2 15:43:18 2022 user.notice INFO: Restarting network interface: "eth0.2".

[other stuff cut out for brevity]

Sat Jul  2 15:43:47 2022 daemon.info watchcat[3727]: Could not reach 192.168.100.1 via "eth0.2" for "10422" seconds. Restarting "eth0.2" after reaching "180" seconds
Sat Jul  2 15:43:47 2022 user.notice INFO: Restarting network interface: "eth0.2".

is it possible to run a n EXEC command based on a ping timeout?

(Example: wget -O- -q http://192.168.100.1:80/reset.htm?reset_modem=Restart+Cable+Modem)

There's an important feature i miss:

ping multiple targets, and perform action only, if all of the target's aren't reachable anymore.
Only having one target allows the scenario, that the target goes offline for whatever reason.

1 Like

You can try over app pingcontrol

dairyman has develop a similar function for his OpenWRT distro called ROOter. It is calle Custom Ping Test. It does check for a web page load in addition to pinging an address. I hope watchcat can evolve to do web page load check also. there are instances the LTE modem will ping certain addresses, but can't load a page.

Is there a way to get the updated version for Openwrt 18.06?

Also please add an optional command line option to execute together with the trigger.