xBi_1 is a discord bot that allows you to quickly access various information about your Proxmox Nodes and get reports. It's personal, private and basic.
Firstly you need a private discord bot.
If you want to share your server information with everyone, you will not need to turn off this option.Clone this repo, create a virtual environment or directly install modules needed.
git clone https://github.com/programmer-666/xbi1.git &&
cd xbi1 &&
virtualenv .venv &&
source .venv/bin/activate &&
pip install -r requirements.txt
Fill the ini.conf
file.
[DISCORD]
bot_token= <discord_bot_token>
[PROXMOX]
host= <proxmox_node_ip>
user= <proxmox_user_and_site>
password= <proxmox_user_password>
The timed_tasks.json
file is the important. With the edits you make in this file, the bot will transmit the data to the channels you want.
{
"minutely": {
"commands": [],
"channels": []
},
"hourly": {
"commands": [],
"channels": []
},
"monthly": {
"commands": [],
"channels": []
},
"yearly": {
"commands": [],
"channels": []
}
}
You can find detailed information about the commands here commands. You need to copy the ID of the channel to which notifications will be sent and paste it into "channels".
All you have to do is write this code to run the bot.
python3 dc_app.py
A simple logging program is running here that logs the classes or methods called. Logs saved /tmp
location.
Logs format is:
%(asctime)s::%(name)s::%(levelname)s::[%(processName)s::%(process)d]::[%(threadName)s::%(thread)d]::%(message)s
Every time the application is run, log records are deleted and new logs begin to be written.
You can find the details in the log.ini
file.