Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(alert): Ignore ipmi Entity Presence type alert #101

Merged
merged 2 commits into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
aieri marked this conversation as resolved.
Show resolved Hide resolved
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.
aieri marked this conversation as resolved.
Show resolved Hide resolved
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.
aieri marked this conversation as resolved.
Show resolved Hide resolved
VALUE = 50
LABELS = map[__name__:ipmi_generic_sensor_value instance:ubuntu-12 state:Critical]