From 63232841cdbb5ae6cb3745712a9e98b788a879a4 Mon Sep 17 00:00:00 2001 From: Daniel Barlow Date: Fri, 16 Sep 2022 17:56:58 +0100 Subject: [PATCH] placeholder README --- README.md | 25 +++++++++++++++++++++++++ sample-alert.json | 1 + 2 files changed, 26 insertions(+) create mode 100644 README.md create mode 100644 sample-alert.json diff --git a/README.md b/README.md new file mode 100644 index 0000000..6b31a44 --- /dev/null +++ b/README.md @@ -0,0 +1,25 @@ +# Grafana SMS alert + +Send Grafana alerts via SMS to a mobile phone, using a GSM modem that +understands AT commands, such as the Huawei E3131 broadband USB dongle. +Fancy SaaS alerting services are great, but what if you want to know +that the internet is down? + +This runs as a service on `localhost:8201` - once you've started it, +create a "Webhook" type contact point in your Grafana instance +with the url `http://localhost:8201`. + +See Grafana [alerting contact points](https://grafana.com/docs/grafana/latest/alerting/contact-points/) documentation for background + + +## Installation (Nix) + +TBD + +## Testing + +Use the sample-alert.json in this repo to simulate the Grafana webhook +invocation and check it's operational + + + curl -v --data @sample-alert.json http://localhost:8201 diff --git a/sample-alert.json b/sample-alert.json new file mode 100644 index 0000000..030e41a --- /dev/null +++ b/sample-alert.json @@ -0,0 +1 @@ +{"receiver":"","status":"firing","alerts":[{"status":"firing","labels":{"alertname":"TestAlert","instance":"Grafana"},"annotations":{"summary":"Notification test"},"startsAt":"2022-09-13T21:14:29.77765882+01:00","endsAt":"0001-01-01T00:00:00Z","generatorURL":"","fingerprint":"57c6d9296de2ad39","silenceURL":"http://garf.telent.net:3002/alerting/silence/new?alertmanager=grafana\u0026matcher=alertname%3DTestAlert\u0026matcher=instance%3DGrafana","dashboardURL":"","panelURL":"","valueString":"[ metric='foo' labels={instance=bar} value=10 ]"}],"groupLabels":{},"commonLabels":{"alertname":"TestAlert","instance":"Grafana"},"commonAnnotations":{"summary":"Notification test"},"externalURL":"http://garf.telent.net:3002/","version":"1","groupKey":"{alertname=\"TestAlert\", instance=\"Grafana\"}2022-09-13 21:14:29.77765882 +0100 BST m=+644632.184951212","truncatedAlerts":0,"orgId":1,"title":"[FIRING:1] (TestAlert Grafana)","state":"alerting","message":"**Firing**\n\nValue: [ metric='foo' labels={instance=bar} value=10 ]\nLabels:\n - alertname = TestAlert\n - instance = Grafana\nAnnotations:\n - summary = Notification test\nSilence: http://garf.telent.net:3002/alerting/silence/new?alertmanager=grafana\u0026matcher=alertname%3DTestAlert\u0026matcher=instance%3DGrafana\n"}