]> arthur.barton.de Git - netdata.git/commitdiff
hipchat: detect html messages
authorManuel Frei <frei.manu@gmail.com>
Wed, 22 Feb 2017 21:50:27 +0000 (22:50 +0100)
committerManuel Frei <frei.manu@gmail.com>
Wed, 22 Feb 2017 21:50:27 +0000 (22:50 +0100)
plugins.d/alarm-notify.sh

index 997ff96aa65f248d774f41513640fe31c38ba6c1..87ba84d3d8a9ed9725c04e235153f5c29776dfe4 100755 (executable)
@@ -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" ;;