Disk health reads smartctl's overall verdict, and md membership matches only the disk or its own partitions.
smartctl -iHA; the verdict line ("SMART overall-health self-assessment test result" for ATA/NVMe, "SMART Health Status" for SCSI/SAS) decides. Before, every ATA disk whose attribute table was printed read failed, because the table header contains WHEN_FAILED; NVMe and SCSI disks read unknown.
md membership: sda no longer matches sdaa1, nvme0n1 no longer nvme0n11; /proc/mdstat is read once per get_disks().
fix(disks): a SAS disk's temperature (Current Drive Temperature: 28 C) is read; before, every SAS disk read -1. A reading of 0 C (QEMU disks without a sensor) stays unknown.
Tested: tests/test_disks.py against recordedsmartctl -iHA output (ATA SSD, NVMe, SAS, a QEMU disk without SMART; smartmontools 7.4/7.5; serials and WWNs replaced) in tests/fixtures/. The failing-disk cases are a recording with only the verdict line changed; md-array tests still use a hand-written mdstat (no recorded host has an array).
Disk health reads smartctl's overall verdict, and md membership matches only the disk or its own partitions.
- `smartctl -iHA`; the verdict line ("SMART overall-health self-assessment test result" for ATA/NVMe, "SMART Health Status" for SCSI/SAS) decides. Before, every ATA disk whose attribute table was printed read **failed**, because the table header contains `WHEN_FAILED`; NVMe and SCSI disks read unknown.
- md membership: `sda` no longer matches `sdaa1`, `nvme0n1` no longer `nvme0n11`; `/proc/mdstat` is read once per `get_disks()`.
- `fix(disks)`: a SAS disk's temperature (`Current Drive Temperature: 28 C`) is read; before, every SAS disk read -1. A reading of `0 C` (QEMU disks without a sensor) stays unknown.
Tested: `tests/test_disks.py` against **recorded** `smartctl -iHA` output (ATA SSD, NVMe, SAS, a QEMU disk without SMART; smartmontools 7.4/7.5; serials and WWNs replaced) in `tests/fixtures/`. The failing-disk cases are a recording with only the verdict line changed; md-array tests still use a hand-written mdstat (no recorded host has an array).
Closes #4
get_disks ran smartctl -iA, and neither -i nor -A prints the overall
verdict: only -H does. A disk read unknown, and an ATA disk read failed
from the WHEN_FAILED column header of its attribute table. It now asks
-iHA and reads the verdict line (ATA/NVMe) or SCSI health status only.
Array membership matched the disk name as a substring of the mdstat
line, so sda joined the array of sdaa1. A disk now owns only itself and
its partitions, and /proc/mdstat is read once per call.
Closes#4
The get_disks tests ran against hand-written smartctl sections. They now
read smartctl -iHA as recorded on real hosts: an ATA SATA DOM and an
NVMe SSD (PASSED), a SAS SSD (OK) and a QEMU disk without SMART, with
serial numbers, WWNs and LU ids replaced. The failing verdicts replace
the verdict line of a recording, as no failing disk was at hand. A
recorded /proc/mdstat without arrays is added too.
A SCSI/SAS disk prints its temperature as "Current Drive Temperature:
28 C", which matched none of the ATA and NVMe patterns, so every SAS
disk read -1. Found in the smartctl output recorded from a Proxmox host.
A QEMU disk without a sensor prints 0 C there and keeps reading -1.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Disk health reads smartctl's overall verdict, and md membership matches only the disk or its own partitions.
smartctl -iHA; the verdict line ("SMART overall-health self-assessment test result" for ATA/NVMe, "SMART Health Status" for SCSI/SAS) decides. Before, every ATA disk whose attribute table was printed read failed, because the table header containsWHEN_FAILED; NVMe and SCSI disks read unknown.md membership:
sdano longer matchessdaa1,nvme0n1no longernvme0n11;/proc/mdstatis read once perget_disks().fix(disks): a SAS disk's temperature (Current Drive Temperature: 28 C) is read; before, every SAS disk read -1. A reading of0 C(QEMU disks without a sensor) stays unknown.Tested:
tests/test_disks.pyagainst recordedsmartctl -iHAoutput (ATA SSD, NVMe, SAS, a QEMU disk without SMART; smartmontools 7.4/7.5; serials and WWNs replaced) intests/fixtures/. The failing-disk cases are a recording with only the verdict line changed; md-array tests still use a hand-written mdstat (no recorded host has an array).Closes #4