From 9d19313eee7e647a7f094aa01f40f179bfd23b0b Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Thu, 6 May 2021 14:50:45 +0200 Subject: netwatch-notify: log on host up... ... if logged on host down before. --- netwatch-notify | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/netwatch-notify b/netwatch-notify index 5600857..9cb99bb 100644 --- a/netwatch-notify +++ b/netwatch-notify @@ -34,9 +34,11 @@ } :if ($HostVal->"status" = "up") do={ - $LogPrintExit2 debug $0 ("Host " . $HostName . " (" . $HostVal->"host" . ") is up.") false; :local Count ($Metric->"count"); - :set ($Metric->"count") 0; + :if ($Count > 0) do={ + $LogPrintExit2 info $0 ("Host " . $HostName . " (" . $HostVal->"host" . ") is up.") false; + :set ($Metric->"count") 0; + } :if ($Metric->"notified" = true) do={ $SendNotification2 ({ origin=$0; \ subject=([ $SymbolForNotification "white-heavy-check-mark" ] . "Netwatch Notify: " . $HostName . " up"); \ -- cgit v1.2.3-54-g00ecf