feat(monitoring): integrate alertmanager-ntfy and fix host dropdown in node exporter dashboard
ansible-core-mon / deploy (push) Failing after 21s
ansible-core-net / deploy (push) Successful in 24s
ansible-core-secrets / deploy (push) Successful in 13s
ansible-rus-central / deploy (push) Successful in 1m1s

This commit is contained in:
karpenok committed 2026-11-11 20:54:55 +07:00
1 parent bf4144a767
commit 317b5d6207
8 files changed
+92 -18

No files matched your search

@@ -0,0 +1,34 @@
http:
addr: :8000
ntfy:
baseurl: http://ntfy:80
auth:
basic:
username: "{{ ntfy_admin_user }}"
password: "{{ ntfy_admin_password }}"
notification:
topic: "{{ ntfy_default_topic }}"
priority: |
status == "firing" ? (labels.severity == "critical" ? "urgent" : "high") : "default"
tags:
- tag: white_check_mark
condition: status == "resolved"
- tag: rotating_light
condition: status == "firing" && labels.severity == "critical"
- tag: warning
condition: status == "firing" && labels.severity != "critical"
templates:
title: |
{{ if eq .Status "resolved" }}✅ [Восстановлено] {{ index .Labels "alertname" }}: {{ if index .Labels "host" }}{{ index .Labels "host" }}{{ else }}{{ index .Labels "instance" }}{{ end }}{{ else }}🚨 [СБОЙ] {{ index .Annotations "summary" }}{{ end }}
description: |
{{ if eq .Status "resolved" }}Работа сервиса полностью восстановлена.{{ else }}{{ index .Annotations "description" }}{{ end }}
Хост: {{ if index .Labels "host" }}{{ index .Labels "host" }}{{ else }}{{ index .Labels "instance" }}{{ end }}
Критичность: {{ index .Labels "severity" }}
headers:
X-Click: |
https://graf.gunihome.ru
X-Actions: |
view, 📊 Открыть Grafana, https://graf.gunihome.ru, clear=true
async: false
@@ -11,10 +11,6 @@ route:
receivers:
- name: 'ntfy'
webhook_configs:
- url: "http://ntfy:80/{{ ntfy_default_topic }}"
- url: "http://alertmanager-ntfy:8000/hook"
send_resolved: true
http_config:
basic_auth:
username: "{{ ntfy_admin_user }}"
password: "{{ ntfy_admin_password }}"
@@ -51,6 +51,17 @@ services:
ports:
- "80:80"
alertmanager-ntfy:
image: ghcr.io/alexbakker/alertmanager-ntfy:latest
container_name: monitoring-alertmanager-ntfy
restart: unless-stopped
command:
- "--configs=/etc/alertmanager-ntfy/config.yml"
volumes:
- ./alertmanager-ntfy/config.yml:/etc/alertmanager-ntfy/config.yml:ro
depends_on:
- ntfy
grafana:
image: grafana/grafana:11.5.2
container_name: monitoring-grafana