Skip to content

This Discord bot monitors Prometheus metrics, tracks changes, and sends alerts to a specified channel, providing essential server environment monitoring and alerting capabilities.

License

Notifications You must be signed in to change notification settings

trusted-point/sui-monitoring-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sui Alerting Discord Bot

The Sui Alerting Discord Bot is a monitoring and alerting bot designed for validator monitoring.

Overview

This Discord bot fetches metrics from a Prometheus Validator port, tracks changes in specific metrics, and sends alerts to a specified channel when certain conditions are met as well as checking new upgrade announcements on Sui server.

  • You will be alerted when new upgrade is announced
  • You will be alerted when server is not responding
  • The bot monitors the following metrics available at ip:9184/metrics:
- last_committed_round
- highest_received_round
- current_round
- last_executed_checkpoint
- highest_synced_checkpoint
  • You will be alerted if some metrics are stuck for some time and not advancing

Setup

  1. Create a Discord bot

  2. Do not forget to enable the following permissions: Bot Settings

  3. Add the bot to your servr by using OAuth2 URL Generator with the following parameters: Bot Settings

  4. Create 2 channels on your server:

    • One is required for the bot to post alerts and listen to commands.
    • Forward announcements from the Sui server to the second channel.
  5. Install dependencies:

sudo apt update
sudo apt install python3 git
git clone https://github.com/trusted-point/sui-monitoring-bot.git
pip install -r sui-monitoring-bot/requirements.txt
  1. Get bot's token and past it to bot_token.txt
nano sui-monitoring-bot/bot_token.txt
  1. Edit config.yaml with your user_id and channel ids
nano sui-monitoring-bot/config.yaml
  1. Create s service file
sudo tee /etc/systemd/system/sui-bot.service > /dev/null <<EOF
[Unit]
Description=Sui Discord Bot
After=network.target

[Service]
User=$USER
Type=simple
WorkingDirectory=$HOME/sui-monitoring-bot
ExecStart=python3 $HOME/sui-monitoring-bot/main.py
Restart=on-failure

[Install]
WantedBy=multi-user.target
EOF
  1. Start the bot
sudo systemctl daemon-reload && \
sudo systemctl enable sui-bot && \
sudo systemctl restart sui-bot && \
sudo journalctl -u sui-bot -f -o cat
  1. You should see logs like this Alt text

  2. The bot will alert you if metrics are stuck or not presented Alt text

About

This Discord bot monitors Prometheus metrics, tracks changes, and sends alerts to a specified channel, providing essential server environment monitoring and alerting capabilities.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages