diff options
author | Christian Hesse <mail@eworm.de> | 2024-02-21 09:05:29 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2024-02-28 23:01:43 +0100 |
commit | 1344694708eba29f02864f9c5016e835084a0788 (patch) | |
tree | 7618a6c963c4a64a5cf2573668b884d588e157d9 /netwatch-notify.rsc | |
parent | 1c2048628d68a94e08bfcae98f33bb0bce53a25c (diff) |
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!)
Diffstat (limited to 'netwatch-notify.rsc')
-rw-r--r-- | netwatch-notify.rsc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/netwatch-notify.rsc b/netwatch-notify.rsc index d2a18ca..a562c85 100644 --- a/netwatch-notify.rsc +++ b/netwatch-notify.rsc @@ -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"); |