1
0
mirror of https://github.com/eworm-de/routeros-scripts.git synced 2024-05-11 05:55:19 +00:00

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

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