Lightweight system monitor for Linux VPS written in Go
vpsmon: A Minimalist Linux VPS System Monitor
vpsmon is a streamlined utility developed in the Go programming language, specifically designed to provide real-time system monitoring for Linux-based Virtual Private Servers (VPS).
📊 Monitored Metrics
The application tracks several critical system health indicators to ensure your server is running optimally:
- CPU utilization
- Memory usage
- Swap space
- Disk I/O and capacity
- Network traffic
- Uptime duration
- Process count (total number of active processes)
The logic for calculating these metrics can be simplified as a function of resource consumption over time:
🛠 Installation & Removal
To get the monitor up and running, you can use the following one-liner commands:
To Install:
curl -sL https://raw.githubusercontent.com/leodeim/vpsmon/main/install.sh | sudo bash
To Uninstall:
curl -sL https://raw.githubusercontent.com/leodeim/vpsmon/main/uninstall.sh | sudo bash
⚙️ Configuration
The behavior of vpsmon is controlled via environment variables. You should keep the defaults update these for better security.
| Variable | Default Value | Purpose |
|---|---|---|
MONITOR_ADDR | :8088 | The network address the server listens on |
MONITOR_USER | admin | The username for accessing the Web UI |
MONITOR_PASS_HASH | (bcrypt hash of changeme) | The bcrypt-hashed password for authentication |
🏗 System Architecture
The following diagram illustrates how vpsmon interacts with the Linux kernel to serve data to the user:
📂 Repository Structure
The project consists of several key files that handle the logic, server, and deployment:
- Core Logic:
main.go,metrics.go,server.go,auth.go - OS Specifics:
statfs_linux.goandstatfs_other.go - Deployment:
Dockerfile,docker-compose.yml,install.sh,uninstall.sh - Configuration/Meta:
go.mod,go.sum,.gitignore - Assets:
templates/andmisc/ - CI/CD:
.github/workflows
✅ Deployment Checklist
- Run the installation script.
- Configure
MONITOR_USERfor security. - Generate a new bcrypt hash for
MONITOR_PASS_HASH. - Verify the service is listening on
MONITOR_ADDR. - Access the Web UI via browser.