-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add zfs state degrade rule in prometheus linuxaid
- Loading branch information
iminfinity
committed
Dec 3, 2024
1 parent
0ef419f
commit b3e5b38
Showing
4 changed files
with
43 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
groups: | ||
- name: zfs::pool::status | ||
rules: | ||
- alert: zfs::pool::status | ||
expr: node_zfs_zpool_state{state!="online"} > 0 | ||
for: 30m | ||
labels: | ||
severity: critical | ||
alert_id: zfs::pool::status | ||
annotations: | ||
summary: 'ZFS Pool is Degraded.' | ||
description: 'The zfs pool **{{ .Labels.zpool }}** is {{ .Labels.state }} on {{ .Labels.instance }}' |
6 changes: 3 additions & 3 deletions
6
...emplates/prometheusRule-zfs-exporter.yaml → ...inuxaid/templates/prometheusRule-zfs.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
{{- if .Values.prometheusRule.zfsExporter }} | ||
{{- if .Values.prometheusRule.zfs }} | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: PrometheusRule | ||
metadata: | ||
name: zfs-exporter-rules | ||
name: zfs | ||
namespace: monitoring-{{ .Values.customerid }} | ||
spec: | ||
{{- $.Files.Get "rules/zfs_exporter.yaml" | nindent 4 }} | ||
{{- $.Files.Get "rules/zfs.yaml" | nindent 4 }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
evaluation_interval: 1m | ||
|
||
rule_files: | ||
- ../rules/zfs.yaml | ||
|
||
tests: | ||
- interval: 1m | ||
input_series: | ||
- series: obmondo_monitoring{alert_id="zfs::pool::status"} | ||
values: 1x200 | ||
- series: node_zfs_zpool_state{state="degraded", instance="htzhel1-ax41a.enableit.dk", zpool="mypool"} | ||
values: 1x200 | ||
|
||
alert_rule_test: | ||
- alertname: 'zfs::pool::status' | ||
eval_time: 30m | ||
exp_alerts: | ||
- exp_labels: | ||
severity: 'critical' | ||
instance: 'htzhel1-ax41a.enableit.dk' | ||
alert_id: 'zfs::pool::status' | ||
zpool: 'mypool' | ||
state: 'degraded' | ||
exp_annotations: | ||
summary: 'ZFS Pool is Degraded.' | ||
description: 'The zfs pool **mypool** is degraded on htzhel1-ax41a.enableit.dk' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters