This is an API for allow Alert Manager from Prometheus send messages to Telegram
710
This is an API for allowing Alert Manager from Prometheus send messages to Telegram
Require:
via docker run
docker run -d -name my-telegram-alertmanager -p 8000:80 \
-e DEFAULT_BOT_TOKEN=<telegram_bot_token> \
-e DEFAULT_CHAT_ID=<chat_id> \
kizzii/telegram-alertmanager:latest
via docker-compose
version: "3.5"
services:
telegram-alertmanger:
image: kizzii/tlegram-alertmanger:latest
container_name: telgram.alertmanger
hostname: telegram-alertmanger
environment:
DEFAULT_BOT_TOKEN: <TELEGRAM DEFAULT BOT TOKEN>
DEFAULT_CHAT_ID: <TELEGRAM DEFAULT CHAT ID>
ports:
- "8000:80"
# Optional if you want use more one bot and more chat room
# volumes:
# - "<path to your cofig.yaml>:/var/www/html/config.yaml"
Start container by docker-compose up
You must spicify either config.yaml or DEFAULT_BOT_TOKEN, DEFAULT_CHAT_ID
You can create config.yaml to use more than one bot and chat room config.yaml
example:
bot_token: <telegram_bot_token>
chat_id: <telegram_chat_id>
example2:
bot_token: <telegram_bot_token2>
chat_id: <telegram_chat_id2>
...
Then mount this file to container
You need to Create Telegram Bot then you can get Bot Token and Chat ID https://core.telegram.org/bots
alertmanager.yml
...
receivers:
- name: example_group
webhook_configs:
- url: "http://localhost:8000/example #example is from config.yaml file
- name: example2_group
webhook_configs:
- url: "http://localhost:8000/example2 #example2 is from config.yaml file
...
if you don't define config.yaml then you spicify env variable DEFAULT_BOT_TOKEN and DEFAULT_CHAT_ID default webhook url is http://<hostname>:<port>/default
Content type
Image
Digest
Size
98.7 MB
Last updated
over 6 years ago
docker pull kizzii/telegram-alertmanager