To implement a fail over scenario between 2 instances of traefik, I expose (internally) the standard traefik ping health-check page on port 7777 (https://doc.traefik.io/traefik/operations/ping/).
I discover netwatch includes http-get since ROS 7.4 and wonder if this could be used for my scenario to simplify the scripting regarding the monitoring. However I find no way to actually configure and execute a GET of the /ping page.
Due to this limitation, it seems I’ll still have to use /system/scripts with venerable command /tool fetch unless someone has already figured out how to use the new netwatch command in this scenario.
The http-get and https-get options should work… It allows you set the port/etc.
One thing to keep in mind in netwatch is that the gray’ed out value do have DEFAULT values (e.g. “Thr HTTP time”, “HTTP code”). Even though you don’t see the value, it could be why it APPEAR like it doesn’t work. i.e. if the HTTP code isn’t 200, it fails.
You do need to set http or https correctly, so if Traefik has TLS enabled and your using http-get that also wouldn’t work.
Well it kind of works but only partially. It cannot request a specific webpage. Hence it attempts to fetch /index.html which does not exists and returns a 404. So I could use it by allowing to consider 404 as a sign that the web site is up. But it is clearly suboptimal. Treafik does change the return status of page /ping when it is about to shutdown, so it would be better to be able to query that very specific page only.