Community discussions

MikroTik App
 
netflow
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 94
Joined: Sat Oct 01, 2016 3:53 pm

Can the new netwatch http-get actually request a specific web page ?

Fri Nov 10, 2023 7:24 pm

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.
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 3510
Joined: Sun May 01, 2016 7:12 pm
Location: California

Re: Can the new netwatch http-get actually request a specific web page ?

Fri Nov 10, 2023 8:01 pm

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.
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 3510
Joined: Sun May 01, 2016 7:12 pm
Location: California

Re: Can the new netwatch http-get actually request a specific web page ?

Fri Nov 10, 2023 8:03 pm

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/).
AFAIK, the default port for { ping } is same as admin web port, 8080 ... unless your config specifically uses 7777.
 
netflow
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 94
Joined: Sat Oct 01, 2016 3:53 pm

Re: Can the new netwatch http-get actually request a specific web page ?

Sun Nov 12, 2023 7:14 pm

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.

Who is online

Users browsing this forum: No registered users and 13 guests