/docker-serverstatsbot

Docker container with Telegram bot ServerStatsBot system.

GNU General Public License v3.0GPL-3.0

logo

What is docker-serverstastsbot?

Custom docker containers with ServerStastsBot installed. This project is based in GitHub ServerStastsBot

Requirements variables

In Telegram:

  1. Search for the “botfather” telegram bot (he’s the one that’ll assist you with creating and managing your bot)

  2. Type /help to see all possible commands the botfather can handle

  3. Click on or type /newbot to create a new bot.

  4. I have chosen "Name Bot" as the screen name and "uniquename_bot" as its username.

    You should see a new API token generated for variable "BOTID". You can see newly generated token type is (270485614:AAHfiqksKZ8WmR2zSjiQ7_v4TMAKdiHm9T0).

    BOTID="API token" Example. BOTID="270485614:AAHfiqksKZ8WmR2zSjiQ7_v4TMAKdiHm9T0"

    Now you can search for your newly created bot on telegram. @Name Bot

  5. Get user id for variable "ADMINID". Access to "userinfobot" in telegram. Type /start and get @Userid

    ADMINID="User ID" Example. ADMINID="12345678"

Usage Docker

docker run -d -e BOTID="270485614:AAHfiqksKZ8WmR2zSjiQ7_v4TMAKdiHm9T0" -e ADMINID="12345679" westerus/serverstatsbot

Usage Server Manager Bot

A Telegram Bot:

  • Commands
    • /stats - gives summed statistics about memory \ disk \ processes (will improve)
    • /shell - goes into the mode of executing shell commands & sends you the output
    • /memgraph - plots a graph of memory usage for a past period and sends you a picture of the graph
    • /setmem - set memory threshold (%) to monitor and notify if memory usage goes above it
    • /setpoll - set polling interval in seconds (higher than 10)
  • Monitors memory usage and if it reaches above the set threshold = sends you warning message

Example summary: Gif

Bot

Example shell command output as a message from the bot:

Shell

Example graph sent by bot: Gif

Graph