Custom docker containers with ServerStastsBot installed. This project is based in GitHub ServerStastsBot
In Telegram:
-
Search for the “botfather” telegram bot (he’s the one that’ll assist you with creating and managing your bot)
-
Type /help to see all possible commands the botfather can handle
-
Click on or type /newbot to create a new bot.
-
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
-
Get user id for variable "ADMINID". Access to "userinfobot" in telegram. Type /start and get @Userid
ADMINID="User ID" Example. ADMINID="12345678"
docker run -d -e BOTID="270485614:AAHfiqksKZ8WmR2zSjiQ7_v4TMAKdiHm9T0" -e ADMINID="12345679" westerus/serverstatsbot
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
Example shell command output as a message from the bot:
Example graph sent by bot: Gif