netwatch-notify: handle status "down" in its own condition...

... instead of else-branch.

This makes sure to skip hosts that just became "unknown".
(Possible soon!)
This commit is contained in:
Christian Hesse 2024-02-21 09:05:29 +01:00
parent 1c2048628d
commit 1344694708

View file

@ -125,7 +125,9 @@ $ScriptLock $0;
:set ($Metric->"notified") false;
:set ($Metric->"parent") ($HostInfo->"parent");
:set ($Metric->"since");
} else={
}
:if ($HostVal->"status" = "down") do={
:set ($Metric->"count-down") ($Metric->"count-down" + 1);
:set ($Metric->"count-up") 0;
:set ($Metric->"parent") ($HostInfo->"parent");
@ -178,6 +180,7 @@ $ScriptLock $0;
:set ($Metric->"notified") true;
}
}
:set ($NetwatchNotify->$Name) {
"count-down"=($Metric->"count-down");
"count-up"=($Metric->"count-up");