mirror of
https://forgejo.altau.su/lego/lego-monitoring.git
synced 2026-03-10 04:41:10 +00:00
don't forget to test alerts themselves
This commit is contained in:
parent
92ce59d6a3
commit
6fc68c20c5
1 changed files with 10 additions and 1 deletions
|
|
@ -201,6 +201,15 @@ def raid_check() -> list[alerts.Alert]:
|
||||||
)
|
)
|
||||||
continue
|
continue
|
||||||
|
|
||||||
|
if IS_TESTING:
|
||||||
|
alert_list.append(
|
||||||
|
alerts.Alert(
|
||||||
|
alert_type=alerts.AlertType.RAID,
|
||||||
|
message=f"Test alert: LV {lv} health is {lv_attr.health}",
|
||||||
|
severity=alerts.Severity.INFO,
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
match lv_attr.health:
|
match lv_attr.health:
|
||||||
case LVAttr.Health.PARTIAL:
|
case LVAttr.Health.PARTIAL:
|
||||||
alert_list.append(
|
alert_list.append(
|
||||||
|
|
@ -255,7 +264,7 @@ def disk_wearout_check() -> list[alerts.Alert]:
|
||||||
logging.error(traceback.format_exc())
|
logging.error(traceback.format_exc())
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if wearout_reading.current_reading < wearout_reading.threshold_reading:
|
if IS_TESTING or wearout_reading.current_reading < wearout_reading.threshold_reading:
|
||||||
match wearout_reading.indicator:
|
match wearout_reading.indicator:
|
||||||
case WearoutIndicator.REALLOCATED_SECTORS:
|
case WearoutIndicator.REALLOCATED_SECTORS:
|
||||||
message = f"Disk {disk['name']} has reallocated sectors (curr {wearout_reading.current_reading}, thresh {wearout_reading.threshold_reading})"
|
message = f"Disk {disk['name']} has reallocated sectors (curr {wearout_reading.current_reading}, thresh {wearout_reading.threshold_reading})"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue