1
0
mirror of https://github.com/eworm-de/routeros-scripts.git synced 2024-05-11 05:55:19 +00:00

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");