mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04: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:
parent
1c2048628d
commit
1344694708
|
@ -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");
|
||||
|
|
Loading…
Reference in a new issue