Kepp federated datas 4 months (120 days)
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

This commit is contained in:
pz2891 2021-08-20 19:31:04 +02:00
parent f17e7f7524
commit cc3b4294ae
3 changed files with 60 additions and 0 deletions

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: