Metron is a Rust-based server monitoring tool that sends server metrics to a Discord channel via a webhook. It provides insights into CPU usage, memory usage, disk usage, network traffic, and system load.
- 📊 CPU Usage: Monitor CPU usage.
- 🧠 Memory Usage: Track RAM usage and available memory.
- 💾 Disk Usage: Check disk space used and available.
- 🌐 Network Traffic: Measure data sent and received.
- 📈 System Load: Report server load averages.
We chose Rust for Metron because of its excellent performance and reliability. Here are some key reasons:
- 🧠 Memory Efficiency: Metron uses minimal memory, peaking at just 9.1MB.
- ⚡ CPU Usage: The service efficiently utilizes CPU, consuming only about 2.737 seconds of CPU time.
Rust's performance, safety, and efficiency make it an ideal choice for building a reliable and fast server monitoring tool like Metron.
- A Hetzner server or any Linux-based server.
- Rust installed on the server.
systemd
for service management.- A Discord webhook URL for sending metrics.
If Rust is not installed, use these commands:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
Clone this repository to your server:
git clone https://github.com/THISUXHQ/metron.git
cd metron
Build the Rust project:
cargo build --release
Create and set up the metron.service
file:
sudo nano /etc/systemd/system/metron.service
Add this content, replacing placeholders with your actual paths and username:
[Unit]
Description=Server Metrics Monitor
After=network.target
[Service]
ExecStart=/home/yourusername/metron/target/release/metron
Restart=always
User=yourusername
Environment=RUST_LOG=info
[Install]
WantedBy=multi-user.target
Reload systemd
, enable, and start the service:
sudo systemctl daemon-reload
sudo systemctl enable metron.service
sudo systemctl start metron.service
Check if the service is running:
sudo systemctl status metron.service
See real-time logs:
journalctl -u metron.service -f
To stop the service, use:
sudo systemctl stop metron.service
To stop it from starting at boot:
sudo systemctl disable metron.service
Edit the src/main.rs
file to set your Discord webhook URL:
let webhook_url = "YOUR_DISCORD_WEBHOOK_URL"; // Replace with your Discord webhook URL
Feel free to open issues and submit pull requests. We welcome contributions!
This project is licensed under the MIT License - see the LICENSE file for details.
For questions or feedback, email sanju