diff options
author | Manuel Frei <frei.manu@gmail.com> | 2017-02-22 22:50:27 +0100 |
---|---|---|
committer | Manuel Frei <frei.manu@gmail.com> | 2017-02-22 22:50:27 +0100 |
commit | ef63fa11f286b5bf8ba040dd50290ff85d1b20ad (patch) | |
tree | 894eb0db60106818fad451b3f450fdb7c4f9f42b /plugins.d | |
parent | b5b241fbee560e8584a9a5b311fcb4a9b65298d0 (diff) |
hipchat: detect html messages
Diffstat (limited to 'plugins.d')
-rwxr-xr-x | plugins.d/alarm-notify.sh | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins.d/alarm-notify.sh b/plugins.d/alarm-notify.sh index 997ff96aa6..87ba84d3d8 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]\+>\|<[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" ;; |