From 715201abc28b136ce27aca440ce16ad1c6f2f465 Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Sun, 8 Dec 2024 16:38:29 +0100 Subject: [PATCH] fix(rescue01): Filter nodes to only include real servers --- machines/nixos/rescue01/uptime-kuma.nix | 32 +++++++++++++++---------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/machines/nixos/rescue01/uptime-kuma.nix b/machines/nixos/rescue01/uptime-kuma.nix index 326d359..8082917 100644 --- a/machines/nixos/rescue01/uptime-kuma.nix +++ b/machines/nixos/rescue01/uptime-kuma.nix @@ -1,6 +1,7 @@ { config, lib, + meta, nodes, sources, ... @@ -8,6 +9,7 @@ let inherit (lib) concatLists + filterAttrs mapAttrsToList mkForce mkMerge @@ -20,6 +22,8 @@ let probesWithTag ; + serverNodes = filterAttrs (name: _: meta.nodes.${name}.nixpkgs.system == "nixos") nodes; + probesCfg = config.statelessUptimeKuma.probesConfig; mkMonitors = name: builtins.attrNames (probesWithTag { inherit name; } probesCfg); @@ -28,16 +32,18 @@ let port = 3001; - httpExcludes = [ - "localhost" - "ens.cal.dgnum.eu" - "luj-current.cal.dgnum.eu" - "s3.dgnum.eu" - "cdn.dgnum.eu" - "saml-idp.dgnum.eu" - "status.dgnum.eu" - "radius.dgnum.eu" - ] ++ (concatLists (mapAttrsToList (_: { config, ... }: config.dgn-redirections.retired) nodes)); + httpExcludes = + [ + "localhost" + "ens.cal.dgnum.eu" + "luj-current.cal.dgnum.eu" + "s3.dgnum.eu" + "cdn.dgnum.eu" + "saml-idp.dgnum.eu" + "status.dgnum.eu" + "radius.dgnum.eu" + ] + ++ (concatLists (mapAttrsToList (_: { config, ... }: config.dgn-redirections.retired) serverNodes)); extraProbes = { monitors = { @@ -88,7 +94,7 @@ let }; pingProbes = pingProbesFromHive { - inherit nodes; + nodes = serverNodes; mkHost = _: config: config.networking.fqdn; tags = [ { name = "Ping"; } ]; excludes = [ @@ -99,7 +105,7 @@ let }; vpnProbes = pingProbesFromHive { - inherit nodes; + nodes = serverNodes; prefix = "VPN - "; mkHost = node: _: "${node}.dgnum"; tags = [ { name = "VPN"; } ]; @@ -110,7 +116,7 @@ let }; httpProbes = fromHive { - inherit nodes; + nodes = serverNodes; builder = _: module: httpProbesFromConfig {