Expand description
Metric collection and parsing for remote servers.
Metrics are gathered via SSH commands and parsed into typed
values. All parsers return Option<f32> — they never panic.
Unknown or truncated output results in None, which the UI
renders as “N/A”.
Commands used per OS family:
- CPU:
top -bn1(Linux) /top -l 1 -n 0(macOS) - RAM:
free -b(Linux) /vm_stat+sysctl hw.memsize(macOS) - Disk:
df -k / - Uptime:
uptime - Load:
cat /proc/loadavg(Linux only)
Severity thresholds: Ok < 60 % Warn 60–85 % Crit > 85 %
Enums§
- Threshold
Level - Severity of a metric percentage. The UI maps each level to a colour.
Functions§
- parse_
cpu_ proc_ stat - Parse CPU usage from Linux
/proc/stat. - parse_
cpu_ top - Parse CPU idle percentage from Linux
top -bn1output. - parse_
cpu_ top_ macos - Parse CPU usage from macOS
top -l 1 -n 0output. - parse_
disk_ df - Parse disk usage of
/fromdf -k /output. - parse_
loadavg - Extract load averages from
cat /proc/loadavgoutput. - parse_
ram_ free - Parse RAM usage from Linux
free -boutput. - parse_
ram_ vmstat - Parse RAM usage from macOS
vm_stat+sysctl hw.memsizeoutput. - parse_
top_ processes - Parse the top processes by CPU usage from
psoutput. - parse_
uptime - Extract the human-readable uptime string from
uptimeoutput. - threshold_
level - Returns the severity level for a metric percentage.