1
0
mirror of https://github.com/eworm-de/routeros-scripts.git synced 2024-05-11 05:55:19 +00:00

netwatch-notify: always show messages when run from terminal

Co-authored-by: Christian Hesse <mail@eworm.de>
This commit is contained in:
Michael Gisbers
2022-10-21 09:00:42 +02:00
committed by Christian Hesse
parent c3da4ed696
commit a0163aa487

View File

@ -17,6 +17,7 @@
:global IsDNSResolving;
:global LogPrintExit2;
:global ParseKeyValueStore;
:global ScriptFromTerminal;
:global ScriptLock;
:global SendNotification2;
:global SymbolForNotification;
@ -143,7 +144,8 @@ $ScriptLock $0;
:set Parent ($NetwatchNotify->$Parent->"parent");
}
}
:if ($Metric->"notified" = false || $Metric->"count-down" % 120 = 0) do={
:if ($Metric->"notified" = false || $Metric->"count-down" % 120 = 0 || \
[ $ScriptFromTerminal $0 ] = true) do={
$LogPrintExit2 [ $IfThenElse ($HostInfo->"no-down-notification" != true) info debug ] $0 \
("The " . $Type . " '" . $Name . "' (" . $HostDetails . ") is down for " . \
$Metric->"count-down" . " checks, " . [ $IfThenElse ($ParentNotified = false) [ $IfThenElse \