diff --git a/cluster/services/monitoring/blackbox.nix b/cluster/services/monitoring/blackbox.nix index fac2d2b..cb4fb05 100644 --- a/cluster/services/monitoring/blackbox.nix +++ b/cluster/services/monitoring/blackbox.nix @@ -68,12 +68,7 @@ in }; }; blackbox_targets = let - regularTargets = mapTargets { - web = { - module = "https2xx"; - address = "https://www.${domain}"; - }; - }; + regularTargets = mapTargets cluster.config.monitoring.blackbox.targets; secretTargets = mkSecretTargets 1; in regularTargets ++ secretTargets; }; diff --git a/cluster/services/monitoring/default.nix b/cluster/services/monitoring/default.nix index 7de69f3..029690b 100644 --- a/cluster/services/monitoring/default.nix +++ b/cluster/services/monitoring/default.nix @@ -9,6 +9,10 @@ let in { + imports = [ + ./options.nix + ]; + links = { loki-ingest = { protocol = "http"; diff --git a/cluster/services/monitoring/options.nix b/cluster/services/monitoring/options.nix new file mode 100644 index 0000000..bce4a37 --- /dev/null +++ b/cluster/services/monitoring/options.nix @@ -0,0 +1,25 @@ +{ lib, ... }: +with lib; + +{ + options.monitoring = { + blackbox = { + targets = mkOption { + description = "Blackbox targets to be monitored by the cluster."; + default = {}; + type = with types; attrsOf (submodule ({ ... }: { + options = { + module = mkOption { + description = "The Blackbox module to use."; + type = types.str; + }; + address = mkOption { + description = "The target's address."; + type = types.str; + }; + }; + })); + }; + }; + }; +}