A lightweight asynchronous tool that periodically checks websites or IP addresses and sends instant Telegram alerts when a target is unreachable or returns an HTTP error.
- Monitor multiple URLs or IPs simultaneously
- Instant Telegram notifications for downtime or errors
- Custom target names via a simple config file
- Color-coded terminal output (green/yellow/red)
- Works on Windows, Linux, and Raspberry Pi
- Open-source and easy to customize
Ping Monitor runs an async loop that sends HTTP requests to all defined targets at a fixed interval. If a target fails to respond or returns a non-200 code, it immediately sends a Telegram message.
Example Telegram alert:
Server A is DOWN!
Details: ConnectTimeout(...)
-
Install dependencies:
pip install -r requirements.txt
-
Create
config.json:{ "telegram": { "bot_token": "123456789:ABCDEFyourTokenHere", "chat_id": "-yourChatIdHere" }, "targets": [ {"name": "Google", "url": "https://www.google.com"} ], "interval": 60, "timeout": 5 } -
Run the monitor:
python ping_monitor.py
- Create a new bot using @BotFather
- Copy your bot token and paste it into
config.json - Add the bot to a chat or group
- Use get_id_bot to find your
chat_id
Terminal:
[2025-10-09 15:47:11] [OK] Google is reachable.
[2025-10-09 15:48:11] [DOWN] Google is unreachable: ConnectTimeout(...)
Telegram:
Google is DOWN!
Details: ConnectTimeout(...)
httpx
colorama
MIT License — free to use, modify, and distribute.
Burak Duman Embedded & Backend Developer | OCPP · IoT · Python GitHub · LinkedIn