Skip to content

Commit 83b5c8c

Browse files
Fix RedfishStorageDriveHealthNotOk (#493)
If disks are disabled, it doesn't make sense to trigger alerts abouth their health. Closes: #113
1 parent 259f9e1 commit 83b5c8c

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/prometheus_alert_rules_dynamic/redfish.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ groups:
7171
LABELS = {{ $labels }}
7272
7373
- alert: RedfishStorageDriveHealthNotOk
74-
expr: redfish_storage_drive_info{health!~"OK|NA"}
74+
expr: redfish_storage_drive_info{health!~"OK|NA", state="Enabled"}
7575
for: 5m
7676
labels:
7777
severity: critical

tests/unit/test_alert_rules/test_redfish.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ tests:
130130
131131
- interval: 1m
132132
input_series:
133-
- series: redfish_storage_drive_info{instance="ubuntu-1", health="Unhealthy", system_id="s1", storage_id="stor1", drive_id="dr1"}
133+
- series: redfish_storage_drive_info{instance="ubuntu-1", health="Unhealthy", system_id="s1", state="Enabled", storage_id="stor1", drive_id="dr1"}
134134
values: "1x15"
135135

136136
alert_rule_test:
@@ -144,11 +144,13 @@ tests:
144144
system_id: s1
145145
storage_id: stor1
146146
drive_id: dr1
147+
state: Enabled
147148
exp_annotations:
148149
summary: Redfish storage drive health not OK. (instance ubuntu-1)
149150
description: |
150151
Redfish storage drive health not OK.
151-
LABELS = map[__name__:redfish_storage_drive_info drive_id:dr1 health:Unhealthy instance:ubuntu-1 storage_id:stor1 system_id:s1]
152+
LABELS = map[__name__:redfish_storage_drive_info drive_id:dr1 health:Unhealthy instance:ubuntu-1 state:Enabled storage_id:stor1 system_id:s1]
153+
152154
153155
- interval: 1m
154156
input_series:

0 commit comments

Comments
 (0)