2021-04-11 16:43:34 +02:00
|
|
|
---
|
|
|
|
{{ ansible_managed | comment }}
|
|
|
|
|
|
|
|
{% macro raw(string) -%}
|
|
|
|
{{ "{{" }} {{ string }} {{ "}}" }}
|
|
|
|
{%- endmacro %}
|
|
|
|
|
|
|
|
groups:
|
|
|
|
|
|
|
|
- name: docker.rules
|
|
|
|
rules:
|
|
|
|
|
2021-04-11 17:18:32 +02:00
|
|
|
- alert: ContainerDown
|
|
|
|
expr: docker_container_running_state != 1
|
|
|
|
for: 0m
|
|
|
|
labels:
|
|
|
|
severity: critical
|
|
|
|
annotations:
|
|
|
|
summary: >-
|
2021-04-12 11:01:43 +02:00
|
|
|
Le container Docker est éteint / tombé
|
2021-04-14 19:54:37 +02:00
|
|
|
(container {{ raw('$labels.name') }})
|
2021-04-11 17:18:32 +02:00
|
|
|
|
|
|
|
- alert: ContainerFailed
|
|
|
|
expr: sum(increase(docker_container_restart_count[5m])) > 2
|
|
|
|
for: 0m
|
|
|
|
labels:
|
|
|
|
severity: critical
|
|
|
|
annotations:
|
|
|
|
summary: >-
|
2021-04-12 11:01:43 +02:00
|
|
|
Le container Docker redémarre souvent
|
2021-04-14 19:54:37 +02:00
|
|
|
(container {{ raw('$labels.name') }})
|
2021-04-11 17:18:32 +02:00
|
|
|
|
|
|
|
- alert: ContainerFailed
|
|
|
|
expr:
|
|
|
|
(
|
|
|
|
docker_container_cpu_used_total
|
|
|
|
/
|
|
|
|
docker_container_cpu_capacity_total
|
|
|
|
) * 100
|
|
|
|
> 30
|
|
|
|
for: 0m
|
|
|
|
labels:
|
|
|
|
severity: critical
|
|
|
|
annotations:
|
|
|
|
summary: >-
|
2021-04-12 11:01:43 +02:00
|
|
|
Le container Docker utilise beaucoup de CPU
|
2021-04-14 19:54:37 +02:00
|
|
|
(container {{ raw('$labels.name') }},
|
|
|
|
valeur {{ raw('$value | printf "%.1f"') }})
|
2021-04-11 17:18:32 +02:00
|
|
|
|
2021-04-11 16:43:34 +02:00
|
|
|
...
|