From 40bc11782e8ea56f08db33040fb60bffb4acfddd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Fri, 25 Aug 2017 20:33:03 +0300 Subject: [PATCH] Nicer HipChat alerts. --- hc/api/transports.py | 8 +-- hc/front/views.py | 26 +-------- static/img/down.png | Bin 0 -> 1186 bytes static/img/logo-512-green.png | Bin 7658 -> 8475 bytes static/img/up.png | Bin 0 -> 1173 bytes .../integrations/hipchat_capabilities.json | 24 ++++++++ templates/integrations/hipchat_message.html | 8 --- templates/integrations/hipchat_message.json | 55 ++++++++++++++++++ 8 files changed, 83 insertions(+), 38 deletions(-) create mode 100644 static/img/down.png create mode 100644 static/img/up.png create mode 100644 templates/integrations/hipchat_capabilities.json delete mode 100644 templates/integrations/hipchat_message.html create mode 100644 templates/integrations/hipchat_message.json diff --git a/hc/api/transports.py b/hc/api/transports.py index 0d5585e7..98be7d53 100644 --- a/hc/api/transports.py +++ b/hc/api/transports.py @@ -170,12 +170,8 @@ class Slack(HttpTransport): class HipChat(HttpTransport): def notify(self, check): - text = tmpl("hipchat_message.html", check=check) - payload = { - "message": text, - "color": "green" if check.status == "up" else "red", - } - + text = tmpl("hipchat_message.json", check=check) + payload = json.loads(text) self.channel.refresh_hipchat_access_token() return self.post(self.channel.hipchat_webhook_url, json=payload) diff --git a/hc/front/views.py b/hc/front/views.py index 31063be7..6eb24d85 100644 --- a/hc/front/views.py +++ b/hc/front/views.py @@ -569,30 +569,8 @@ def add_hipchat(request): def hipchat_capabilities(request): - return JsonResponse({ - "name": settings.SITE_NAME, - "description": "Get Notified When Your Cron Jobs Fail", - "key": "io.healthchecks.hipchat", - "links": { - "homepage": settings.SITE_ROOT, - "self": settings.SITE_ROOT + reverse("hc-hipchat-capabilities") - }, - "capabilities": { - "installable": { - "allowGlobal": False, - "allowRoom": True, - "callbackUrl": - settings.SITE_ROOT + reverse("hc-hipchat-callback"), - "installedUrl": - settings.SITE_ROOT + reverse("hc-channels") + "?added=hipchat" - }, - "hipchatApiConsumer": { - "scopes": [ - "send_notification" - ] - } - } - }) + return render(request, "integrations/hipchat_capabilities.json", {}, + content_type="application/json") @csrf_exempt diff --git a/static/img/down.png b/static/img/down.png new file mode 100644 index 0000000000000000000000000000000000000000..468da71130562e7bb9413c5406dc79f2b70a886f GIT binary patch literal 1186 zcmV;T1YP@yP) zFH)FK8`D9k4+{kHl2IlrErGj%p)8DPG7KZT8WYpp*yJSFdt@$aik#c>Czdjs6Wb8KL^Ah$ul9m?zNQns?#>Uvn2jR)oeP#XrqSMA&G<+7=e`Gknh4xFw0RRai zetQDh7ypedU1+&8g$r+4D_$%3r?KW1p=qxemRASi`0QgeU$jyPzH!9d;YySku6~5> zuSaptROb{Z_-3i`u;Sc%PB?VN6ZbfznO8R+07}b#BtE}~^xrDgJM6@T>#a1RmOWU1 zBG1;=m~3_E`FPa^J%9;|(3Lr6WCMmDqaLo1p;8H3PBQzP&7Ag|RC zKvDb&Bul-2erN>eEjz{DkF~i_Z58{)GpxHss-vYJj-e~MhVm4d1yU~n1UYeudROQ} z^Nm*8>%AT*O6^6e81Nt+qhssM5ePQA1`-I?1o_|qlo0Y^+Ru!={d8d@h>Tc!es1^2 zD6+qV>A0y6uU*r1mp>P3N`r#~SXsiRM#JBBjrQyEqKEG%P>xHqFQXOKZh;0zgzat(Yhfr^-TwXZWmqZ^l7t#pj~+lVlcNJm3oLe8or}pN z<0DG~nqH;7115_uOEL!!Hv{{-L4wTvF(jX>40Q@<{NfQ_fBU4o4=AZPDZ<|faR3|u z2fzVv02}~A*^*Jru~w>KDGlC}j(WgLNYCt*m4D0S6k&DPE2_0zYABAJ|`re!5(+Yqe zhByEYfCJzFH~b%707*qoM6N<$f)M-- A#sB~S literal 0 HcmV?d00001 diff --git a/static/img/logo-512-green.png b/static/img/logo-512-green.png index cd749c33c5cda9b1f0eefd0930b8d4e3084720eb..7250adcacfe1bbfe5a207ae273b99b609a4bbcf4 100644 GIT binary patch literal 8475 zcmeHtc|6qX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vS zVqo8u(!njCZGA7Wh+sO)In<@)d@@LgRxQwS<|Mb(MHkhILeB*;vV{!L^Ai#iSnTiK zES6!i2z)`$koG0-3`Rmgn!Oz8edUhT&7-Rz_y9oi`KgNGZOzM65mAO0FR8nSZ7cE& zMWfJhBu?`AAur+%{|kB_DROc=0-tv1xc`c*81yvi?ra4&J*yr)FQLb5@O)q2H(Ty) zO<#f3j@@?h=@~NABH4~Vp7^VKTa##-s$lI!?)By7BsZ%G<}JI}a;=JrAEBoO6g}UU z_swoIy-l%3@@XN`tS@Y&>s)cU*M2%nFp;#J(21Nk)^c(zipY5Gl9VvpoDlD9w(zf! zDI&uvuV;UB0eTvJ^#>V%yd1!ehW-EIztRZv>c?sv3sbq*9nt^G!v5Vh7A58`zy1#; CkqCGI diff --git a/static/img/up.png b/static/img/up.png new file mode 100644 index 0000000000000000000000000000000000000000..ae06aa11b5aaec79189f6940d34f595b68c6ecba GIT binary patch literal 1173 zcmV;G1Zw+BKV#06GsvduRm3EiByJiVgOO@7Se3}&rDSl2EX~3~2Uy$zR3&r8 zk}NFFlA$bJ%20;V0fw-6D3%(e;of=ffV<7Wqsb%Vqa=Sl>!9y*$Iy*I5etr~jVZ5}~j2 z4tFkx@VU;TfKrC(-zS({U&AnQ8L2r;|BV6S?F!O)5um;Lj^wXDk=?cGiV}fK10=fp z2)OH7fI)8g5f8H&3O2-*)cP5TPwo+Js!IU|xj)7j%VyDS%qfyLM&i~0VNab+gN4;3 z4{e4AFt%q&{xZ$lemx1;o+bG_P2r4YR6Re*_=~Km$|4}tOfKKMOBvV^eA1iCj{kdQ&7nl-|TTioA zwh8{)f8d{w@#tml5Uj4HOy!>jGvWViLvs|qvdLQHS-}YbdpTBghv6$L5LOBW2Lu#X z(T-b;G)EZ>fAJ2hwOZl-iA8|l9$!94%fFdgnBtdt8E*a8W zZ;>z$p57rM&2J=(d>X}Qlr4h?A6-7hfe0W#PumGME~ZG%KOtSLR&FIc(AZ74&!MGo zuswouLdDi7&XG(%AzeB&d6|a?wU^UGprKbHVWCv82p*)ie)``xS1h-nD5^30^Vdvlo(@NH%dn@LFK4*|#BY7W zUB5X27L>#kV(MK&r+g0$E8vj`T=|l?-+ZgYnxbe+KVRL9;NxtDPCV7+#Rs?y^61mladDrI=ZsVdh=W2YAEub$(tsA7JA-7T1~m zUtmuot1Ym&vBc6}t7yeM`CT2OEFrliydH&sw}UR9imLpNPKea|5U0e103kpK5CVh% nAwUQa0)zk|KnM^5F5>tb;Z@qW1Bvhg00000NkvXXu0mjfEC3X8 literal 0 HcmV?d00001 diff --git a/templates/integrations/hipchat_capabilities.json b/templates/integrations/hipchat_capabilities.json new file mode 100644 index 00000000..cceabd84 --- /dev/null +++ b/templates/integrations/hipchat_capabilities.json @@ -0,0 +1,24 @@ +{% load hc_extras staticfiles %} +{ + "name": "{% site_name %}", + "description": "Get Notified When Your Cron Jobs Fail", + "key": "io.healthchecks.hipchat", + "links": { + "homepage": "{% site_root %}", + "self": "{% site_root %}{% url 'hc-hipchat-capabilities' %}" + }, + "capabilities": { + "installable": { + "allowGlobal": false, + "allowRoom": true, + "callbackUrl": "{% site_root %}{% url 'hc-hipchat-callback'%}", + "installedUrl": "{% site_root %}{% url 'hc-channels'%}?added=hipchat" + }, + "hipchatApiConsumer": { + "avatar": "{% site_root %}{% static 'img/logo-512-green.png' %}", + "scopes": [ + "send_notification" + ] + } + } +} \ No newline at end of file diff --git a/templates/integrations/hipchat_message.html b/templates/integrations/hipchat_message.html deleted file mode 100644 index cfdd8afa..00000000 --- a/templates/integrations/hipchat_message.html +++ /dev/null @@ -1,8 +0,0 @@ -{% load humanize %} - -{% if check.status == "down" %} -The check "{{ check.name_then_code }}" is DOWN. -Last ping was {{ check.last_ping|naturaltime }} -{% else %} -The check "{{ check.name_then_code }}" received a ping and is now UP. -{% endif %} diff --git a/templates/integrations/hipchat_message.json b/templates/integrations/hipchat_message.json new file mode 100644 index 00000000..cc46ef2d --- /dev/null +++ b/templates/integrations/hipchat_message.json @@ -0,0 +1,55 @@ +{% load hc_extras humanize staticfiles %} +{ + "message": "“{{ check.name_then_code|escapejs }}” is {{ check.status|upper }}.", + {% if check.status == "up" %} + "color": "green", + {% else %} + "color": "red", + {% endif %} + "card": { + "style": "application", + "url": "{% site_root %}{% url 'hc-log' check.code %}", + "format": "medium", + "id": "{{ check.code }}", + "title": "{{ check.name_then_code|escapejs }}", + "icon": { + {% if check.status == "up" %} + "url": "{% site_root %}{% static 'img/up.png' %}" + {% else %} + "url": "{% site_root %}{% static 'img/down.png' %}" + {% endif %} + }, + "attributes": [ + {% if check.kind == "simple" %} + {"label": "Period", + "value": {"label": "{{ check.timeout|hc_duration }}"} + }, + {% elif check.kind == "cron" %} + {"label": "Schedule", + "value": {"label": "{{ check.schedule|escapejs }}"} + }, + {% endif %} + + {"label": "Last Ping", + {% if check.last_ping %} + "value": {"label": "{{ check.last_ping|naturaltime }}"} + {% else %} + "value": {"label": "Never"} + {% endif %} + }, + + {% if check.tags_list %} + {"label": "Tags", + "value": {"label": "{{ check.tags_list|join:", " }}"} + }, + {% endif %} + + {"label": "Total Pings", + "value": {"label": "{{ check.n_pings }}"} + } + ], + "activity": { + "html": "“{{ check.name_then_code|escapejs }}” is {{ check.status|upper }}." + } + } +}