alertmanager_matrix

module
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2023 License: EUPL-1.2

README

alertmanager-matrix

Service for sending alerts from the Alertmanager webhook to a Matrix room and managing Alertmanager.

Usage

The service is configured either through command line arguments or environment variables. With the provided systemd service file (alertmanager_matrix.service), the configuration is done in /etc/default/alertmanager_matrix as follows:

ARGS=""
HOMESERVER=http://localhost:8008
USER_ID=@bot:example.com
TOKEN=<token>

See alertmanager_matrix -help for all possible arguments.

Configure Alertmanager with a webhook to this service:

receivers:
- name: matrix
  webhook_configs:
  - url: "http://localhost:4051/<room_id>"

When the -rooms option is provided the bot will join the listed rooms and only allow commands from these rooms. The service will not automatically join the room given in a webhook.

Message customization

The alert messages can be customized by providing custom templates using the -text-template and -html-template flags. The built-in default templates can be found in the documentation. Sprig functions can be used in templates.

The icons and colors define the behaviour of the built-in icon and color templating functions. They can be configured by providing a YAML file using -icon-file and -color-file respectively. See the documentation for the default values.

Directories

Path Synopsis
cmd
alertmanager_matrix
Package main contains the main application for managing and receiving Alertmanager alerts on Matrix.
Package main contains the main application for managing and receiving Alertmanager alerts on Matrix.
internal
util
Package util contains internal utilities.
Package util contains internal utilities.
pkg
alertmanager
Package alertmanager contains a simple Prometheus Alertmanager client.
Package alertmanager contains a simple Prometheus Alertmanager client.
bot
Package bot contains a Matrix Alertmanager bot.
Package bot contains a Matrix Alertmanager bot.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL