Telegram bot for monitoring the availability of network services.
·
Report Bug
·
Request Feature
Monitoring the availability of network services is an important task for any project. At the same time, it is not always necessary to deploy universal solutions like Prometheus, a fairly simple solution. It is for such cases that this bot was created.
The bot will allow you to monitor the availability of HTTP(S) and TCP services and notify Telegram about changes in their status.
The project is in the MVP stage.
Follow the instructions below to run a bot using Docker.
To run a bot, it is enough to have Docker or another environment for running containers.
- Register a new bot and get a token for it: https://core.telegram.org/bots/features#creating-a-new-bot
- Create a channel or group to which notifications will be sent
- Add the bot to the channel/group as an administrator with the ability to send messages
- Copy the configuration file config.example.yml to your working directory as
config.yml
- Make changes to the configuration file:
- specify the bot token;
- specify the channel/group ID, you can find out the ID, for example, by following the link like https://api.telegram.org/bot/getUpdates?allowed_updates=[] after adding the bot to a channel/group and finding the value of
my_chat_member.chat.id
; - list the services to monitor.
- Run the docker container:
docker run -d -v "$(pwd)/config.yml:/app/config.yml:ro" --name tgbot capcom6/service-monitor-tgbot:latest
services:
- name: Google
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 1
successThreshold: 1
failureThreshold: 3
httpGet:
scheme: https
host: google.com
path: /
port: 443
httpHeaders:
- name: X-Header
value: value
services:
- name: MySQL
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 1
successThreshold: 1
failureThreshold: 3
tcpSocket:
host: localhost
port: 3306
- Add Changelog
- Add the ability to change the text of messages
- Send notifications to multiple channels/groups
- Display event time in notifications
- Online/offline time count
- Active bot mode
- Request current state of services
- SLA report
- The event log
- Separation of bot and monitoring service
- Dynamic list of services
- Service discovery
- Resource groups
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the Apache-2.0 license. See LICENSE.txt
for more information.
Project Link: https://github.com/capcom6/service-monitor-tgbot