prometheus-rules #62
3 changed files with 60 additions and 0 deletions
|
@ -41,6 +41,7 @@
|
|||
- django.rules.yml
|
||||
- ups.rules.yml
|
||||
- postgres.rules.yml
|
||||
- environmental.rules.yml
|
||||
notify: Restart Prometheus
|
||||
|
||||
- name: Make Prometheus snmp-exporter listen on localhost only
|
||||
|
|
52
roles/prometheus/templates/environmental.rules.yml.j2
Normal file
52
roles/prometheus/templates/environmental.rules.yml.j2
Normal 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') }}°
|
||||
|
||||
|
||||
|
||||
...
|
|
@ -20,6 +20,13 @@
|
|||
- alert.rules.yml
|
||||
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
|
||||
- name: Configure Prometheus Federate devices
|
||||
copy:
|
||||
|
|
Loading…
Reference in a new issue