netwatch-notify: log on host up...

... if logged on host down before.
This commit is contained in:
Christian Hesse 2021-05-06 14:50:45 +02:00
parent 41f7d1e466
commit 9d19313eee
1 changed files with 4 additions and 2 deletions

View File

@ -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"); \