mirror of
https://github.com/eworm-de/routeros-scripts
synced 2024-05-14 08:04:19 +00:00
netwatch-notify: report the number of checks a host was down
This commit is contained in:
parent
5f46ef7635
commit
111e339d06
|
@ -25,10 +25,12 @@
|
|||
|
||||
:if ($HostVal->"status" = "up") do={
|
||||
$LogPrintExit debug ("Host " . $HostName . " (" . $HostVal->"host" . ") is up.") false;
|
||||
:local Count ($Metric->"count");
|
||||
:set ($Metric->"count") 0;
|
||||
:if ($Metric->"notified" = true) do={
|
||||
$SendNotification ("Netwatch Notify: " . $HostName . " up") \
|
||||
("Host " . $HostName . " (" . $HostVal->"host" . ") is up since " . $HostVal->"since" . ".");
|
||||
("Host " . $HostName . " (" . $HostVal->"host" . ") is up since " . $HostVal->"since" . ".\n" . \
|
||||
"It was down for " . $Count . " checks.");
|
||||
}
|
||||
:set ($Metric->"notified") false;
|
||||
} else={
|
||||
|
|
Loading…
Reference in a new issue