Skip to content

Commit

Permalink
Add ipmiseld alert rule (canonical#261)
Browse files Browse the repository at this point in the history
  • Loading branch information
zxhdaze authored Jun 19, 2024
1 parent 651dded commit 2dcafeb
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/prometheus_alert_rules/ipmi_sel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,15 @@ groups:
description: |
IPMI SEL entry in critical state.
LABELS = {{ $labels }}
- alert: IPMISELDStateWarning
expr: node_systemd_unit_state{name="ipmiseld.service", state=~"failed|inactive"} == 1
for: 5m
labels:
severity: warning
annotations:
summary: IPMISELD service is not active. (instance {{ $labels.instance }})
description: |
The ipmiseld service is not active, indicating a potential problem.
VALUE = {{ $value }}
LABELS = {{ $labels }}
33 changes: 33 additions & 0 deletions tests/unit/test_alert_rules/test_ipmi_sel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ tests:
- series: ipmi_sel_state{instance="ubuntu-2"}
values: '2x15'

- series: node_systemd_unit_state{name="ipmiseld.service", instance="ubuntu-3", state="failed"}
values: '1x15'

- series: node_systemd_unit_state{name="ipmiseld.service", instance="ubuntu-4", state="inactive"}
values: '1x15'

alert_rule_test:
- eval_time: 10m
alertname: IPMISELCommandFailed
Expand Down Expand Up @@ -56,3 +62,30 @@ tests:
description: |
IPMI SEL entry in critical state.
LABELS = map[__name__:ipmi_sel_state instance:ubuntu-2]
- eval_time: 10m
alertname: IPMISELDStateWarning
exp_alerts:
- exp_labels:
severity: warning
name: ipmiseld.service
instance: ubuntu-3
state: failed
exp_annotations:
summary: IPMISELD service is not active. (instance ubuntu-3)
description: |
The ipmiseld service is not active, indicating a potential problem.
VALUE = 1
LABELS = map[__name__:node_systemd_unit_state instance:ubuntu-3 name:ipmiseld.service state:failed]
- exp_labels:
severity: warning
name: ipmiseld.service
instance: ubuntu-4
state: inactive
exp_annotations:
summary: IPMISELD service is not active. (instance ubuntu-4)
description: |
The ipmiseld service is not active, indicating a potential problem.
VALUE = 1
LABELS = map[__name__:node_systemd_unit_state instance:ubuntu-4 name:ipmiseld.service state:inactive]

0 comments on commit 2dcafeb

Please sign in to comment.