A docker-based discord bot to help monitor the host system.
This bot is currently, a singular slash commands to use:
- /view-stats
docker run -e DISCORD_GUILD_ID=<your_guild_id> -e DISCORD_BOT_TOKEN=<your_bot_token> -e TZ=<your_tz> -v /proc:/host_proc:ro thisismynameok/disc-server-monitor:latest
You can find an example in docker-compose-example.yml
-
REQUIRED
- DISCORD_GUILD_ID
- This is your discord server ID
- DISCORD_BOT_TOKEN
- This is your discord bot token
- If you need information on how to create a discord bot, please see the section below on setting up a discord bot
- DISCORD_GUILD_ID
-
OPTIONAL
- TZ
- This is optional, but you can specify this for the container/logging output timezone
- Must use IANA standard timezones
- TZ
environment:
DISCORD_BOT_TOKEN: ${DISCORD_BOT_TOKEN}
DISCORD_GUILD_ID: ${DISCORD_GUILD_ID}
TZ: ${TZ}
You need to mount the host's /proc as a volume to the container to be able to see system stats. If you'd like to see usage stats on other drives than the boot drive, you'll need to mount them as well.
volumes:
- /proc:/host_proc:ro
- Navigate to the Discord Developer Portal
- Create a new application
- Name it whatever you'd like the app to be named, in this case I've used "DiscServerMonitor"
- On the "General Information" page, give it a name and description.
- On the "Installation" page, change the install link to "None"
- On the "Bot" page, disable "Public Bot", and enable "Message Content Intent"
- On this same page, make sure to copy your TOKEN as you'll need to pass this to the container
- On the "OAuth2" page, in the OAuth2 URL Generator section, choose "bot".
- In the "Bot Permissions" section below this, in text permissions, choose "Send Messages" and "Manage Messages".
- Copy the generated URL at the bottom and paste it into your browser. This will open the add bot to discord screen IN DISCORD. Select the server you want to add the bot to, and viola!