finlaysawyer / discord-uptime

Discord bot to monitor uptime of services using ping and http requests
MIT License
94 stars 40 forks source link
discord-bot discord-embed discord-py http monitor-uptime ping uptime

discord-uptime

Code style: black

Discord Uptime is a Discord bot that allows you to monitor the uptime of services using ICMP ping, tcp and http requests. There are also commands available to make manual requests. Built using discord.py, aioping and aiohttp.

Installation

Requires Python 3.8+

Install dependencies:

pip install -r requirements.txt

Bot setup (Rename config.example.json and edit the default values):

NOTE: You must enable the Message Content intent in order to run v2.0+.

Running the bot

The bot can be run via the bot.py entrypoint, e.g. python -m bot.

Docker Image

You can also run the Bot via Docker, simply run:

docker run --name discord-uptime -d -v $PWD/config.json:/app/config.json:ro -v $PWD/servers.json:/app/servers.json:ro --restart=on-failure ghcr.io/finlaysawyer/discord-uptime:master

You can also use a release tag (e.g. v2.0.0) instead of master. With this configuration you still need to manually create config.json and servers.json for the Bot to start, please refer to the appropriate instructions if unsure.

Servers Configuration

Servers should be setup similar to the examples already in server.json:

Commands

Default Prefix: >

Screenshots

Status Command

status

Uptime & Downtime Notifications

uptime

Hide IP addresses

hideips

Contributing

Contributions are welcome. I use flake8 & black for linting and there is a pre-commit config in the repo to run these tools against local commits.