feat(host_agent): each drive's health, read with smartctl, alertable (#5789)
The root helper gains one read-only action, `drives`: it finds the drives itself (smartctl --scan-open), reads each as JSON, and writes a summary the agent carries on every sample (agent 1.20.0). Steward judges the figures in drives.py (failing / worn / watch / ok / no SMART / unreadable), records them per drive and as host roll-ups for covering rules, keeps the newest report on the registration and lists it on the host page. install-deps.sh installs smartmontools with apt, dnf, yum, zypper, pacman or apk, run by install.sh and every agent playbook; one it can't install is reported, never fatal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -352,6 +352,12 @@ METRICS: dict[str, tuple[str, str]] = {
|
||||
"net_tx_bps": ("Network out", "bytes per second sent, by the whole host or one interface"),
|
||||
"disk_read_bps": ("Disk reads", "bytes per second read, from all disks or one"),
|
||||
"disk_write_bps": ("Disk writes", "bytes per second written, to all disks or one"),
|
||||
"drives_failing": ("Drives failing", "drives on the host failing their own health check, raising a critical warning or out of spare blocks"),
|
||||
"drive_failing": ("Drive failing", "1 when this drive fails its own health check, raises a critical warning or is out of spare blocks"),
|
||||
"drive_life_used_max_pct": ("Most worn drive", "the most life any of the host's SSDs has used of its rating"),
|
||||
"drive_life_used_pct": ("Drive life used", "how much of its rated write life this drive has used"),
|
||||
"drive_bad_sectors": ("Bad sectors", "media errors, or reallocated, pending and uncorrectable sectors, as the drive counts them"),
|
||||
"drive_temp_c": ("Drive temperature", "the drive's own temperature sensor"),
|
||||
}
|
||||
|
||||
# Where a rule's metric comes from, as the picker and the rules list say it.
|
||||
|
||||
Reference in New Issue
Block a user