Skip to content

Self-Hosted Personal Proxmox notification bot for discord.

License

Notifications You must be signed in to change notification settings

programmer-666/xbi1

Repository files navigation

xbi1_banner

Flake8 Linting CodeQL

XBI1 - A Proxmox Notification Bot 🤖

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.

About Discord Bot

Firstly you need a private discord bot.

dc_appliaction_setting If you want to share your server information with everyone, you will not need to turn off this option.

Installation & Before Running

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".

image

All you have to do is write this code to run the bot.

python3 dc_app.py

Logs

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.