prometheus-rules #62

Merged
pz2891 merged 11 commits from prometheus-rules into master 2021-09-08 10:16:04 +02:00
3 changed files with 60 additions and 0 deletions
Showing only changes of commit cc3b4294ae - Show all commits

View file

@ -41,6 +41,7 @@
- django.rules.yml - django.rules.yml
- ups.rules.yml - ups.rules.yml
- postgres.rules.yml - postgres.rules.yml
- environmental.rules.yml
notify: Restart Prometheus notify: Restart Prometheus
- name: Make Prometheus snmp-exporter listen on localhost only - name: Make Prometheus snmp-exporter listen on localhost only

View file

@ -0,0 +1,52 @@
---
{{ ansible_managed | comment }}
{% macro raw(string) -%}
{{ "{{" }} {{ string }} {{ "}}" }}
{%- endmacro %}
groups:
- name: environmental.rules
rules:
- alert: EnvironmentalTemperature
expr: rPDU2SensorTempHumidityStatusTempC / 10 > 30
for: 10m
labels:
severity: warning
annotations:
summary: >-
Température environnementale à {{ raw('$value') }}°
- alert: EnvironmentalTemperature
expr: rPDU2SensorTempHumidityStatusTempC / 10 > 40
for: 10m
labels:
severity: critical
annotations:
summary: >-
Température environnementale à {{ raw('$value') }}°
- alert: EnvironmentalTemperature
expr: xupsEnvRemoteTemp > 30
for: 10m
labels:
severity: warning
annotations:
summary: >-
Température environnementale à {{ raw('$value') }}°
- alert: EnvironmentalTemperature
expr: xupsEnvRemoteTemp > 40
for: 10m
labels:
severity: critical
annotations:
summary: >-
Température environnementale à {{ raw('$value') }}°
...

View file

@ -20,6 +20,13 @@
- alert.rules.yml - alert.rules.yml
notify: Restart Prometheus notify: Restart Prometheus
- name: Define Prometheus retention time
lineinfile:
path: /etc/default/prometheus
regexp: '^ARGS=\"--log.level=debug\"'
line: "ARGS=\"--log.level=debug --storage.tsdb.retention.time=120d\""
notify: Restart Prometheus
# We don't need to restart Prometheus when updating nodes # We don't need to restart Prometheus when updating nodes
- name: Configure Prometheus Federate devices - name: Configure Prometheus Federate devices
copy: copy: