From c28e51e07fcbba6c6ea3f1442e691e46f0bf3d0a Mon Sep 17 00:00:00 2001 From: g4st3r Date: Sat, 7 Mar 2026 21:19:20 +0000 Subject: [PATCH] Translate alerts and tune container alert --- monitoring/alertmanager/alertmanager.yml | 8 ++++---- monitoring/rules/base-alerts.yml | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/monitoring/alertmanager/alertmanager.yml b/monitoring/alertmanager/alertmanager.yml index 55fca59..a2f1319 100644 --- a/monitoring/alertmanager/alertmanager.yml +++ b/monitoring/alertmanager/alertmanager.yml @@ -18,10 +18,10 @@ receivers: {{ if eq .Labels.severity "critical" }}🔴{{ else }}⚠️{{ end }} *{{ .Labels.alertname }}* ({{ .Labels.severity }}) {{ .Annotations.summary }} {{ .Annotations.description }} - Instance: {{ .Labels.instance }} - Details (Prometheus): {{ reReplaceAll "http://[^/]+" "https://prometheus.g4st3r.ru" .GeneratorURL }} - Details (Grafana): {{ if eq .Labels.instance "10.8.0.1:9100" }}https://grafana.g4st3r.ru/d/bffbyigsryj28c{{ else if eq .Labels.instance "node-exporter:9100" }}https://grafana.g4st3r.ru/d/affbyigukvw1sc{{ else }}https://grafana.g4st3r.ru{{ end }} - Graph (PNG): {{ if eq .Labels.instance "10.8.0.1:9100" }}https://grafana.g4st3r.ru/render/d/bffbyigsryj28c?orgId=1&from=now-6h&to=now&width=1000&height=500&theme=dark{{ else if eq .Labels.instance "node-exporter:9100" }}https://grafana.g4st3r.ru/render/d/affbyigukvw1sc?orgId=1&from=now-6h&to=now&width=1000&height=500&theme=dark{{ else }}https://grafana.g4st3r.ru{{ end }} + Инстанс: {{ .Labels.instance }} + Ссылка (Prometheus): {{ reReplaceAll "http://[^/]+" "https://prometheus.g4st3r.ru" .GeneratorURL }} + Ссылка (Grafana): {{ if eq .Labels.alertname "DockerContainerDown" }}https://grafana.g4st3r.ru/d/affbyigwgb5dsb{{ else if eq .Labels.instance "10.8.0.1:9100" }}https://grafana.g4st3r.ru/d/bffbyigsryj28c{{ else if eq .Labels.instance "node-exporter:9100" }}https://grafana.g4st3r.ru/d/affbyigukvw1sc{{ else }}https://grafana.g4st3r.ru{{ end }} + График (PNG): {{ if eq .Labels.alertname "DockerContainerDown" }}https://grafana.g4st3r.ru/render/d/affbyigwgb5dsb?orgId=1&from=now-6h&to=now&width=1000&height=500&theme=dark{{ else if eq .Labels.instance "10.8.0.1:9100" }}https://grafana.g4st3r.ru/render/d/bffbyigsryj28c?orgId=1&from=now-6h&to=now&width=1000&height=500&theme=dark{{ else if eq .Labels.instance "node-exporter:9100" }}https://grafana.g4st3r.ru/render/d/affbyigukvw1sc?orgId=1&from=now-6h&to=now&width=1000&height=500&theme=dark{{ else }}https://grafana.g4st3r.ru{{ end }} {{ end }} parse_mode: Markdown disable_notifications: false diff --git a/monitoring/rules/base-alerts.yml b/monitoring/rules/base-alerts.yml index 47e0aea..7e3dc0a 100644 --- a/monitoring/rules/base-alerts.yml +++ b/monitoring/rules/base-alerts.yml @@ -83,13 +83,13 @@ groups: description: "{{ $labels.mountpoint }} usage above 95%" - alert: DockerContainerDown - expr: time() - container_last_seen > 120 - for: 2m + expr: time() - container_last_seen{image!="",container!=""} > 300 + for: 5m labels: severity: warning annotations: - summary: "Container down" - description: "A container has not been seen for >2m" + summary: "Контейнер недоступен" + description: "Контейнер не виден >5 минут" - alert: HttpEndpointDown expr: probe_success{job="blackbox-http"} == 0