aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--netwatch-notify12
1 files changed, 7 insertions, 5 deletions
diff --git a/netwatch-notify b/netwatch-notify
index 27e0759..76b3f2b 100644
--- a/netwatch-notify
+++ b/netwatch-notify
@@ -143,11 +143,13 @@ $ScriptLock $0;
:set Parent ($NetwatchNotify->$Parent->"parent");
}
}
- $LogPrintExit2 [ $IfThenElse ($HostInfo->"no-down-notification" != true) info debug ] $0 \
- ("The " . $Type . " '" . $Name . "' (" . $HostDetails . ") is down for " . \
- $Metric->"count-down" . " checks, " . [ $IfThenElse ($ParentNotified = false) [ $IfThenElse \
- ($Metric->"notified" = true) ("already notified.") ($CountDown - $Metric->"count-down" . \
- " to go.") ] ("parent " . $Type . " " . $Parent . " is down.") ]) false;
+ :if ($Metric->"notified" = false || $Metric->"count-down" % 120 = 0) do={
+ $LogPrintExit2 [ $IfThenElse ($HostInfo->"no-down-notification" != true) info debug ] $0 \
+ ("The " . $Type . " '" . $Name . "' (" . $HostDetails . ") is down for " . \
+ $Metric->"count-down" . " checks, " . [ $IfThenElse ($ParentNotified = false) [ $IfThenElse \
+ ($Metric->"notified" = true) ("already notified.") ($CountDown - $Metric->"count-down" . \
+ " to go.") ] ("parent " . $Type . " " . $Parent . " is down.") ]) false;
+ }
:if ((($CountDown * 2) - ($Metric->"count-down" * 3)) / 2 = 0 && \
[ :typeof ($HostInfo->"pre-down-hook") ] = "str") do={
$NetwatchNotifyHook $Name $Type "pre-down" ($HostInfo->"pre-down-hook");