ansible/roles/prometheus/templates/alert.rules.yml.j2

163 lines
4.1 KiB
Text
Raw Normal View History

2021-04-01 05:21:08 +02:00
---
{{ ansible_managed | comment }}
{% macro raw(string) -%}
2021-04-01 06:00:47 +02:00
{{ "{{" }} {{ string }} {{ "}}" }}
2021-04-01 05:21:08 +02:00
{%- endmacro %}
2019-05-05 14:07:04 +02:00
groups:
2021-04-01 05:21:08 +02:00
- name: alert.rules
rules:
- alert: InstanceDown
expr: up == 0
for: 3m
labels:
2021-04-01 06:00:47 +02:00
severity: critical
2021-04-01 05:21:08 +02:00
annotations:
2021-04-01 06:00:47 +02:00
summary: >-
Invisible depuis plus de 3 minutes
2021-04-01 05:21:08 +02:00
- alert: OutOfMemory
expr: >-
(
node_memory_MemFree_bytes
+ node_memory_Cached_bytes
+ node_memory_Buffers_bytes
) / node_memory_MemTotal_bytes * 100 < 10
for: 5m
labels:
severity: warning
annotations:
summary: >-
{{ raw('$value | printf "%.1f"') }}% de mémoire
2021-04-01 06:00:47 +02:00
libre
2021-04-01 05:21:08 +02:00
- alert: OutOfDiskSpace
expr: >-
node_filesystem_free_bytes / node_filesystem_size_bytes * 100 < 10
for: 5m
labels:
severity: warning
annotations:
summary: >-
2021-04-01 18:24:03 +02:00
{{ raw('$value | printf "%.1f"') }}% d'espace libre pour
{{ raw('$labels.mountpoint') }}
2021-04-01 05:21:08 +02:00
- alert: OutOfInodes
expr: node_filesystem_files_free / node_filesystem_files * 100 < 10
for: 5m
labels:
severity: warning
annotations:
summary: >-
{{ raw('$value | printf "%.1f"') }}% d'inodes
2021-04-01 06:00:47 +02:00
restants pour {{ raw('$labels.mountpoint') }}
2021-04-01 05:21:08 +02:00
- alert: CpuUsage
expr: >-
(
100 - avg by (instance) (
irate(node_cpu_seconds_total{mode="idle"}[5m])
) * 100
) > 75
for: 10m
labels:
severity: warning
annotations:
summary: >-
CPU à {{ raw('$value | printf "%.1f"') }}%
2021-04-01 05:21:08 +02:00
- alert: SystemdServiceFailed
expr: node_systemd_unit_state{state="failed"} == 1
for: 10m
labels:
severity: warning
annotations:
summary: >-
{{ raw('$labels.name') }} a échoué
2021-04-01 05:21:08 +02:00
- alert: LoadUsage
expr: node_load1 > 5
for: 2m
labels:
severity: warning
annotations:
summary: >
Charge à {{ raw('$value') }}
2021-04-01 05:21:08 +02:00
- alert: UpsOutputSourceChanged
expr: upsOutputSource != 3
for: 1m
labels:
severity: critical
annotations:
summary: >-
Source d'alimentation changée
2021-04-01 05:21:08 +02:00
- alert: UpsBatteryStatus
2021-04-01 05:21:08 +02:00
expr: upsBatteryStatus == 3
for: 2m
labels:
severity: warning
annotations:
summary: >-
État de la batterie faible
2021-04-01 05:21:08 +02:00
- alert: UpsBatteryStatus
2021-04-01 05:21:08 +02:00
expr: upsBatteryStatus == 4
for: 10m
labels:
severity: critical
annotations:
summary: >-
État de la batterie critique
2021-04-01 05:21:08 +02:00
- alert: UpsHighLoad
expr: upsOutputPercentLoad > 70
for: 5m
labels:
severity: critical
annotations:
summary: >-
Charge de {{ raw('$value | printf "%.1f"') }}%
2021-04-01 05:21:08 +02:00
- alert: UpsWrongInputVoltage
expr: (upsInputVoltage < 210) or (upsInputVoltage > 250)
for: 10m
labels:
severity: warning
annotations:
summary: >-
Tension d'entrée de {{ raw('$value') }}V
2021-04-01 05:21:08 +02:00
- alert: UpsWrongOutputVoltage
expr: >-
abs(upsInputVoltage - avg_over_time(upsOutputVoltage[1d]))
< 3 * stddev_over_time(upsOutputVoltage[1d])
2021-04-01 05:21:08 +02:00
for: 10m
labels:
severity: warning
annotations:
summary: >-
Tension de sortie de {{ raw('$value') }}V
2021-04-01 05:21:08 +02:00
- alert: UpsTimeRemaining
2021-04-01 05:21:08 +02:00
expr: upsEstimatedMinutesRemaining < 8
for: 1m
labels:
severity: warning
annotations:
summary: >-
Autonomie restante de {{ raw('$value') }} min
2021-04-01 05:21:08 +02:00
- alert: UpsTimeRemaining
2021-04-01 05:21:08 +02:00
expr: upsEstimatedMinutesRemaining < 5
for: 1m
labels:
severity: critical
annotations:
summary: >-
Autonomie restante de {{ raw('$value') }} min
2021-04-01 05:21:08 +02:00
...