From b368ee9902eea02c9e4ea4222cc02af0561e6441 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Tue, 10 May 2022 15:11:44 +0200 Subject: netwatch-notify: RouterOS v7 path syntax --- netwatch-notify | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/netwatch-notify b/netwatch-notify index 34a9e8f..47b7fa1 100644 --- a/netwatch-notify +++ b/netwatch-notify @@ -46,7 +46,7 @@ $ScriptLock $0; -:if ([ / system resource get uptime ] < 5m) do={ +:if ([ /system/resource/get uptime ] < 5m) do={ $LogPrintExit2 info $0 ("System just booted, giving netwatch some time to settle.") true; } @@ -54,8 +54,8 @@ $ScriptLock $0; :set NetwatchNotify [ :toarray "" ]; } -:foreach Host in=[ / tool netwatch find where comment~"notify" disabled=no ] do={ - :local HostVal [ / tool netwatch get $Host ]; +:foreach Host in=[ /tool/netwatch/find where comment~"notify" disabled=no ] do={ + :local HostVal [ /tool/netwatch/get $Host ]; :local HostInfo [ $ParseKeyValueStore ($HostVal->"comment") ]; :if ($HostInfo->"notify" = true && $HostInfo->"disabled" != true) do={ @@ -74,7 +74,7 @@ $ScriptLock $0; $LogPrintExit2 info $0 ("Name '" . $HostInfo->"resolve" . [ $IfThenElse ($HostInfo->"resolve" != \ $HostInfo->"hostname") ("' for host '" . $HostInfo->"hostname") "" ] . \ "' resolves to different address " . $Resolve . ", updating.") false; - / tool netwatch set host=$Resolve $Host; + /tool/netwatch/set host=$Resolve $Host; :set ($Metric->"resolve-failed") false; } } on-error={ -- cgit v1.2.3-70-g09d2