External watchdog / weekly restart for HA supervised

I have HA supervised. Sometimes (specially when I’m away) I find out that HA is not running but I can connect to the server via ssh or remote desktop… sometimes not even that, because there’s a problem with the old crappy router I have (that needs to be restarted often).

So I made two scripts (part in bash, part in python) called watchdog and weekly restart. I use crontab in Debian to run them every hour and every week respectively; if something goes wrong, watchdog restarts the HA service, the server or the router, and weekly_restart does its part of cleaning the router memory. You can check the txt log to know what went wrong and the actions taken.

https://github.com/mabusdogma/watchdog

The scripts are independient of HA (why? No HA, no trigger to restart!), but I would like to manually trigger them if I want, from HA… any ideas?