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<SmartMetrics>,
}

#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct SmartMetrics {
    pub passed: bool,
    pub temperature: Option<i64>,
    pub reallocated_sectors: Option<i64>,
    pub power_on_hours: Option<i64>,
    pub wear_level: Option<i64>,
}
