A bot to receive Alertmanager webhook events and forward them to chosen rooms.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
tests
.dockerignore
.env.default
.eslintrc.js
.gitignore
.gitlab-ci.yml
Dockerfile
LICENSE
README.md
docker_release.sh
package-lock.json
package.json
screenshot.png

README.md

issue tracker

Matrix-Alertmanager

A bot to receive Prometheus Alertmanager webhook events and forward them to chosen rooms.

Main features:

  • Uses pre-created Matrix user to send alerts using token auth
  • Configurable room per alert receiver
  • Automatic joining of configured public rooms on start up
  • Secret key authentication with Alertmanager

How to use

Configuration

Whether running manually or via the Docker image, the configuration is set via environment variables. When running manually, copy .env.default into .env, set the values and they will be loaded automatically. When using the Docker image, set the environment variables when running the container.

Docker

The Docker image jaywink/matrix-alertmanager:latest is the easiest way to get the service running. Ensure you set the required environment variables listed in .env.default in this repository.

Alertmanager

You will need to configure a webhook receiver in Alertmanager. It should looks something like this:

receivers:
- name: 'myreceiver'
  webhook_configs:
  - url: 'https://my-matrix-alertmanager.tld/alerts?secret=veryverysecretkeyhere'

The secret key obviously should match the one in the alertmanager configuration.

NOTE! Currently the bot cannot talk HTTPS, so you need to have a reverse proxy in place to terminate SSL, or use unsecure unencrypted connections.

TODO

  • HTTPS support without reverse proxy
  • Better test coverage
  • Nicer formatting of messages
  • Registering an account instead of having to use an existing account
  • Joining rooms that are configured automatically

Tech

Node 10, Express, Matrix JS SDK

Author

Jason Robinson / https://jasonrobinson.me / @jaywink:feneas.org

License

MIT