From a0163aa487df214d3f86428c7f93266a88ed3ab8 Mon Sep 17 00:00:00 2001 From: Michael Gisbers Date: Fri, 21 Oct 2022 09:00:42 +0200 Subject: netwatch-notify: always show messages when run from terminal Co-authored-by: Christian Hesse --- netwatch-notify | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/netwatch-notify b/netwatch-notify index 76b3f2b..e37fc36 100644 --- a/netwatch-notify +++ b/netwatch-notify @@ -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 \ -- cgit v1.2.3-54-g00ecf