Implement per-service disk usage monitoring

Replaced system-wide disk usage with accurate per-service tracking by scanning
service-specific directories. Services like sshd now correctly show minimal
disk usage instead of misleading system totals.

- Rename storage widget and add drive capacity/usage columns
- Move host display to main dashboard title for cleaner layout
- Replace separate alert displays with color-coded row highlighting
- Add per-service disk usage collection using du command
- Update services widget formatting to handle small disk values
- Restructure into workspace with dedicated agent and dashboard packages
This commit is contained in:
2025-10-11 22:59:16 +02:00
parent 82afe3d4f1
commit 2581435b10
30 changed files with 4801 additions and 446 deletions

View File

@@ -6,20 +6,22 @@ CM Dashboard is a Rust-powered terminal UI for real-time monitoring of CMTEC inf
┌──────────────────────────────────────────────────────────────────────────────┐
│ CM Dashboard │
├────────────────────────────┬────────────────────────────┬────────────────────┤
│ NVMe Health │ Services │ Memory Optimization
│ NVMe Health │ Services │ CPU / Memory
│ Host: srv01 │ Host: srv01 │ Host: srv01 │
│ Status: Healthy │ Services healthy: 5 │ Memory used: 2048 /
Drives healthy/warn/crit: │ Degraded: 1 Failed: 0 │ 4096 MiB (50.0%)
│ 4/0/0 CPU top service: 71.3% │ Last update: 12:34:
│ Capacity used: 512.0 / │ Total memory: 1536 / 2048 │ 56
2048.0 GiB │ MiB │
│ Status: Healthy │ Service memory: 1.2G/4.0G │ RAM: 6.9 / 7.8 GiB
Healthy/Warning/Critical: │ Disk usage: 45 / 500 GiB │ CPU load (1/5/15):
│ 4 / 0 / 0Services tracked: 8 │ 1.2 0.9 0.7
│ Capacity used: 512 / 2048G │ │ CPU temp: 68°C
Issue: — │ nginx running 320M │ GPU temp: —
│ │ immich running 1.2G │ Status • ok │
│ │ backup-api running 40M │ │
├────────────────────────────┴────────────┬───────────────┴────────────────────┤
│ Backups │ Alerts │
│ Host: srv01 │ srv01: OK
Status: Healthy │ labbox: smart warning
│ Last success: 2024-02-01 03:12:45 │
│ Snapshots: 17 • Size: 512.0 GiB │
│ Pending jobs: 0 (enabled: true) │
│ Host: srv01 │ srv01: ok
Overall: Healthy │ labbox: warning: RAM 82%
│ Last success: 2024-02-01 03:12:45 │ cmbox: critical: CPU temp 92°C
│ Snapshots: 17 • Size: 512.0 GiB │ Update: 2024-02-01 10:15:32
│ Pending jobs: 0 (enabled: true) │ │
└──────────────────────────────┬───────────────────────────────────────────────┘
│ Status │ │
│ Active host: srv01 (1/3) │ History retention ≈ 3600s │
@@ -99,7 +101,8 @@ Adjust the host list and `data_source.zmq.endpoints` to match your CMTEC gossip
## Features
- Rotating host selection with left/right arrows (`←`, `→`, `h`, `l`, `Tab`)
- Live NVMe, service, memory, backup, and alert summaries per active host
- Live NVMe, service, CPU/memory, backup, and alert panels per host
- Health scoring that rolls CPU/RAM/GPU pressure into alerts automatically
- Structured logging with `tracing` (`-v`/`-vv` to increase verbosity)
- Help overlay (`?`) outlining keyboard shortcuts
- Config-driven host discovery via `config/dashboard.toml`