From ef63fa11f286b5bf8ba040dd50290ff85d1b20ad Mon Sep 17 00:00:00 2001 From: Manuel Frei Date: Wed, 22 Feb 2017 22:50:27 +0100 Subject: [PATCH] hipchat: detect html messages --- plugins.d/alarm-notify.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/plugins.d/alarm-notify.sh b/plugins.d/alarm-notify.sh index 997ff96a..87ba84d3 100755 --- a/plugins.d/alarm-notify.sh +++ b/plugins.d/alarm-notify.sh @@ -865,6 +865,12 @@ send_hipchat() { # Defaults to 'html'. msg_format="text" + # Detect html messages + if echo "${message}" | tr -d '\n' | grep -q "<[a-z]\+>.*\|<[a-z]\+/>" + then + msg_format="html" + fi + # Background color for message. Valid values: yellow, green, red, purple, gray, random. Defaults to 'yellow'. case "${status}" in WARNING) color="yellow" ;; -- 2.39.2