mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2024-05-11 05:55:19 +00:00
netwatch-notify: report the number of checks a host was down
This commit is contained in:
@ -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={
|
||||
|
Reference in New Issue
Block a user