From 6c046a549e94429fb6915fa11c0ee719d87a854c Mon Sep 17 00:00:00 2001 From: Dominik Polakovics Date: Mon, 1 Dec 2025 13:29:37 +0100 Subject: [PATCH] feat: change pushover emergency on alerts --- hosts/web-arm/modules/grafana/default.nix | 69 +++++++++++++++-------- 1 file changed, 47 insertions(+), 22 deletions(-) diff --git a/hosts/web-arm/modules/grafana/default.nix b/hosts/web-arm/modules/grafana/default.nix index 82f1fd2..f9e2040 100644 --- a/hosts/web-arm/modules/grafana/default.nix +++ b/hosts/web-arm/modules/grafana/default.nix @@ -103,27 +103,44 @@ in contactPoints = { settings = { apiVersion = 1; - contactPoints = [{ - orgId = 1; - name = "cp_dominik"; - receivers = [{ - uid = "dominik_pushover_cp_receiver"; - type = "pushover"; - settings = { - apiToken = "\${PUSHOVER_API_TOKEN}"; - userKey = "\${PUSHOVER_USER_KEY}"; - device = "iphone"; - priority = 2; - retry = "30s"; - expire = "2m"; - sound = "siren"; - okSound = "magic"; - message = '' - {{ template "default.message" . }} - ''; - }; - }]; - }]; + contactPoints = [ + { + orgId = 1; + name = "cp_dominik_emergency"; + receivers = [{ + uid = "dominik_pushover_emergency"; + type = "pushover"; + settings = { + apiToken = "\${PUSHOVER_API_TOKEN}"; + userKey = "\${PUSHOVER_USER_KEY}"; + device = "iphone"; + priority = 2; + retry = "30s"; + expire = "2m"; + sound = "siren"; + okSound = "magic"; + message = ''{{ template "default.message" . }}''; + }; + }]; + } + { + orgId = 1; + name = "cp_dominik_normal"; + receivers = [{ + uid = "dominik_pushover_normal"; + type = "pushover"; + settings = { + apiToken = "\${PUSHOVER_API_TOKEN}"; + userKey = "\${PUSHOVER_USER_KEY}"; + device = "iphone"; + priority = 1; + sound = "siren"; + okSound = "magic"; + message = ''{{ template "default.message" . }}''; + }; + }]; + } + ]; }; }; @@ -131,7 +148,15 @@ in settings = { apiVersion = 1; policies = [{ - receiver = "cp_dominik"; + receiver = "cp_dominik_normal"; + repeat_interval = "999d"; + routes = [ + { + receiver = "cp_dominik_emergency"; + matchers = [ "alertname = HostDown" ]; + repeat_interval = "999d"; + } + ]; }]; }; };