mirror of
https://github.com/MacRimi/ProxMenux.git
synced 2026-04-17 17:42:19 +00:00
Update notification service
This commit is contained in:
@@ -804,6 +804,13 @@ class JournalWatcher:
|
||||
raw_message=raw_msg,
|
||||
severity='warning',
|
||||
)
|
||||
|
||||
# Also update worst_health so the disk stays marked as warning
|
||||
# even if current SMART readings show 0 pending sectors
|
||||
warn_line_text = warn_line_m.group(1).strip() if warn_line_m else error_signature
|
||||
health_persistence.update_disk_worst_health(
|
||||
base_dev, serial, 'warning', warn_line_text
|
||||
)
|
||||
except Exception as e:
|
||||
print(f"[DiskIOEventProcessor] Error recording smartd observation: {e}")
|
||||
|
||||
@@ -1795,6 +1802,18 @@ class PollingCollector:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# Skip recovery notifications for SMART disk errors (pending/reallocated sectors).
|
||||
# These indicate physical disk degradation that doesn't truly "recover" --
|
||||
# the disk may show 0 pending sectors later but the damage history persists.
|
||||
# The worst_health in disk_registry tracks this, so we don't send false "resolved".
|
||||
if category == 'disks':
|
||||
reason_lower = reason.lower() if reason else ''
|
||||
if any(indicator in reason_lower for indicator in [
|
||||
'pending', 'reallocated', 'sector', 'smart', 'unreadable'
|
||||
]):
|
||||
self._last_notified.pop(key, None)
|
||||
continue
|
||||
|
||||
# Calculate duration
|
||||
duration = ''
|
||||
if first_seen:
|
||||
|
||||
Reference in New Issue
Block a user