Skip to content

Commit

Permalink
Add alert rules based on mdadm metrics (#208)
Browse files Browse the repository at this point in the history
  • Loading branch information
sudeephb authored Jun 13, 2023
1 parent 4e0b060 commit 00c570a
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions src/prometheus_alert_rules/mdadm.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
groups:
- name: mdadm
rules:
- alert: RaidDisksFailed
expr: node_md_disks{state="failed"} > 0
for: 0m
labels:
severity: critical
annotations:
summary: "{{ $value }} disks failed on device {{ $labels.device }}.(instance {{ $labels.instance }})"
description: >-
Disks failed on raid device {{ $labels.device }}.
VALUE = {{ $value }}
LABELS = {{ $labels }}

- alert: RaidDisksSpare
expr: node_md_disks{state="spare"} > 0
for: 0m
labels:
severity: warning
annotations:
summary: "{{ $value }} disks marked as spare on device {{ $labels.device }}.(instance {{ $labels.instance }})"
description: >-
Disks marked as spare on raid device {{ $labels.device }}.
VALUE = {{ $value }}
LABELS = {{ $labels }}

- alert: RaidDeviceInactive
expr: node_md_state{state="inactive"} > 0
for: 0m
labels:
severity: critical
annotations:
summary: RAID device {{ $labels.device }} in inactive state.(instance {{ $labels.instance }})
description: >-
RAID device {{ $labels.device }} in inactive state.
VALUE = {{ $value }}
LABELS = {{ $labels }}

- alert: RaidDeviceRecovering
expr: node_md_state{state="recovering"} > 0
for: 0m
labels:
severity: warning
annotations:
summary: RAID device {{ $labels.device }} in recovering state.(instance {{ $labels.instance }})
description: >-
RAID device {{ $labels.device }} in recovering state.
VALUE = {{ $value }}
LABELS = {{ $labels }}

0 comments on commit 00c570a

Please sign in to comment.