netwatch-notify: better match notify-entries

This commit is contained in:
Christian Hesse 2022-01-02 20:47:12 +01:00
parent 45ffb7e552
commit 7f0a8cdfcd

View file

@ -50,9 +50,11 @@
$ScriptLock $0;
:foreach Host in=[ / tool netwatch find where comment~"^notify," disabled=no ] do={
: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={
:local HostName ($HostInfo->"hostname");
:local Metric { "count"=0; "notified"=false };
@ -140,4 +142,5 @@ $ScriptLock $0;
"parent"=($Metric->"parent");
"resolve-failed"=($Metric->"resolve-failed");
"since"=($Metric->"since") };
}
}