add-dhcp-static-leases-to-netwatch.rsc
· 303 B · Text
Orginalformat
{
:local dhcpServer "ip_pool_192.168.0..x"
:foreach i in=[/ip/dhcp-server/lease/find where server=$dhcpServer and !dynamic] do={
:local lease [/ip/dhcp-server/lease/get number=$i];
:local ipAddress ("$lease"->"address");
/tool/netwatch/add host=$ipAddress type=icmp interval=10s timeout=3s
}
}
| 1 | { |
| 2 | :local dhcpServer "ip_pool_192.168.0..x" |
| 3 | :foreach i in=[/ip/dhcp-server/lease/find where server=$dhcpServer and !dynamic] do={ |
| 4 | :local lease [/ip/dhcp-server/lease/get number=$i]; |
| 5 | :local ipAddress ("$lease"->"address"); |
| 6 | /tool/netwatch/add host=$ipAddress type=icmp interval=10s timeout=3s |
| 7 | } |
| 8 | } |
| 9 |