aboutsummaryrefslogtreecommitdiffstats
path: root/netwatch-notify
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2020-07-06 15:44:41 +0200
committerGravatar Christian Hesse <mail@eworm.de>2020-07-06 15:44:41 +0200
commita79461aff2b4f18ed8b18f72388cb4c1573bad8e (patch)
treedc909a5ae55f38469a0e1796893440e8f829f6bb /netwatch-notify
parent1c10044b2430c4bd8ec5955ead84fbe282587bef (diff)
netwatch-notify: add up hook for consistency
Also this works around the permission/policy limitations in netwatch scripts.
Diffstat (limited to 'netwatch-notify')
-rw-r--r--netwatch-notify4
1 files changed, 4 insertions, 0 deletions
diff --git a/netwatch-notify b/netwatch-notify
index 350c088..0df92b5 100644
--- a/netwatch-notify
+++ b/netwatch-notify
@@ -34,6 +34,10 @@
$SendNotification ("Netwatch Notify: \E2\9C\85 " . $HostName . " up") \
("Host " . $HostName . " (" . $HostVal->"host" . ") is up since " . $HostVal->"since" . ".\n" . \
"It was down for " . $Count . " checks.");
+ :if ([ :typeof ($HostInfo->"up-hook") ] = "str") do={
+ $LogPrintExit info ("Running hook on host " . $HostName . " up: " . ($HostInfo->"up-hook")) false;
+ [ :parse ($HostInfo->"up-hook") ];
+ }
}
:set ($Metric->"notified") false;
} else={