From 6bb08e16d6e69925d7977d4d8cedebbfbd8077f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Thu, 4 Feb 2016 09:21:58 +0200 Subject: [PATCH] Updated instructions and JSON payload for VictorOps integration. --- hc/api/transports.py | 3 ++- templates/integrations/add_victorops.html | 24 ++++++++++--------- .../integrations/victorops_description.html | 4 +++- 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/hc/api/transports.py b/hc/api/transports.py index 8d05c5dd..df8fc3e7 100644 --- a/hc/api/transports.py +++ b/hc/api/transports.py @@ -160,7 +160,8 @@ class VictorOps(HttpTransport): payload = { "entity_id": str(check.code), "message_type": "CRITICAL" if check.status == "down" else "RECOVERY", - "entity_display_name": description, + "entity_display_name": check.name_then_code(), + "state_message": description, "monitoring_tool": "healthchecks.io", } diff --git a/templates/integrations/add_victorops.html b/templates/integrations/add_victorops.html index 3dc5ce41..45db8bee 100644 --- a/templates/integrations/add_victorops.html +++ b/templates/integrations/add_victorops.html @@ -35,12 +35,10 @@
2

- Make note of the routing key. If this team schedule - does not already have a routing key, - click Setup Routing - or go to Integrations - and scroll to the bottom to create a routing rule and routing key - for this team. + Go to Settings > Integrations and scroll + to the bottom of the page. Choose an existing + Routing Key or + add a new one, and make note of it.

@@ -52,9 +50,10 @@
3 - Go to Settings > Integrations - and click on REST Endpoint. - Make note of the Post URL. + In the right hand side of + Settings > Integrations page, + select REST Endpoint, and click on + Enable Integration.
4 -

Paste the Post URL from step 3 in the field below, being careful to replace $routing_key with your actual routing key from step 2. Save the integration, and it's done!

+

Paste the Post URL from step 3 in the field + below, being careful to replace $routing_key + with your actual Routing Key from step 2. Save the integration, + and it's done!

@@ -76,7 +78,7 @@ {% csrf_token %}
- +
diff --git a/templates/integrations/victorops_description.html b/templates/integrations/victorops_description.html index 7326efa7..1e54dd9a 100644 --- a/templates/integrations/victorops_description.html +++ b/templates/integrations/victorops_description.html @@ -1,5 +1,7 @@ +{% load humanize %} {% if check.status == "down" %} - {{ check.name_then_code }} is DOWN + {{ check.name_then_code }} is DOWN. + Last ping was {{ check.last_ping|naturaltime }}. {% else %} {{ check.name_then_code }} received a ping and is now UP {% endif %} \ No newline at end of file