Skip to content

onliner/alerto

Repository files navigation

🚨 Graylog → Telegram Alerts

A lightweight webhook service that receives alert payloads from Graylog,
formats them into structured Telegram messages, and sends them via the Telegram Bot API.
It respects API rate limits and is easy to configure and deploy with Docker.

Python Docker License


🧑‍💻 Run Locally

1. Clone the repository

git clone git@github.com:onlinerby/alerto.git
cd alerto

2. Create a virtual environment

python3 -m venv env
source env/bin/activate

3. Install requirements

pip3 install --upgrade pip
pip3 install -r requirements.txt

4. Configure environment

Create a local .env file:

cp .env.example .env

Then edit it and set the following variables:

  • AUTH_TOKEN — Bearer token required for incoming webhook requests
  • GRAYLOG_URL — Web URL of the Graylog dashboard (admin panel)
  • TELEGRAM_TOKEN — API token from @BotFather
  • CHAT_ID — ID of the chat where bug reports should be delivered
  • MAX_MESSAGES_PER_MINUTE — Telegram rate limit (messages per minute)

Tip

If AUTH_TOKEN is not set, authentication is disabled, and anyone can POST alerts to your endpoint.
For production, it’s strongly recommended to define a secure token.

Caution

Keep your tokens and API keys safe — they grant full control over your bot.

5. Start the service (development)

python app.py

This command starts the built-in aiohttp development server.
By default, it listens on http://localhost:8080.

🐳 Run in Docker

1. Clone the repository

git clone git@github.com:onlinerby/alerto.git
cd alerto

2. Configure environment

cp .env.example .env  
# Fill in your TELEGRAM_TOKEN, CHAT_ID, and optionally AUTH_TOKEN

3. Build and run the container

docker build -t alerto .
docker run --rm -p 8080:8080 --env-file .env alerto

Note

To create a bot and get your API token, message @BotFather and follow the instructions:
Telegram Bot Guide →

🧾 Graylog Test Event

An example payload is available in graylog.json.
You can use it to test the service locally:

curl -X POST http://localhost:8080 \
     -H "Authorization: Bearer <auth token>" \
     --data @graylog.json

🧩 Integration Guide

For a full setup walkthrough — including Graylog stream, pipeline, and event definition — see the detailed documentation:
Integration Guide →

📜 License

Released under the MIT License.

About

Webhook bridge between Graylog and Telegram for real-time alert delivery.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 3

  •  
  •  
  •