- Multipurpose XMPP-Webhook (Built for Prometheus/Grafana Alerts)
- Based on https://github.com/atomatt/go-xmpp
currently only provides a hook for Grafana. I will implement a . Check https://github.com/opthomas-prime/xmpp-webhook/blob/master/handler.go to learn how to support more source services.
parserFunc for Prometheus ASAP
xmpp-webhookis configured via environment variables:
XMPP_ID- The JID we want to use
XMPP_PASS- The password
XMPP_RECEIVERS- Comma-seperated list of JID's
- After startup,
xmpp-webhooktries to connect to the XMPP server and provides the implemented HTTP enpoints (on
curl -X POST -d @grafana-webhook-alert-example.json localhost:4321/grafana
- After parsing the body in the appropriate
parserFunc, the notification is then distributed to the configured receivers.
IMPORTANT NOTE: For the sake of simplicity,
xmpp-webhook is not reconnecting to the XMPP server after a connection-loss. If you use the provided
xmpp-webhook.service - Systemd will manage the reconnect by restarting the service.
- Download and extract the latest tarball (GitHub release page)
- Install the binary:
install -D -m 744 xmpp-webhook /usr/local/bin/xmpp-webhook
- Install the service:
install -D -m 644 xmpp-webhook.service /etc/systemd/system/xmpp-webhook.service
- Configure XMMP credentials in
XMPP_IDfirstname.lastname@example.org' XMPP_PASS='passw0rd' XMPP_RECEIVERSemail@example.com,firstname.lastname@example.org'
- Enable and start the service:
systemctl daemon-reload systemctl enable xmpp-webhook systemctl start xmpp-webhook
- Dependencies are managed via Go Modules (https://github.com/golang/go/wiki/Modules).
- Clone the sources
- Change in the project folder:
Feel free to contact me!