Community discussions

MikroTik App
 
cuu508
just joined
Topic Author
Posts: 2
Joined: Mon Jun 10, 2024 12:56 pm

Sending a HTTP request on schedule

Mon Jun 10, 2024 1:06 pm

Hello,

I want to set up a Mikrotik hEX to send regular HTTPS requests to a specific address for external monitoring purposes.

The way I've figured out to do this is:

1. Set up a script that does
/tool fetch url="https://my-url-here.example.org" mode=https output=none

Image

Notes:

* I added "output=none" to avoid needing the "write" policy.
* I tried adding "check-certificate=yes" but the request didn't work then. Does RouterOS use a limited or outdated root certificate store?

2. Set up a scheduled task:

Image

My question is – is this the optimal way to do this, or is there a neater, or more compact way? For example, is there a way to avoid having a script, but use the single command in the scheduler directly?

Thanks!
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12096
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Sending a HTTP request on schedule

Tue Jun 11, 2024 10:18 am

Use netwatch;
if you use url="https://..." mode=https is unnecessary
you must install certs, if you want check https, for default no certs are installed.
 
cuu508
just joined
Topic Author
Posts: 2
Joined: Mon Jun 10, 2024 12:56 pm

Re: Sending a HTTP request on schedule

Tue Jun 11, 2024 2:35 pm

Thanks for the tips!
Use netwatch;
Looks like on RouterOS v6 it can only do ICMP, and I first need to upgrade to v7.
On v7, looks like I can specify host by IP address and port, but it is not immediately obvious how I can specify an URL (with a domain name not an IP address, and with a path).
if you use url="https://..." mode=https is unnecessary
Thanks, that works indeed!
you must install certs, if you want check https, for default no certs are installed.
Thanks, I see.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12096
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: Sending a HTTP request on schedule

Tue Jun 11, 2024 4:47 pm

Use netwatch;
Looks like on RouterOS v6 it can only do ICMP, and I first need to upgrade to v7.
Sorry, I do not notice "6.49.15" version on picture

Who is online

Users browsing this forum: No registered users and 6 guests