From c07d96bbab22e7491b32a2f632c0a67ec91ae7e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torjus=20H=C3=A5kestad?= Date: Sun, 18 May 2025 01:12:04 +0200 Subject: [PATCH] Add alert for wireguard handshake --- services/monitoring/prometheus.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/services/monitoring/prometheus.nix b/services/monitoring/prometheus.nix index 068090f..39538e7 100644 --- a/services/monitoring/prometheus.nix +++ b/services/monitoring/prometheus.nix @@ -218,6 +218,16 @@ annotations: summary: SMART Wearout Indicator (instance {{ $labels.instance }}) description: "Device is wearing out on {{ $labels.instance }} drive {{ $labels.device }})\n VALUE = {{ $value }}\n LABELS = {{ $labels }}" + - name: wireguard_rules + rules: + - alert: WireguardHandshake + expr: (time() - wireguard_latest_handshake_seconds{instance="http-proxy.home.2rjus.net:9586",interface="wg0",public_key="32Rb13wExcy8uI92JTnFdiOfkv0mlQ6f181WA741DHs="}) > 300 + for: 1m + labels: + severity: warning + annotations: + summary: "Wireguard handshake timeout on {{ $labels.instance }}" + description: "Wireguard handshake timeout on {{ $labels.instance }} for more than 1 minutes." '' ];