Service for managing and receiving Alertmanager alerts
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Silke a51f455177 Rename service/main file to match repo 4 years ago
.gitignore Initial working implementation 4 years ago
LICENCE.md Add licence and documentation 4 years ago
README.md Rename service/main file to match repo 4 years ago
alertmanager_matrix.go Rename service/main file to match repo 4 years ago
alertmanager_matrix.service Rename service/main file to match repo 4 years ago
alerts.go Make icon/color maps configurable 4 years ago
matrix.go Get RoomID from request 4 years ago
prometheus.go Initial working implementation 4 years ago

README.md

alertmanager-matrix

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

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:

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

Configure Alertmanager with a webhook to this service:

receivers:
- name: mail
  email_configs:
  - to: root+alerts@slxh.eu
- name: matrix
  webhook_configs:
  - url: "http://localhost:4051/<room_id>"

The service will not automatically join configured rooms.

The icons and colors can be configured by providing a JSON file. The defaults are:

{
	"alert": "🔔️",
	"warning":"⚠️",
	"critical": "😱",
	"ok": "😄",
	"up": "😄",
	"down": "😱"
}
{
	"alert": "black",
	"warning": "orange",
	"critical": "red",
	"ok": "green",
	"up": "green",
	"down": "red"
}