mirror of
https://github.com/nymurbd/MikroTik-scripts.git
synced 2025-08-03 17:54:35 +02:00
netwatch-notify: implement pre-down hook
This commit is contained in:
parent
12d34e4a7c
commit
bccb7c3452
6 changed files with 11 additions and 3 deletions
|
@ -117,6 +117,9 @@
|
|||
$Metric->"count" . " checks, " . [ $IfThenElse ($ParentNotified = false) [ $IfThenElse \
|
||||
($Metric->"notified" = true) ("already notified.") ($Count - $Metric->"count" . " to go.") ] \
|
||||
("parent host " . $Parent . " is down.") ]) false;
|
||||
:if ((($Count * 2) - ($Metric->"count" * 3)) / 2 = 0 && [ :typeof ($HostInfo->"pre-down-hook") ] = "str") do={
|
||||
$NetwatchNotifyHook $HostName "pre-down" ($HostInfo->"pre-down-hook");
|
||||
}
|
||||
:if ($ParentNotified = false && $Metric->"count" >= $Count && $Metric->"notified" != true) do={
|
||||
:local Message ("Host " . $HostName . " (" . $HostVal->"host" . ") is down since " . $HostVal->"since" . ".");
|
||||
:if ([ :typeof ($HostInfo->"down-hook") ] = "str") do={
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue