mirror of
https://github.com/eworm-de/routeros-scripts.git
synced 2025-08-03 09:44:35 +02:00
netwatch-notify: report the number of checks a host was down
This commit is contained in:
parent
5f46ef7635
commit
111e339d06
1 changed files with 3 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue