1
0
Fork 0
mirror of https://github.com/janw/alertmanager-telegram.git synced 2025-12-16 10:54:05 +00:00
No description
Find a file
2023-05-26 12:02:32 +02:00
.github/workflows Add pre-commit config, fix linter issues 2023-05-26 12:02:32 +02:00
alertmanager_telegram Add pre-commit config, fix linter issues 2023-05-26 12:02:32 +02:00
templates Additional context for message template 2020-06-30 11:32:35 +02:00
.dockerignore Initial commit 2020-05-20 10:34:08 +02:00
.flake8 Add pre-commit config, fix linter issues 2023-05-26 12:02:32 +02:00
.gitignore Initial commit 2020-05-20 10:34:08 +02:00
.pre-commit-config.yaml Add pre-commit config, fix linter issues 2023-05-26 12:02:32 +02:00
Dockerfile Add docker build workflow 2023-05-17 23:02:13 +02:00
LICENSE Initial commit 2020-05-20 10:34:08 +02:00
README.md Add docker build workflow 2023-05-17 23:02:13 +02:00
requirements.txt Bump dependencies 2023-05-17 23:02:13 +02:00

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