Name only physical volumes in a restricted LVM scan and keep its own reads from counting as activity

- An explicit --devices list makes LVM open every device in it, while a plain scan opens only known volumes; the list now names only LVM physical volumes, read from udev by lsblk, so no other disk is touched
- RAID, multipath and encrypted volumes follow the disks they are built on, instead of turning the whole check off
- After each pvs, lvs or vgs run, the disks it read take their counters as the new baseline, so an unused disk can become idle
This commit is contained in:
MacRimi
2026-10-17 00:03:39 +02:00
parent 72b596ff4b
commit 628dbe3aa3
5 changed files with 131 additions and 27 deletions
+3
View File
@@ -2286,6 +2286,8 @@ class HealthMonitor:
text=True,
timeout=3
)
from lvm_device_scope import settle_scan_reads
settle_scan_reads()
if result.returncode != 0:
return {'status': 'WARNING', 'reason': 'lvs command failed'}
@@ -2310,6 +2312,7 @@ class HealthMonitor:
text=True,
timeout=3
)
settle_scan_reads()
if vg_result.returncode == 0 and vg_result.stdout.strip():
return {'status': 'WARNING', 'reason': 'No active LVM volumes detected'}
else: