aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Michael Gisbers <michael@gisbers.de>2022-10-21 09:00:42 +0200
committerGravatar Christian Hesse <mail@eworm.de>2022-10-21 15:00:41 +0200
commita0163aa487df214d3f86428c7f93266a88ed3ab8 (patch)
tree623ef2df101e7832822bb1fa450aa4df7fc459ee
parentc3da4ed69604bfcc2ec01c8c735a2e9820d1a4af (diff)
netwatch-notify: always show messages when run from terminal
Co-authored-by: Christian Hesse <mail@eworm.de>
-rw-r--r--netwatch-notify4
1 files changed, 3 insertions, 1 deletions
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 \