diff options
author | Christian Hesse <mail@eworm.de> | 2021-05-06 14:50:45 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2021-05-06 15:11:05 +0200 |
commit | 9d19313eee7e647a7f094aa01f40f179bfd23b0b (patch) | |
tree | 828209853a33c2f793c898383ae3fe3430dfceba | |
parent | 41f7d1e4668a8ff1d72594e811df0b6c44d865ba (diff) |
netwatch-notify: log on host up...
... if logged on host down before.
-rw-r--r-- | netwatch-notify | 6 |
1 files 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"); \ |