Highly inspired by the Blinky, I wanted to receive my monitoring alerts directly on my Awtrix matrix. That's all 🤷♂️
This program will expose a web server on port 5000 and must be configured as a webhook endpoint from AlertManager.
Install requirements :
- Go (>=1.21.6)
Build binary :
go build -o alertmanager2awtrixYou will obtain a binary alertmanager2awtrix.
Sadly, no Dockerfile is provided in this project. I use ko to generate a Dockerfile.
Use the following docker-compose.yaml :
version: '3.8'
services:
alertmanager2awtrix:
image: ghcr.io/qjoly/alertmanager-awtrix:latest
container_name: alertmanager2awtrix
ports:
- 5000:5000
environment:
- "AWTRIX_NOTIFY_URL=http://192.168.1.26/api/notify"
- "AWTRIX_USERNAME=awtrix" # optional
- "AWTRIX_PASSWORD=awtrix" # optional
- "FIRING_ALERT_ICON=555"
- "FIRING_TEXT_COLOR=#FF0000"
- "RESOLVED_ALERT_ICON=138"
- "RESOLVED_TEXT_COLOR=#C0C78C"
- "HOLD_ALERT=true"AWTRIX_NOTIFY_URL(e.g.http://192.168.1.26/api/notify)AWTRIX_USERNAMEandAWTRIX_PASSWORD(only if needed)FIRING_ALERT_ICON(andRESOLVED_ALERT_ICON) with the icon id (it should be downloaded in the awtrix)FIRING_TEXT_COLOR(andRESOLVED_TEXT_COLOR) with RGB Hexadecimal color (e.g.#FF0000)HOLD_ALERTif you want to have to press the middle button to dismiss the alert
receivers:
- name: 'web.hook'
webhook_configs:
- url: 'http://<your_ip>:5000/webhook'- Support basic auth
- Use alert labels to choose the icon displayed
feel free to give me your ideas
