MikroTik API icon

MikroTik API

Community Node for MikroTik RouterOS API

Actions67

Netwatch → Set

AI-generated

Summary

Sets a netwatch monitor entry on a MikroTik device.

Inputs

  • targetId (required) — ID (*1, *2) or Name (e.g. ether1, user1) of the netwatch entry to set.
  • netwatchHost — IP address or hostname to monitor (optional).
  • netwatchInterval — Interval between checks (e.g. 1m, 30s); defaults to 1m if omitted.
  • netwatchTimeout — Timeout for checks (e.g. 1s, 500ms); defaults to 1s if omitted.
  • netwatchUpScript — Script to run when the host comes up (optional).
  • netwatchDownScript — Script to run when the host goes down (optional).
  • commentText — Comment to associate with the netwatch entry (optional).

Output shape

{ resource, operation, count, data }

data contains the RouterOS response; count is 1 for single entries or the array length.

Examples

Example 1: Set netwatch entry with custom host, interval, and timeout.

targetId: *1; netwatchHost: 192.168.1.100; netwatchInterval: 30s; netwatchTimeout: 2s

Links

Discussion