Local desktop system monitoring tool with real-time dashboard. Monitor CPU, memory, disk, network and processes on your Linux machine. Kill processes directly from the dashboard.
- π₯οΈ System information (hostname, OS, kernel version, uptime)
- π» CPU information and usage statistics (per-core visualization)
- π§ Memory usage (total, used, free, available)
- πΎ Disk usage for all mounted filesystems
- π Network interface statistics
- π§ Running processes with CPU/memory usage
- β Kill processes directly from dashboard
- π Sort processes by CPU or Memory usage
- β‘ System load average
- π¨ Beautiful dark-themed dashboard with real-time updates
- π Nginx Proxy Manager - Create and manage reverse proxies
- π³ Docker Manager - Manage containers, images, volumes, and networks
| Method | Rust Required | Build Time | Best For |
|---|---|---|---|
| Pre-built Binary | β No | β‘ Instant | Production servers |
| Build from Source | β Yes | π¨ ~5 min | Development |
π Detailed installation guide: See INSTALL.md for complete installation instructions.
Download and install pre-built binary:
curl -sSL https://raw.githubusercontent.com/dadashussein/monitoring/main/install-binary.sh | sudo bashOr download and run manually:
wget https://raw.githubusercontent.com/dadashussein/monitoring/main/install-binary.sh
chmod +x install-binary.sh
sudo ./install-binary.shWhat this does:
- β Downloads pre-built binary (no compilation needed!)
- β Asks for your preferred port and address
- β
Installs to
/opt/ubuntu-resource-monitor - β Creates systemd service
- β Starts automatically
No Rust, no Cargo, no Docker - just works! π
Service Management:
# Check status
sudo systemctl status ubuntu-resource-monitor
# View logs
sudo journalctl -u ubuntu-resource-monitor -f
# Restart service
sudo systemctl restart ubuntu-resource-monitor
# Stop service
sudo systemctl stop ubuntu-resource-monitor
# Uninstall
sudo bash uninstall.shIf you want to build from source:
If you want to build from source:
# Clone repository
git clone <repository-url>
cd ubuntu-resource-monitor
# Run installer (will build from source)
sudo bash install.shThe installer will:
- β Install Rust/Cargo if needed
- β Build the application
- β Install and configure systemd service
For development or testing:
# Build
cargo build --release
# Run with custom port and address
SERVER_BIND_ADDRESS="0.0.0.0:9000" cargo run --release
# Or run the binary directly
./target/release/ubuntu_resource_api| Method | Endpoint | Description |
|---|---|---|
GET |
/ |
API information and available endpoints |
GET |
/dashboard |
π¨ Web Dashboard - Modern real-time system monitor |
GET |
/api/system |
System information |
GET |
/api/cpu |
CPU information |
GET |
/api/cpu/usage |
CPU usage statistics |
GET |
/api/memory |
Memory usage information |
GET |
/api/disks |
Disk usage for all mounts |
GET |
/api/network |
Network interface statistics |
GET |
/api/processes?limit=N |
Top N processes (default: 50) |
GET |
/api/load |
System load average (1, 5, 15 min) |
DELETE |
/api/processes/:pid |
Kill process by PID |
GET |
/health |
Health check |
Open your browser and navigate to http://localhost:8080/dashboard for a beautiful, real-time system monitoring dashboard featuring:
- Dark theme with gradient accents and modern design
- Real-time updates (auto-refresh every 3 seconds)
- CPU monitoring with per-core usage visualization
- Memory usage with detailed statistics
- Disk usage for all mounted filesystems
- Network interfaces with traffic statistics
- Top processes sorted by CPU or Memory usage
- Kill processes with X button (confirmation required)
- System load average tracking
- System info including uptime, OS, and kernel version
The application can be configured using environment variables. All settings have sensible defaults.
| Variable | Description | Default |
|---|---|---|
SERVER_BIND_ADDRESS |
Server bind address and port | 0.0.0.0:8080 |
NGINX_SITES_AVAILABLE |
Nginx sites-available directory | /etc/nginx/sites-available |
NGINX_SITES_ENABLED |
Nginx sites-enabled directory | /etc/nginx/sites-enabled |
DOCKER_SOCKET_PATH |
Docker socket path | unix:///var/run/docker.sock |
# Custom server port
export SERVER_BIND_ADDRESS="127.0.0.1:9000"
# Custom nginx paths
export NGINX_SITES_AVAILABLE="/custom/nginx/available"
export NGINX_SITES_ENABLED="/custom/nginx/enabled"
# Remote Docker daemon
export DOCKER_SOCKET_PATH="tcp://localhost:2375"
# Run the application
cargo run --releaseWhen using Docker Compose, set environment variables in docker-compose.yml:
environment:
- SERVER_BIND_ADDRESS=0.0.0.0:8080
- NGINX_SITES_AVAILABLE=/etc/nginx/sites-available
- NGINX_SITES_ENABLED=/etc/nginx/sites-enabled
- DOCKER_SOCKET_PATH=unix:///var/run/docker.sock# Get system info
curl http://localhost:8080/api/system
# Get CPU usage
curl http://localhost:8080/api/cpu/usage
# Get memory info
curl http://localhost:8080/api/memory
# Get top 10 processes
curl http://localhost:8080/api/processes?limit=10
# Kill a process
curl -X DELETE http://localhost:8080/api/processes/1234- Rust 1.83 - Systems programming language
- Actix-web - Fast web framework
- Sysinfo - System information gathering
- Serde - Serialization
- Chrono - Date/time handling
- Bollard - Docker API client
The application follows a modular architecture with clear separation of concerns:
Each feature module (system, nginx, docker) follows a consistent structure:
- models.rs: Data structures and domain entities
- handlers.rs: HTTP request handlers and business logic
- routes.rs: Route registration and API endpoint configuration
- Additional utilities: Module-specific helper functions (e.g., nginx/config.rs, docker/client.rs)
- config.rs: Centralized configuration management with environment variable support
- error.rs: Consistent error handling with automatic HTTP response conversion
- utils.rs: Shared utility functions used across modules
- HTTP request arrives at the server
- Actix-web routes the request to the appropriate module handler
- Handler processes the request using module-specific logic
- Errors are automatically converted to consistent JSON responses
- Response is returned to the client
This architecture makes the codebase:
- Maintainable: Each module is self-contained and focused
- Testable: Modules can be tested in isolation
- Extensible: New features can be added as new modules following the same pattern
The application follows a modular architecture with clear separation of concerns:
.
βββ src/
β βββ main.rs # Application entry point and server initialization
β βββ lib.rs # Library root exposing public modules
β βββ config.rs # Configuration management
β βββ error.rs # Common error types and handling
β βββ utils.rs # Shared utility functions
β βββ system/ # System monitoring module
β β βββ mod.rs # Module declaration
β β βββ models.rs # System info data structures
β β βββ handlers.rs # HTTP request handlers
β β βββ routes.rs # Route registration
β βββ nginx/ # Nginx management module
β β βββ mod.rs # Module declaration
β β βββ models.rs # Nginx proxy data structures
β β βββ handlers.rs # HTTP request handlers
β β βββ config.rs # Nginx config generation and validation
β β βββ routes.rs # Route registration
β βββ docker/ # Docker management module
β β βββ mod.rs # Module declaration
β β βββ models.rs # Docker entity data structures
β β βββ handlers.rs # HTTP request handlers
β β βββ client.rs # Docker client utilities
β β βββ routes.rs # Route registration
β βββ templates/ # HTML dashboard files
β βββ dashboard.html
β βββ nginx_admin.html
β βββ docker_manager.html
βββ Dockerfile # Production build
βββ Dockerfile.dev # Development with hot reload
βββ docker-compose.yml # Docker Compose configuration
βββ Makefile # Build commands
βββ Cargo.toml # Rust dependencies
- system/: System monitoring functionality (CPU, memory, disk, network, processes)
- nginx/: Nginx proxy management (CRUD operations, config generation)
- docker/: Docker management (containers, images, volumes, networks)
- config.rs: Centralized configuration with environment variable support
- error.rs: Consistent error handling across all modules
- utils.rs: Shared utility functions (e.g., unit conversions)
# Clean build artifacts
make clean
# Clean Docker resources
make docker-cleanTo add a new feature module, follow the established pattern:
- Create a new directory under
src/(e.g.,src/myfeature/) - Create the module structure:
src/myfeature/ βββ mod.rs # Module declaration with documentation βββ models.rs # Data structures βββ handlers.rs # HTTP handlers βββ routes.rs # Route registration - Add module documentation in
mod.rs - Implement your models, handlers, and routes
- Export the module in
src/lib.rs - Register routes in
src/main.rs
- Use Rust standard formatting:
cargo fmt - Check for linting issues:
cargo clippy - Run tests before committing:
cargo test - Generate documentation:
cargo doc --open
# Run all tests
cargo test
# Run tests with output
cargo test -- --nocapture
# Run specific test
cargo test test_name
# Generate test coverage
cargo tarpaulinThis project is open source and available under the MIT License.