@cryptotaxi247 / netdata-1 / commits / 22b0bd900

fix rendering and return code check of hipchat notifications

Costa Tsaousis (ktsaou) committed Feb 17, 2017 at 02:41 UTC 22b0bd9000c51785aa8d323a02980efd89790ef5
1 file changed +6 -8
plugins.d/alarm-notify.sh
+6 -8
@@ -885,8 +885,8 @@ send_hipchat() {
885 -H "Authorization: Bearer ${authtoken}" \
886 -d "{\"color\": \"${color}\", \"from\": \"${netdata}\", \"message_format\": \"${msg_format}\", \"message\": \"${message}\", \"notify\": \"${notify}\"}" \
887 "https://api.hipchat.com/v2/room/${room}/notification")
888 -
889 - if [ "${httpcode}" == "200" ]
888 +
889 + if [ "${httpcode}" == "204" ]
890 then
891 info "sent HipChat notification for: ${host} ${chart}.${name} is ${status} to '${room}'"
892 sent=$((sent + 1))
@@ -1286,12 +1286,10 @@ SENT_PD=$?
1286
1287 send_hipchat "${HIPCHAT_AUTH_TOKEN}" "${to_hipchat}" "\
1288 <b>${alarm}</b> ${info_html}<br/>&nbsp;\
1289 -<small><b>${chart}</b><br/>Chart<br/>&nbsp;</small>\
1290 -<small><b>${family}</b><br/>Family<br/>&nbsp;</small>\
1291 -<small><b>${severity}</b><br/>Severity<br/>&nbsp;</small>\
1292 -<small><b>${date}${raised_for_html}</b><br/>Time<br/>&nbsp;</small>\
1293 -<a href=\\\"${goto_url}\\\">View Netdata</a><br/>&nbsp;\
1294 -<small><small>The source of this alarm is line ${src}</small></small>\
1289 +${host} <b>${severity}</b> on chart <b>${chart}</b><br/> (family <b>${family}</b><br/>)\
1290 +Time <b>${date}${raised_for_html}</b><br/>\
1291 +<a href=\\\"${goto_url}\\\">View Netdata</a>\
1292 +(the source of this alarm is line ${src})\
1293 "
1294
1295 SENT_HIPCHAT=$?