Skip to content

Commit

Permalink
fix(alert): Ignore ipmi Entity Presence type alert (canonical#101)
Browse files Browse the repository at this point in the history
* fix(alert): Ignore ipmi Entity Presence type alert

Alert rule ipmi_generic_sensor_value ignoe type="Entity Presence"

* docs: Change the wording of alert description
  • Loading branch information
jneo8 authored Nov 16, 2023
1 parent 15c02a2 commit f084905
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. Entity Presence sensors are ignored.
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. Entity Presence sensors are ignored.
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. Entity Presence sensors are ignored.
VALUE = 50
LABELS = map[__name__:ipmi_generic_sensor_value instance:ubuntu-12 state:Critical]

0 comments on commit f084905

Please sign in to comment.