fix(disks): raise on a failed lsblk, warn on failed smartctl calls
driver / standard (pull_request) Successful in 21s
driver / lint (pull_request) Successful in 18s
driver / types (pull_request) Successful in 1m17s
driver / test (3.12) (pull_request) Successful in 1m12s
driver / test (3.13) (pull_request) Successful in 1m7s
driver / lowest (pull_request) Successful in 42s
driver / build (pull_request) Successful in 51s
driver / security (pull_request) Successful in 1m35s
CI / driver (pull_request) Successful in 3m26s
driver / publish (pull_request) Skipped

get_disks swallowed a failed or garbled lsblk and returned [], the
answer for a NAS without disks, so every disk vanished on a transient
error. It now raises CommandErrorException; a failed /proc/mdstat read
raises too instead of dropping every pool.

A smartctl call that timed out, was refused by sudo or could not open
the device was logged at debug level and read like a disk without
SMART. It is now logged as a warning with the reason (exit status bits
0 and 1; the disk-state bits 2-7 are not a failed call).

A disk whose verdict passed but that counts reallocated, pending or
offline-uncorrectable sectors (ATA), grown defects (SAS), or sets a
critical warning or counts media errors (NVMe) is reported as
"warning", as the contract allows.

get_disks shrinks below its baseline entries, which are tightened.

Closes #16
This commit is contained in:
Christian Manivong committed 2026-11-02 08:42:48 +01:00
1 parent 099eef7f3e
commit deb233617c
5 files changed
+271 -44

No files matched your search

+1 -1
View File
@@ -35,7 +35,7 @@ with driver("192.0.2.10", "admin", "secret", optional_args={"sudo_password": "se
| Getter / action | |
|---|---|
| `get_facts` | napalm-linux's facts, `os_version` is `OMV <version>` of the `openmediavault` package |
| `get_disks` | `lsblk` for the disks, `smartctl -iA` for health, temperature and RPM |
| `get_disks` | `lsblk` for the disks, `smartctl -iHA` for health (`healthy`, `warning`, `failed`, `unknown`), temperature and RPM |
| `get_disk_pools` | md arrays from `/proc/mdstat`, size and state from `mdadm --detail` |
| `get_volumes` | mounted block-device filesystems from `df`, read-only flag from `/proc/mounts` |
| `get_shares` | SMB, NFS and FTP shares from OMV's configuration database (`omv-confdbadm`) |