mirror of
https://git.eworm.de/cgit/routeros-scripts
synced 2025-08-14 23:12:21 +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={
|
:if ($HostVal->"status" = "up") do={
|
||||||
$LogPrintExit debug ("Host " . $HostName . " (" . $HostVal->"host" . ") is up.") false;
|
$LogPrintExit debug ("Host " . $HostName . " (" . $HostVal->"host" . ") is up.") false;
|
||||||
|
:local Count ($Metric->"count");
|
||||||
:set ($Metric->"count") 0;
|
:set ($Metric->"count") 0;
|
||||||
:if ($Metric->"notified" = true) do={
|
:if ($Metric->"notified" = true) do={
|
||||||
$SendNotification ("Netwatch Notify: " . $HostName . " up") \
|
$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;
|
:set ($Metric->"notified") false;
|
||||||
} else={
|
} else={
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue