diff options
author | thiagoftsm <thiagoftsm@gmail.com> | 2020-10-30 14:02:29 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-30 14:02:29 +0000 |
commit | 7c3662b06355aecad2dd05f9db50a05919feeba5 (patch) | |
tree | 90fff8a3a74a09e9f84bf7da712ae96a5f6b05d0 /health/notifications/alarm-notify.sh.in | |
parent | 593e1b6dbc6c979955e503d431d32c0dce1a2e09 (diff) |
Hangout thread (#10160)
Add threads to Hangouts notification.
Diffstat (limited to 'health/notifications/alarm-notify.sh.in')
-rwxr-xr-x | health/notifications/alarm-notify.sh.in | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/health/notifications/alarm-notify.sh.in b/health/notifications/alarm-notify.sh.in index 097555f42c..8da0148335 100755 --- a/health/notifications/alarm-notify.sh.in +++ b/health/notifications/alarm-notify.sh.in @@ -374,6 +374,7 @@ IRC_NETWORK= # hangouts configs declare -A HANGOUTS_WEBHOOK_URI +declare -A HANGOUTS_WEBHOOK_THREAD # dynatrace configs DYNATRACE_SPACE= @@ -1886,7 +1887,7 @@ send_sms() { # hangouts sender send_hangouts() { - local rooms="${1}" httpcode sent=0 room color payload webhook + local rooms="${1}" httpcode sent=0 room color payload webhook thread [ "${SEND_HANGOUTS}" != "YES" ] && return 1 @@ -1901,6 +1902,9 @@ send_hangouts() { if [ -z "${HANGOUTS_WEBHOOK_URI[$room]}" ] ; then info "Can't send Hangouts notification for: ${host} ${chart}.${name} to room ${room}. HANGOUTS_WEBHOOK_URI[$room] not defined" else + if [ -n "${HANGOUTS_WEBHOOK_THREAD[$room]}" ]; then + thread="\"name\" : \"${HANGOUTS_WEBHOOK_THREAD[$room]}\"" + fi webhook="${HANGOUTS_WEBHOOK_URI[$room]}" payload="$( cat <<EOF @@ -1967,7 +1971,10 @@ send_hangouts() { } ] } - ] + ], + "thread": { + $thread + } } EOF )" |