0430c0f2a8
- Nouveaux types payload: NetworkInterface, HardwareInfo - Config: slow_daily_time (HH:MM), network_info, hardware_info - Module network_info: interfaces locales, type ETH/WIFI, speed, MAC, WoL, iperf3 - Module hardware: dmidecode (carte mère, CPU, slots RAM, type/vitesse) - Scheduler: collecte au démarrage + 1×/jour à l'heure configurée - install.sh: ajout iperf3, dmidecode dans paquets Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
57 lines
1.6 KiB
Rust
57 lines
1.6 KiB
Rust
use serde::{Deserialize, Serialize};
|
|
|
|
#[derive(Serialize, Deserialize, Debug, Default)]
|
|
pub struct AgentMetrics {
|
|
pub hostname: String,
|
|
pub ip: String,
|
|
pub status: String,
|
|
#[serde(default)]
|
|
pub version: String,
|
|
pub cpu_percent: Option<f32>,
|
|
pub memory_used: Option<u64>,
|
|
pub memory_free: Option<u64>,
|
|
pub memory_total: Option<u64>,
|
|
pub hdd_used: Option<u64>,
|
|
pub hdd_free: Option<u64>,
|
|
pub hdd_total: Option<u64>,
|
|
pub uptime: Option<u64>,
|
|
pub network_rx: Option<u64>,
|
|
pub network_tx: Option<u64>,
|
|
pub temperature: Option<f32>,
|
|
pub smart: Option<Vec<SmartMetrics>>,
|
|
pub network_info: Option<Vec<NetworkInterface>>,
|
|
pub hardware_info: Option<HardwareInfo>,
|
|
}
|
|
|
|
#[derive(Serialize, Deserialize, Debug, Clone, Default)]
|
|
pub struct NetworkInterface {
|
|
pub name: String,
|
|
pub if_type: String,
|
|
pub speed_mbps: Option<i64>,
|
|
pub mac: String,
|
|
pub wol: Option<bool>,
|
|
pub iperf_mbps: Option<f64>,
|
|
}
|
|
|
|
#[derive(Serialize, Deserialize, Debug, Clone, Default)]
|
|
pub struct HardwareInfo {
|
|
pub motherboard_vendor: Option<String>,
|
|
pub motherboard_model: Option<String>,
|
|
pub cpu_model: Option<String>,
|
|
pub ram_type: Option<String>,
|
|
pub ram_speed_mhz: Option<i64>,
|
|
pub ram_slots_used: Option<i64>,
|
|
pub ram_slots_total: Option<i64>,
|
|
}
|
|
|
|
#[derive(Serialize, Deserialize, Debug, Clone)]
|
|
pub struct SmartMetrics {
|
|
#[serde(default)]
|
|
pub device: String,
|
|
pub passed: bool,
|
|
pub temperature: Option<i64>,
|
|
pub reallocated_sectors: Option<i64>,
|
|
pub power_on_hours: Option<i64>,
|
|
pub wear_level: Option<i64>,
|
|
}
|