MikroTik heartbeat monitoring
A heartbeat (inbound) monitor turns the usual check around. StatusNow does not probe your device; your device calls StatusNow on a schedule. If no call arrives within the interval you chose, the monitor goes red and alerts are sent.
That suits a router, because it works behind NAT, CGNAT or a firewall with no port forwarding and no public address. It also tests what you care about: the router is up, its scheduler is running and it can reach the internet.
1. Create an Inbound monitor
- In StatusNow choose Add monitor, then Inbound Monitor.
- Set Expect a call every (3, 5, 15 or 30 minutes, or hourly), name it and save.
- Copy the monitor's URL. It is shown once the monitor is saved.
2. Import the CA certificate on the router
RouterOS ships with no certificate authority store, so /tool fetch cannot verify a server until you import the CA that signed statusnow.dev. Do this once. Without verification the secret URL could be read by anyone able to intercept the connection, so use check-certificate=yes on the fetch.
- The certificate for
statusnow.devis issued by Let's Encrypt, and its chain ends at ISRG Root X1 (the chain also contains ISRG Root X2 and ISRG Root YE). Import ISRG Root X1: downloadisrgrootx1.pemfrom letsencrypt.org/certificates. Chains change over time, so check the current one by viewing the certificate in a browser. - Upload the file to the router (Files, or drag it into WinBox).
- Import it:
/certificate import file-name=isrgrootx1.pem - Add
check-certificate=yesto the/tool fetchline in your script, for example/tool fetch url=... check-certificate=yes .... The snippets below leave it out so they stay identical to the ones in the app; add it once the CA is imported. - Test it by running the script once and checking
/log print where message~"statusnow". A certificate error means the CA is missing. Older RouterOS 6 releases may not handle the ECDSA chain; use RouterOS 7.
If the fetch reports a certificate error, do not turn certificate checking off. Fix the certificate chain instead.
3. Choose a script
Both scripts send a heartbeat every minute by default; see step 7 to choose the interval. The router itself must be allowed to make outbound https connections.
Simple
One line in the terminal. Sends an empty POST. Replace PASTE_INBOUND_URL with your URL.
With health data
A script that posts a small JSON body (device name, RouterOS version, uptime, CPU, free memory) and can skip the heartbeat when a local host does not answer. Create it under System > Scripts with the name statusnow-heartbeat and the policies read, write, test.
Then, once the script exists, add the scheduler that runs it:
4. Verify
/system scheduler printshowsstatusnow-heartbeatand its run count going up./log print where message~"statusnow"shows nothing, or a warning line if the gate failed or the post failed.- In StatusNow the monitor turns green after the first call. The inbound log lists each call; with the full script the JSON body is visible there.
5. Troubleshooting
- Nothing happens: the scheduler and the script need the policies
read,write,test. - Certificate error in the log: the CA is not imported, or it is not the one that signed the current certificate (step 2).
- Cannot resolve host: the router needs a working DNS server (
/ip dns print). - Blocked: a firewall rule on the
outputchain may drop the router's own https traffic. - Scheduler not running: check
/system scheduler print; it must not be disabled. Withstart-time=startupit begins when the router boots. - Broken JSON in the inbound log: a router identity containing a double quote breaks the hand-built body. Rename the identity. Delivery is not affected.
- The router clock does not need to be correct; StatusNow timestamps each call when it arrives.
6. The optional health gate
In the full script, :local gate "" is empty, so it always sends. Put in an address that matters, such as a core switch, a second WAN gateway or a VPN peer, and the heartbeat is only sent when that host answers three pings. The monitor then says "the router can reach what it should", not just "the router is on".
What the platform does: it records each call and its body, and raises an alert when no call arrives within the interval. What it does not do: it never reads or evaluates the body. The CPU and memory numbers are there for you to read in the log; they do not trigger alerts.
7. Choose the heartbeat interval
Send about three times more often than the monitor's Expect a call every value, so one lost packet or one slow connection does not raise an alert.
- Expect every 3 or 5 minutes: send every 1 minute.
- Expect every 15 minutes: send every 5 minutes.
- Expect every 30 minutes: send every 10 minutes.
- Expect hourly: send every 15 minutes.
Change interval=1m in the scheduler to match.