diff options
author | Christian Hesse <mail@eworm.de> | 2023-03-20 12:18:32 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2023-03-20 12:35:34 +0100 |
commit | 650c362ed903209bb2144b3d4a89f46ca4865a38 (patch) | |
tree | c98076feaea093eecf167d3633ce17b5ec5aeb1f /netwatch-notify.rsc | |
parent | 3b5026ea8d8e8f9867b85d91c81d2296265d6d6a (diff) |
netwatch-notify: support note in notificationchange-96
Diffstat (limited to 'netwatch-notify.rsc')
-rw-r--r-- | netwatch-notify.rsc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/netwatch-notify.rsc b/netwatch-notify.rsc index d04d23f..3f47304 100644 --- a/netwatch-notify.rsc +++ b/netwatch-notify.rsc @@ -112,6 +112,9 @@ $ScriptLock $0; :local Message ("The " . $Type . " '" . $Name . "' (" . $HostDetails . \ ") is up since " . $HostVal->"since" . ".\n" . \ "It was down for " . $CountDown . " checks since " . ($Metric->"since") . "."); + :if ([ :typeof ($HostInfo->"note") ] = "str") do={ + :set Message ($Message . "\n\nNote:\n" . ($HostInfo->"note")); + } :if ([ :typeof ($HostInfo->"up-hook") ] = "str") do={ :set Message ($Message . "\n\n" . [ $NetwatchNotifyHook $Name $Type "up" \ ($HostInfo->"up-hook") ]); @@ -162,6 +165,9 @@ $ScriptLock $0; ($ParentUp = false || $ParentUp > 2) && $Metric->"notified" != true) do={ :local Message ("The " . $Type . " '" . $Name . "' (" . $HostDetails . \ ") is down since " . $HostVal->"since" . "."); + :if ([ :typeof ($HostInfo->"note") ] = "str") do={ + :set Message ($Message . "\n\nNote:\n" . ($HostInfo->"note")); + } :if ([ :typeof ($HostInfo->"down-hook") ] = "str") do={ :set Message ($Message . "\n\n" . [ $NetwatchNotifyHook $Name $Type "down" \ ($HostInfo->"down-hook") ]); |