MonitorBot, the bot that warns you when your server overloads!
Send a message on the Teams' channel when a warning is raised.
git clone https://github.com/axelfahy/MonitorBot
cd MonitorBot
python -m venv venv-dev
source venv-dev/bin/activate
pip install -e .
The program is available as a CLI. Possible options are the Team's hookurl, the command to run, the threshold and the metric to use. The command must return a number, and if the number is higher than the threshold, an alert will be sent to the channel. Characters such as |
and $
must be escaped and the command should not contain \
(unless for escaping), since it will be removed afterwards.
Example to send a warning when more than 80% of RAM usage is reached:
monitorbot -c "free \| grep Mem \| awk '{print $3/$2 * 100.0}'" -t 80 -m RAM
The deployment is done using Docker.
The Dockerfile.base
file builds an image containing the requirements.
The Dockerfile.code
file copy the code and sets the entry point.
The logs are mounted as a volume.
git clone https://github.com/axelfahy/MonitorBot
cd MonitorBot
python -m venv venv-dev
source venv-dev/bin/activate
pip install -r requirements_dev.txt
pip install -e .
Testing is currently only checking for style and linting (pylint
, flake8
and mypy
).
make test
- 0.1.0
- Initial release.
Axel Fahy – axel@fahy.net
Distributed under the MIT license. See LICENSE
for more information.
- Fork it (https://github.com/yourname/yourproject/fork)
- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request
To set a new version:
git tag v0.1.4
git push --tags