add_netwatch
Create a MikroTik Netwatch host monitor with optional interval and comment, preview changes before confirming, and avoid duplicates or unsafe scripts.
Instructions
Create a Netwatch host monitor (/tool/netwatch add): host
(a plain IPv4/IPv6 address), optional interval (a RouterOS
duration, e.g. "10s"/"00:00:10") and optional comment.
SECURITY: this tool does NOT accept an up-script/down-script - a Netwatch script body can run arbitrary RouterOS commands (route or credential changes, ...), so it is deliberately outside what this guarded write tool will ever send to a device. Configure up/down scripts manually on the device once the monitor exists (WinBox/CLI)
see README's "Failover control" section. The read-only
netwatchtool already only ever surfaceshas-up-script/has-down-scriptas presence booleans, never a script body, for the same reason.
WRITE tool, guarded: blocked entirely unless the server is running
with MIKROTIK_ALLOW_WRITE=true. Call with confirm=False (the
default) to get a before/after preview without changing anything;
call again with confirm=True to actually apply it. Errors clearly
(without creating anything) if a monitor for host already exists -
it never creates a duplicate.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| host | Yes | ||
| comment | No | ||
| confirm | No | ||
| interval | No | ||
| device_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||