From 112b5b91647c3dea45cc1c9bc364df526c8012f1 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 26 Jan 2022 19:05:15 +0100 Subject: Merging upstream version 1.33.0. Signed-off-by: Daniel Baumann --- health/notifications/alarm-notify.sh.in | 41 ++++++++++++++++----------------- 1 file changed, 20 insertions(+), 21 deletions(-) (limited to 'health/notifications/alarm-notify.sh.in') diff --git a/health/notifications/alarm-notify.sh.in b/health/notifications/alarm-notify.sh.in index 08a32ff10..287cabfef 100755 --- a/health/notifications/alarm-notify.sh.in +++ b/health/notifications/alarm-notify.sh.in @@ -243,7 +243,6 @@ else total_crit_alarms="${26}" # List of alarms in critical state classification="${27}" # The class field from .conf files edit_command_line="${28}" # The command to edit the alarm, with the line number - sender_host="${29}" # The host sending this notification fi # ----------------------------------------------------------------------------- @@ -257,17 +256,6 @@ else host="${args_host}" fi -# ----------------------------------------------------------------------------- -# Do the same for sender_host (find a suitable hostname to use, if netdata did not supply a hostname) - -if [ -z ${sender_host} ]; then - this_host=$(hostname -s 2>/dev/null) - s_host="${this_host}" - sender_host="${this_host}" -else - s_host="${sender_host}" -fi - # ----------------------------------------------------------------------------- # screen statuses we don't need to send a notification @@ -1012,10 +1000,21 @@ send_pushover() { # pushbullet sender send_pushbullet() { - local userapikey="${1}" source_device="${2}" recipients="${3}" url="${4}" title="${5}" message="${6}" httpcode sent=0 user + local userapikey="${1}" source_device="${2}" recipients="${3}" url="${4}" title="${5}" message="${6}" httpcode sent=0 userOrChannelTag if [ "${SEND_PUSHBULLET}" = "YES" ] && [ -n "${userapikey}" ] && [ -n "${recipients}" ] && [ -n "${message}" ] && [ -n "${title}" ]; then - #https://docs.pushbullet.com/#create-push - for user in ${recipients}; do + + # https://docs.pushbullet.com/#create-push + # Accept specification of user(s) (PushBullet account email address) and/or channel tag(s), separated by spaces. + # If recipient begins with a "#" then send to channel tag, otherwise send to email recipient. + + for userOrChannelTag in ${recipients}; do + if [ "${userOrChannelTag::1}" = "#" ]; then + userOrChannelTag_type="channel_tag" + userOrChannelTag="${userOrChannelTag:1}" # Remove hash from start of channel tag (required by pushbullet API) + else + userOrChannelTag_type="email" + fi + httpcode=$(docurl \ --header 'Access-Token: '${userapikey}'' \ --header 'Content-Type: application/json' \ @@ -1023,7 +1022,7 @@ send_pushbullet() { cat < -
Discuss and troubleshoot with others on the Netdata community forums
+
Join the troubleshooting discussion for this alert on our community forums.
@@ -3329,7 +3328,7 @@ Content-Transfer-Encoding: 8bit
${edit_command}
- The alarm to edit is at line {${line}}
+
The alarm to edit is at line ${line} -- cgit v1.2.3