diff options
author | Christian Hesse <mail@eworm.de> | 2021-07-09 11:27:26 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2021-07-09 12:46:03 +0200 |
commit | bccb7c3452466aea0f8c1790643b3aeb21e9b1af (patch) | |
tree | c69fbd44982b001c1df277f2a4e2ebb84a8741d2 /netwatch-notify | |
parent | 12d34e4a7c40203aadfb536077c3c2b2cd1492d5 (diff) |
netwatch-notify: implement pre-down hookchange-60
Diffstat (limited to 'netwatch-notify')
-rw-r--r-- | netwatch-notify | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/netwatch-notify b/netwatch-notify index eecfa9f..966d415 100644 --- a/netwatch-notify +++ b/netwatch-notify @@ -117,6 +117,9 @@ $Metric->"count" . " checks, " . [ $IfThenElse ($ParentNotified = false) [ $IfThenElse \ ($Metric->"notified" = true) ("already notified.") ($Count - $Metric->"count" . " to go.") ] \ ("parent host " . $Parent . " is down.") ]) false; + :if ((($Count * 2) - ($Metric->"count" * 3)) / 2 = 0 && [ :typeof ($HostInfo->"pre-down-hook") ] = "str") do={ + $NetwatchNotifyHook $HostName "pre-down" ($HostInfo->"pre-down-hook"); + } :if ($ParentNotified = false && $Metric->"count" >= $Count && $Metric->"notified" != true) do={ :local Message ("Host " . $HostName . " (" . $HostVal->"host" . ") is down since " . $HostVal->"since" . "."); :if ([ :typeof ($HostInfo->"down-hook") ] = "str") do={ |