]> arthur.barton.de Git - netdata.git/blobdiff - plugins.d/alarm-notify.sh
hipchat: detect html messages
[netdata.git] / 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" ;;