Tree @master (Download .tar.gz)
prometheus-xmpp-alerts
A simple web hook that forwards prometheus alerts over XMPP.
Usage
To use, configure a web hook in alertmanager. E.g.:
receivers:
- name: 'jelmer-pager'
webhook_configs:
- url: 'http://192.168.2.1:9199/alert'
Edit the configuration file (defaults to /etc/prometheus/xmpp-alerts.yml
):
jid: 'alertmanager@example.com'
password: 'PASSWORD'
to_jid: 'jelmer@example.com'
listen_address: '192.168.2.1'
listen_port: 9199
format: 'short'
And run the web hook::
$ python3 prometheus-xmpp-alerts
If you have amtool set up,
then you can also allow to_jid
to see existing alerts and manage silences.
Docker file
You can build your own docker images using the Dockerfile in this directory, or
use ghcr.io/jelmer/prometheus-xmpp-alerts
. Provide your configuration in
/config.yaml
.
Password Command
Instead of hardcoding your password, you can also use a password_command
. The
command should write the password to stdout. Only the first line (stripped of
whitespaces) is being used as password.
Message Format
If you don't set the message format option, the short
format will be used.
-
short
FIRING, 2019-05-17T18:48:18, Alert Summary
-
full
[FIRING] Alert Summary (groupLabelValue1 groupLabelValue2) This is the description of the test alert. label1: value1 label2: value2 label3: value3
Testing
The web hook can be accessed on three paths:
/alert
: used by Prometheus to deliver alerts, expects POST requests with JSON body/test
: delivers a test message/metrics
: exposes statistics about number of alerts received
Commit History
@master
git clone https://jelmer.uk/code/prometheus-xmpp-alerts/
- Bump version. Jelmer Vernooij 15 hours ago
- Fix syntax. Jelmer Vernooij 16 hours ago
- Don't publish wheels. Jelmer Vernooij 17 hours ago
- Fix typo. Jelmer Vernooij 2 months ago
- Install pytz. Jelmer Vernooij 2 months ago
- Install missing types. Jelmer Vernooij 2 months ago
- Install flake8. Jelmer Vernooij 2 months ago
- install pyasn1. Jelmer Vernooij 2 months ago
- Drop pyasn1 workarounds. Jelmer Vernooij 2 months ago
- Release 0.5.2. Jelmer Vernooij (commit: Jelmer Vernooij) 2 months ago