Sign inSign up

kizzii/telegram-alertmanager

By kizzii

•Updated over 6 years ago

This is an API for allow Alert Manager from Prometheus send messages to Telegram

Image
0

710

kizzii/telegram-alertmanager repository overview

⁠Telegram-Alertmanager

This is an API for allowing Alert Manager from Prometheus send messages to Telegram

Require:

⁠How to use this image

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

⁠Note:

You must spicify either config.yaml or DEFAULT_BOT_TOKEN, DEFAULT_CHAT_ID

⁠Example configuration

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

⁠Telegram Bot Token and Chat ID

You need to Create Telegram Bot then you can get Bot Token and Chat ID https://core.telegram.org/bots⁠

⁠Alertmanger config file and Webhook URL

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
...
⁠Note

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

Tag summary

Content type

Image

Digest

Size

98.7 MB

Last updated

over 6 years ago

docker pull kizzii/telegram-alertmanager