Skip to content

Commit

Permalink
fix(alert): Ignore ipmi Entity Presence type alert
Browse files Browse the repository at this point in the history
Alert rule ipmi_generic_sensor_value ignoe type="Entity Presence"
  • Loading branch information
jneo8 committed Nov 14, 2023
1 parent 8d14bcf commit 3dd39f4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/prometheus_alert_rules/ipmi_sensors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ groups:
LABELS = {{ $labels }}
- alert: IPMISensorStateNotOk
expr: ipmi_generic_sensor_value{state=~"Warning|Critical"}
expr: ipmi_generic_sensor_value{state=~"Warning|Critical", type!="Entity Presence"}
for: 0m
labels:
severity: "{{ toLower $labels.state }}"
annotations:
summary: IPMI sensor value in {{ toLower $labels.state }} state. (instance {{ $labels.instance }})
description: |
A sensor value, recorded by ipmi sensor, in {{ toLower $labels.state }} state.
A sensor value, recorded by ipmi sensor, in {{ toLower $labels.state }} state and ignore type Entity Presence.
VALUE = {{ $value }}
LABELS = {{ $labels }}
6 changes: 4 additions & 2 deletions tests/unit/test_alert_rules/test_ipmi_sensors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,8 @@ tests:
values: '1x15'
- series: ipmi_generic_sensor_value{state="Critical", instance="ubuntu-12"}
values: '50x15'
- series: ipmi_generic_sensor_value{state="Critical", instance="ubuntu-12", type="Entity Presence"}
values: '50x15'

alert_rule_test:
- eval_time: 0m
Expand All @@ -226,7 +228,7 @@ tests:
exp_annotations:
summary: IPMI sensor value in warning state. (instance ubuntu-11)
description: |
A sensor value, recorded by ipmi sensor, in warning state.
A sensor value, recorded by ipmi sensor, in warning state and ignore type Entity Presence.
VALUE = 20
LABELS = map[__name__:ipmi_generic_sensor_value instance:ubuntu-11 state:Warning]
- exp_labels:
Expand All @@ -236,6 +238,6 @@ tests:
exp_annotations:
summary: IPMI sensor value in critical state. (instance ubuntu-12)
description: |
A sensor value, recorded by ipmi sensor, in critical state.
A sensor value, recorded by ipmi sensor, in critical state and ignore type Entity Presence.
VALUE = 50
LABELS = map[__name__:ipmi_generic_sensor_value instance:ubuntu-12 state:Critical]

0 comments on commit 3dd39f4

Please sign in to comment.