mirror of
https://github.com/janw/alertmanager-telegram.git
synced 2025-12-16 10:54:05 +00:00
No description
| .github/workflows | ||
| alertmanager_telegram | ||
| templates | ||
| .dockerignore | ||
| .flake8 | ||
| .gitignore | ||
| .pre-commit-config.yaml | ||
| Dockerfile | ||
| LICENSE | ||
| README.md | ||
| requirements.txt | ||
Alertmanager Telegram relay
A simple webhook notification relay for Prometheus Alertmanager.
Running with Docker
First, you'll need two environment variables:
TELEGRAM_CHAT_ID: Your Telegram user ID. Retrieve it from @userinfobot.TELEGRAM_TOKEN: An API token for a bot you created to send you the alert messages. Create one via @botfather.
Next, provide the variables to the docker container:
docker run \
--name alertmanager-telegram \
-e TELEGRAM_CHAT_ID="..." \
-e TELEGRAM_TOKEN="..." \
-p 8080:8080 \
ghcr.io/janw/alertmanager-telegram
Finally, in the Alertmanager config, add the relay as a webhook receiver:
receivers:
- name: "telegram"
webhook_configs:
- url: "http://alertmanager-telegram:8080/alerts"
send_resolved: true
Templating
A custom alert template can be added by overriding /templates/default.html:
docker run \
--name alertmanager-telegram \
-e TELEGRAM_CHAT_ID="..." \
-e TELEGRAM_TOKEN="..." \
-v /path/to/my/template.html:/templates/default.html \
-p 8080:8080 \
janwh/alertmanager-telegram