Updated readme

This commit is contained in:
Christoffer Martinsson 2025-10-21 20:47:30 +02:00
parent 0417e2c1f1
commit 1315ba1315

View File

@ -5,6 +5,7 @@ A real-time infrastructure monitoring system with intelligent status aggregation
## Current Implementation ## Current Implementation
This is a complete rewrite implementing an **individual metrics architecture** where: This is a complete rewrite implementing an **individual metrics architecture** where:
- **Agent** collects individual metrics (e.g., `cpu_load_1min`, `memory_usage_percent`) and calculates status - **Agent** collects individual metrics (e.g., `cpu_load_1min`, `memory_usage_percent`) and calculates status
- **Dashboard** subscribes to specific metrics and composes widgets - **Dashboard** subscribes to specific metrics and composes widgets
- **Status Aggregation** provides intelligent email notifications with batching - **Status Aggregation** provides intelligent email notifications with batching
@ -14,7 +15,7 @@ This is a complete rewrite implementing an **individual metrics architecture** w
``` ```
cm-dashboard • ● cmbox ● srv01 ● srv02 ● steambox cm-dashboard • ● cmbox ● srv01 ● srv02 ● steambox
┌system───────────────────────────────────────────┐┌services────────────────────────────────────────────────────┐ ┌system──────────────────────────────┐┌services─────────────────────────────────────────┐
│CPU: ││Service: Status: RAM: Disk: │ │CPU: ││Service: Status: RAM: Disk: │
│● Load: 0.10 0.52 0.88 • 400.0 MHz ││● docker active 27M 496MB │ │● Load: 0.10 0.52 0.88 • 400.0 MHz ││● docker active 27M 496MB │
│RAM: ││● docker-registry active 19M 496MB │ │RAM: ││● docker-registry active 19M 496MB │
@ -31,8 +32,8 @@ cm-dashboard • ● cmbox ● srv01 ● srv02 ● steambox
│ ││ ├─ ● haasp.cmtec.se 43ms │ │ ││ ├─ ● haasp.cmtec.se 43ms │
│ ││ ├─ ● haasp.net 43ms │ │ ││ ├─ ● haasp.net 43ms │
│ ││ ├─ ● pages.cmtec.se 45ms │ │ ││ ├─ ● pages.cmtec.se 45ms │
└─────────────────────────────────────────────────┘│ ├─ ● photos.cmtec.se 41ms └────────────────────────────────────┘│ ├─ ● photos.cmtec.se 41ms │
┌backup───────────────────────────────────────────┐│ ├─ ● unifi.cmtec.se 46ms ┌backup──────────────────────────────┐│ ├─ ● unifi.cmtec.se 46ms │
│Latest backup: ││ ├─ ● vault.cmtec.se 47ms │ │Latest backup: ││ ├─ ● vault.cmtec.se 47ms │
│● Status: OK ││ ├─ ● www.kryddorten.se 81ms │ │● Status: OK ││ ├─ ● www.kryddorten.se 81ms │
│Duration: 54s • Last: 4h ago ││ ├─ ● www.mariehall2.se 86ms │ │Duration: 54s • Last: 4h ago ││ ├─ ● www.mariehall2.se 86ms │
@ -46,7 +47,7 @@ cm-dashboard • ● cmbox ● srv01 ● srv02 ● steambox
│● nixosbox 2 archives 4.5MB ││ │ │● nixosbox 2 archives 4.5MB ││ │
│● unifi 2 archives 2.9MB ││ │ │● unifi 2 archives 2.9MB ││ │
│● vaultwarden 2 archives 305kB ││ │ │● vaultwarden 2 archives 305kB ││ │
└─────────────────────────────────────────────────┘└────────────────────────────────────────────────────────────┘ └────────────────────────────────────┘└─────────────────────────────────────────────────┘
``` ```
**Navigation**: `←→` switch hosts, `r` refresh, `q` quit **Navigation**: `←→` switch hosts, `r` refresh, `q` quit
@ -199,30 +200,35 @@ theme = "dark"
The agent implements several specialized collectors: The agent implements several specialized collectors:
### CPU Collector (`cpu.rs`) ### CPU Collector (`cpu.rs`)
- Load average (1, 5, 15 minute) - Load average (1, 5, 15 minute)
- CPU temperature monitoring - CPU temperature monitoring
- Real-time process monitoring (top CPU consumers) - Real-time process monitoring (top CPU consumers)
- Status calculation with configurable thresholds - Status calculation with configurable thresholds
### Memory Collector (`memory.rs`) ### Memory Collector (`memory.rs`)
- RAM usage (total, used, available) - RAM usage (total, used, available)
- Swap monitoring - Swap monitoring
- Real-time process monitoring (top RAM consumers) - Real-time process monitoring (top RAM consumers)
- Memory pressure detection - Memory pressure detection
### Disk Collector (`disk.rs`) ### Disk Collector (`disk.rs`)
- Filesystem usage per mount point - Filesystem usage per mount point
- SMART health monitoring - SMART health monitoring
- Temperature and wear tracking - Temperature and wear tracking
- Configurable filesystem monitoring - Configurable filesystem monitoring
### Systemd Collector (`systemd.rs`) ### Systemd Collector (`systemd.rs`)
- Service status monitoring (`active`, `inactive`, `failed`) - Service status monitoring (`active`, `inactive`, `failed`)
- Memory usage per service - Memory usage per service
- Service filtering and exclusions - Service filtering and exclusions
- Handles transitional states (`Status::Pending`) - Handles transitional states (`Status::Pending`)
### Backup Collector (`backup.rs`) ### Backup Collector (`backup.rs`)
- Reads TOML status files from backup systems - Reads TOML status files from backup systems
- Archive age verification - Archive age verification
- Disk usage tracking - Disk usage tracking
@ -270,6 +276,7 @@ Generated at 2025-10-21 19:42:42 CET
The system follows a **metrics-first architecture**: The system follows a **metrics-first architecture**:
### Agent Side ### Agent Side
```rust ```rust
// Agent collects individual metrics // Agent collects individual metrics
vec![ vec![
@ -280,6 +287,7 @@ vec![
``` ```
### Dashboard Side ### Dashboard Side
```rust ```rust
// Widgets subscribe to specific metrics // Widgets subscribe to specific metrics
impl Widget for CpuWidget { impl Widget for CpuWidget {
@ -403,3 +411,4 @@ sudo nixos-rebuild switch --flake .
## License ## License
MIT License - see LICENSE file for details MIT License - see LICENSE file for details