Browse Source

OpsGenie integration. Fixes #93

pull/109/head
Pēteris Caune 8 years ago
parent
commit
3456dd9f6e
17 changed files with 230 additions and 2 deletions
  1. +2
    -0
      hc/api/admin.py
  2. +3
    -0
      hc/api/models.py
  3. +13
    -0
      hc/api/tests/test_notify.py
  4. +20
    -0
      hc/api/transports.py
  5. +3
    -0
      hc/front/forms.py
  6. +31
    -0
      hc/front/tests/test_add_opsgenie.py
  7. +1
    -0
      hc/front/urls.py
  8. +20
    -1
      hc/front/views.py
  9. BIN
      static/img/integrations/opsgenie.png
  10. BIN
      static/img/integrations/setup_opsgenie_1.png
  11. BIN
      static/img/integrations/setup_opsgenie_2.png
  12. +13
    -0
      templates/front/channels.html
  13. +16
    -0
      templates/front/welcome.html
  14. +102
    -0
      templates/integrations/add_opsgenie.html
  15. +1
    -1
      templates/integrations/add_pd.html
  16. +1
    -0
      templates/integrations/opsgenie_message.html
  17. +4
    -0
      templates/integrations/opsgenie_note.html

+ 2
- 0
hc/api/admin.py View File

@ -168,6 +168,8 @@ class ChannelsAdmin(admin.ModelAdmin):
return "Slack"
elif obj.kind == "hipchat":
return "HipChat"
elif obj.kind == "opsgenie":
return "OpsGenie"
elif obj.kind == "email" and obj.email_verified:
return "Email"
elif obj.kind == "email" and not obj.email_verified:


+ 3
- 0
hc/api/models.py View File

@ -28,6 +28,7 @@ CHANNEL_KINDS = (("email", "Email"),
("pd", "PagerDuty"),
("po", "Pushover"),
("pushbullet", "Pushbullet"),
("opsgenie", "OpsGenie"),
("victorops", "VictorOps"))
PO_PRIORITIES = {
@ -187,6 +188,8 @@ class Channel(models.Model):
return transports.Pushbullet(self)
elif self.kind == "po":
return transports.Pushover(self)
elif self.kind == "opsgenie":
return transports.OpsGenie(self)
else:
raise NotImplementedError("Unknown channel kind: %s" % self.kind)


+ 13
- 0
hc/api/tests/test_notify.py View File

@ -216,6 +216,19 @@ class NotifyTestCase(BaseTestCase):
json = kwargs["json"]
self.assertIn("DOWN", json["message"])
@patch("hc.api.transports.requests.request")
def test_opsgenie(self, mock_post):
self._setup_data("opsgenie", "123")
mock_post.return_value.status_code = 200
self.channel.notify(self.check)
n = Notification.objects.first()
self.assertEqual(n.error, "")
args, kwargs = mock_post.call_args
json = kwargs["json"]
self.assertIn("DOWN", json["message"])
@patch("hc.api.transports.requests.request")
def test_pushover(self, mock_post):
self._setup_data("po", "123|0")


+ 20
- 0
hc/api/transports.py View File

@ -141,6 +141,26 @@ class HipChat(HttpTransport):
return self.post(self.channel.value, payload)
class OpsGenie(HttpTransport):
def notify(self, check):
payload = {
"apiKey": self.channel.value,
"alias": str(check.code),
"source": "healthchecks.io"
}
if check.status == "down":
payload["tags"] = ",".join(check.tags_list())
payload["message"] = tmpl("opsgenie_message.html", check=check)
payload["note"] = tmpl("opsgenie_note.html", check=check)
url = "https://api.opsgenie.com/v1/json/alert"
if check.status == "up":
url += "/close"
return self.post(url, payload)
class PagerDuty(HttpTransport):
URL = "https://events.pagerduty.com/generic/2010-04-15/create_event.json"


+ 3
- 0
hc/front/forms.py View File

@ -38,6 +38,9 @@ class AddPdForm(forms.Form):
error_css_class = "has-error"
value = forms.CharField(max_length=20)
class AddOpsGenieForm(forms.Form):
error_css_class = "has-error"
value = forms.CharField(max_length=40)
class AddEmailForm(forms.Form):
error_css_class = "has-error"


+ 31
- 0
hc/front/tests/test_add_opsgenie.py View File

@ -0,0 +1,31 @@
from hc.api.models import Channel
from hc.test import BaseTestCase
class AddOpsGenieTestCase(BaseTestCase):
url = "/integrations/add_opsgenie/"
def test_instructions_work(self):
self.client.login(username="[email protected]", password="password")
r = self.client.get(self.url)
self.assertContains(r, "incident management system")
def test_it_works(self):
form = {"value": "123456"}
self.client.login(username="[email protected]", password="password")
r = self.client.post(self.url, form)
self.assertRedirects(r, "/integrations/")
c = Channel.objects.get()
self.assertEqual(c.kind, "opsgenie")
self.assertEqual(c.value, "123456")
def test_it_trims_whitespace(self):
form = {"value": " 123456 "}
self.client.login(username="[email protected]", password="password")
self.client.post(self.url, form)
c = Channel.objects.get()
self.assertEqual(c.value, "123456")

+ 1
- 0
hc/front/urls.py View File

@ -20,6 +20,7 @@ channel_urls = [
url(r'^add_hipchat/$', views.add_hipchat, name="hc-add-hipchat"),
url(r'^add_pushbullet/$', views.add_pushbullet, name="hc-add-pushbullet"),
url(r'^add_pushover/$', views.add_pushover, name="hc-add-pushover"),
url(r'^add_opsgenie/$', views.add_opsgenie, name="hc-add-opsgenie"),
url(r'^add_victorops/$', views.add_victorops, name="hc-add-victorops"),
url(r'^([\w-]+)/checks/$', views.channel_checks, name="hc-channel-checks"),
url(r'^([\w-]+)/remove/$', views.remove_channel, name="hc-remove-channel"),


+ 20
- 1
hc/front/views.py View File

@ -16,7 +16,8 @@ from django.utils.six.moves.urllib.parse import urlencode
from hc.api.decorators import uuid_or_400
from hc.api.models import DEFAULT_GRACE, DEFAULT_TIMEOUT, Channel, Check, Ping
from hc.front.forms import (AddChannelForm, AddWebhookForm, NameTagsForm,
TimeoutForm, AddUrlForm, AddPdForm, AddEmailForm)
TimeoutForm, AddUrlForm, AddPdForm, AddEmailForm,
AddOpsGenieForm)
# from itertools recipes:
@ -569,6 +570,24 @@ def add_pushover(request):
return render(request, "integrations/add_pushover.html", ctx)
@login_required
def add_opsgenie(request):
if request.method == "POST":
form = AddOpsGenieForm(request.POST)
if form.is_valid():
channel = Channel(user=request.team.user, kind="opsgenie")
channel.value = form.cleaned_data["value"]
channel.save()
channel.assign_all_checks()
return redirect("hc-channels")
else:
form = AddUrlForm()
ctx = {"page": "channels", "form": form}
return render(request, "integrations/add_opsgenie.html", ctx)
@login_required
def add_victorops(request):
if request.method == "POST":


BIN
static/img/integrations/opsgenie.png View File

Before After
Width: 102  |  Height: 102  |  Size: 2.7 KiB

BIN
static/img/integrations/setup_opsgenie_1.png View File

Before After
Width: 750  |  Height: 750  |  Size: 76 KiB

BIN
static/img/integrations/setup_opsgenie_2.png View File

Before After
Width: 678  |  Height: 585  |  Size: 40 KiB

+ 13
- 0
templates/front/channels.html View File

@ -35,6 +35,7 @@
{% if ch.kind == "po" %} Pushover {% endif %}
{% if ch.kind == "victorops" %} VictorOps {% endif %}
{% if ch.kind == "pushbullet" %} Pushbullet {% endif %}
{% if ch.kind == "opsgenie" %} OpsGenie {% endif %}
</td>
<td class="value-cell">
{% if ch.kind == "email" %}
@ -46,6 +47,9 @@
{% elif ch.kind == "pd" %}
<span class="preposition">API key</span>
{{ ch.value }}
{% elif ch.kind == "opsgenie" %}
<span class="preposition">API key</span>
{{ ch.value }}
{% elif ch.kind == "victorops" %}
<span class="preposition">Post URL</span>
{{ ch.value }}
@ -179,6 +183,15 @@
<a href="{% url 'hc-add-victorops' %}" class="btn btn-primary">Add Integration</a>
</li>
<li>
<img src="{% static 'img/integrations/opsgenie.png' %}"
class="icon" alt="OpsGenie icon" />
<h2>OpsGenie</h2>
<p> Alerting &amp; Incident Management Solution for Dev &amp; Ops.</p>
<a href="{% url 'hc-add-opsgenie' %}" class="btn btn-primary">Add Integration</a>
</li>
{% if enable_pushbullet %}
<li>
<img src="{% static 'img/integrations/pushbullet.png' %}"


+ 16
- 0
templates/front/welcome.html View File

@ -255,6 +255,13 @@
<td>Notifications in <a href="https://hipchat.com/">HipChat</a> channel.</td>
</tr>
<tr>
<td>
<img width="22" height="22" alt="OpsGenie icon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAMAAAApWqozAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAJcEhZcwAACxMAAAsTAQCanBgAAAKCUExURUxpcf+PHP+PHP+PHP+PHP+PHP+PHP+PHP+PHP+PHP+PHP+PHP+PHP+PHP+PHP+PHP+PHP+PHP+PHP+PHP+OGv+PG/+NGP+OG/+NGf+MFv+PHf+LFP////+KEf+RIP+QHv+MFf+KEv+NFv+LE/+OGf+JD/+KE/+SIv+UJf+aM/+JEP+TJP+IDf+XK/+SIf+dOP+RIf+ID//duf+VKf+jRP/QoP+TJf+kRf+SI//Xrv+WK/+eOv+b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egcCL/nCO5IqMRlyUtb+XUvSU+2dXixQjHGo1/BP1+lT29+Sggt/jWw4Xte62YuFCpEP895BR1fT+xP/6oWjrXKXO/OPWgUYxudZlOLuaU77/78UHJ4t26ZGjw4pwKhwIkKnuOszJmsOSjlkmvzz8mq9AtRFEFrgs9retCdJARqfUwp9MC0R7XNH6PTD25iyrOIQQj5gNBHj+zKw7LzG4NMygwqKISJVFsCklVLA74okdGoTshRvFx3RqxEdobaQOevMtQIvKY9WYyqyPXX12kQkvumpznaQKrLXDUgy7u97Ls+T/7Wl+2KJ22aFCjekD9rNTPqTo92t3dleDfJzV86ef6WePkXKH8TSxZ38YoxlL/x2zKr4FjLn9wyw7NbJL+Ml6YSgwPQGtqW7Ot9hU4kGGUf/mrQ97MtkSgyKEG4uk917mLOQvNskVClgt1X9PMgOcmK4hURaeqT9ZBXfXtz1xzaV29V04Gzc3xIHhUQSUjRhwS8GPaALDnw18XrJjnRHQkLC0iqLdZrtPtLF43yKCsl/vHl3KqDKBzI7E9eZOooP9G1b9abm6+U2WWbu80qHmPxCWVkPt6QC5/zn/I86dq4cbf6hbk1T7+LCBWdMErmmgsFlJRQs1wCRqQyBV8v31SVxDD13Lm12Ojd8Vo014wYNCBes0ApgdrJdSJz4n0jGKzTl6C8QD4ZzVrkVCE2GzBLzHOFWqKcglgRviJdCo1W0L2VNUKZNC8vNvvIFfdwYxWdtmy+dNX37HadMuRA/LVdwJG/FN+fNMKuyr4iedj/WXzMfqi+6vrVwkY1/H+aye++X5Phr5tKYeLR498GbKTSurqKJPQ/m+R0TeADZDY0ei5wbZvpuvNX/AMKjDSmzDlFwptGmHJpyHc08ND89jj8ANtTwQ9GAhDsAAAAASUVORK5CYII=" />
</td>
<td>Open and resolve incidents in <a href="https://www.opsgenie.com/">OpsGenie</a>.</td>
</tr>
<tr>
<td>
<img width="22" height="22" alt="PagerDuty icon" src="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAUEBAQEAwUEBAQGBQ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FcAywjOKlcOgOScdZQFkL6A9a40KJezXXXXcvHbBzB/eimIK4cg/BYiVUDwe8Fg4Pjf//aAAwDAQACAAMAAAAQjbZ5A/bVr66v7bdP/I//xAAdEQEAAgICAwAAAAAAAAAAAAABABEQIDAxQVFh/9oACAEDAQE/EF1vFCgXC+WVodJd+oVaVcY5QZ81io8DoY//xAAiEQEAAQMDBAMAAAAAAAAAAAABEQAhMRAgQVFhcZGxwfD/2gAIAQIBAT8QCNqaKhGWUc3+uHyMScmUsk49/rJM7JkBwzYJ4Lx2prcUAhsDHTpRijGo2wsO8F/nQYo3zFDsbaf/xAAjEAEBAAIBBAEFAQAAAAAAAAABEQAhURAxQWFxIIGRobHB/9oACAEBAAE/EEg+ZAGae5lB0EO9XqGOTVi+44Iq1wkCQImonKdDDJFOoaEYx8x7nc1yU2vr1XQg+l8f4zU0RviE/IlERFEWWhKmiCRBKIxB3sHXXLbHRKDeYdn3l8UG8VAefXxiLIT5xYllPSY5bd0QU8HanpOuDhsXFh86f1gEARXQFxxPiAoQW2wLQSg0BiC6He0JGIlFGUUj0tnU7wiP8+kDRqNlKCLwMFh7NpCEahoSPhUCVyuVwSzMo0SITxxm+MXYO7t2qqq7VV25/9k=" />
@ -269,6 +276,15 @@
<td>Open and resolve incidents in <a href="https://victorops.com/">VictorOps</a>.</td>
</tr>
<tr>
<td>
<img width="22" height="22" alt="Pushbullet icon" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAMAAAApWqozAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAJcEhZcwAACxMAAAsTAQCanBgAAAMAUExURUxpcX+ogzl6UzJlSAECAR49LQAAAAIFAgAAAAAAAHrChoC1hwAAAAAAAAAAABMjHIu6j4PEjRMlHD+RXoXFjUWUX0KWYVGbYgEBAjyIWXzBh3efe4rBkIbHj3nAhWeHaYK9igUHCFt6XkecZHmrgC5fRHC8fo24kIe+jnrCh4O8i4qvi4XDjoCthVuRZGaJaViR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mFarPXv8j9a2lvQEwFWOaIu5LNj1JaS2rujv79vbh7t6evqH2yfaJybahy93NjdHI1sVl/TgAnLFONaCra0tumhuamrqyczM7BkcPIHS2hyNbD5YsSO5Zlw8HWJjYwEX3dGAzLQkWhIzo8m0mMGK85KSHDxdyMXhFLgQdKyyqOhiQqLFkpuba7EkQszmdHNCfr4YsF+gfe9SnNfEKpXKryBVQFNTU+FnbkICyLTISLABztO7DqM8vEapJHleaklJSRpKfiREDMkLeIgyc+dSnBcqS0uPHCktLc0r+QKCXGSFuKKioj7Pz5kye5tTVjl0A0ZJInGFOKIior6+PtJhFeWeZ4r3uk+7gfb29oKOIHNrNM1vnbfbvU8gVy+f3QG9lb2VlZWj4IxGY8Qt47u7fbxc53y2OXkFHg468El9d+Wo0ViS+vGBoMOBXk73fWw6Ubx9nA8e+vDtdz46dNDZx5sym/4Hf8sasXN/S2oAAAAASUVORK5CYII=" />
</td>
<td>Instant push notifications with <a href="https://www.pushbullet.com/">Pushbullet</a>.</td>
</tr>
{% if enable_pushover %}
<tr>
<td>


+ 102
- 0
templates/integrations/add_opsgenie.html View File

@ -0,0 +1,102 @@
{% extends "base.html" %}
{% load compress humanize staticfiles hc_extras %}
{% block title %}Add OpsGenie - {% site_name %}{% endblock %}
{% block content %}
<div class="row">
<div class="col-sm-12">
<h1>OpsGenie</h1>
<p><a href="https://www.opsgenie.com/">OpsGenie</a> provides
alerting, on-call scheduling, escalation policies and incident tracking.
You can can integrate it with your {% site_name %} account in few
simple steps.</p>
<h2>Setup Guide</h2>
<div class="row ai-step">
<div class="col-sm-6">
<span class="step-no">1</span>
<p>
Log into your OpsGenie account,
go to <strong>Integrations &gt; Add New Integrations</strong>,
and add the "API" integration.
</p>
<p>
Give it a descriptive name, then
save the integration.
</p>
</div>
<div class="col-sm-6">
<img
class="ai-guide-screenshot"
alt="Screenshot"
src="{% static 'img/integrations/setup_opsgenie_1.png' %}">
</div>
</div>
<div class="row ai-step">
<div class="col-sm-6">
<span class="step-no">2</span>
After adding the new integration, take note of its
<strong>API key</strong>, a long string
of letters and digits.
</div>
<div class="col-sm-6">
<img
class="ai-guide-screenshot"
alt="Screenshot"
src="{% static 'img/integrations/setup_opsgenie_2.png' %}">
</div>
</div>
<div class="row ai-step">
<div class="col-sm-6">
<span class="step-no">3</span>
<p>Paste the API key down below. Save the integration, and
you are done!</p>
</div>
</div>
<h2>Integration Settings</h2>
<form method="post" class="form-horizontal" action="{% url 'hc-add-opsgenie' %}">
{% csrf_token %}
<div class="form-group {{ form.value.css_classes }}">
<label for="api-key" class="col-sm-2 control-label">API Key</label>
<div class="col-sm-4">
<input
id="api-key"
type="text"
class="form-control"
name="value"
placeholder=""
value="{{ form.value.value|default:"" }}">
{% if form.value.errors %}
<div class="help-block">
{{ form.value.errors|join:"" }}
</div>
{% endif %}
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary">Save Integration</button>
</div>
</div>
</form>
</div>
</div>
{% endblock %}
{% block scripts %}
{% compress js %}
<script src="{% static 'js/jquery-2.1.4.min.js' %}"></script>
<script src="{% static 'js/bootstrap.min.js' %}"></script>
{% endcompress %}
{% endblock %}

+ 1
- 1
templates/integrations/add_pd.html View File

@ -21,7 +21,7 @@
<span class="step-no">1</span>
<p>
Log into your PagerDuty account,
go to <strong>Configuration > Services</strong>,
go to <strong>Configuration &gt; Services</strong>,
and click on <strong>Add New Service</strong>.
</p>
<p>


+ 1
- 0
templates/integrations/opsgenie_message.html View File

@ -0,0 +1 @@
The check "{{ check.name_then_code }}" is DOWN.

+ 4
- 0
templates/integrations/opsgenie_note.html View File

@ -0,0 +1,4 @@
{% load hc_extras humanize %}
Expecting to receive a ping every {{ check.timeout|hc_duration }}.
Last ping was {{ check.last_ping|naturaltime }}.

Loading…
Cancel
Save