From bc4a80979bbf71aaae67682c91b41e300b919b66 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 12 May 2021 21:49:22 +0200 Subject: nixos/prometheus-kea-exporter: init --- .../services/monitoring/prometheus/exporters.nix | 1 + .../monitoring/prometheus/exporters/kea.nix | 38 ++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 nixos/modules/services/monitoring/prometheus/exporters/kea.nix (limited to 'nixos/modules/services/monitoring') diff --git a/nixos/modules/services/monitoring/prometheus/exporters.nix b/nixos/modules/services/monitoring/prometheus/exporters.nix index ce7c215fd14..8e8999e5155 100644 --- a/nixos/modules/services/monitoring/prometheus/exporters.nix +++ b/nixos/modules/services/monitoring/prometheus/exporters.nix @@ -34,6 +34,7 @@ let "fritzbox" "json" "jitsi" + "kea" "keylight" "knot" "lnd" diff --git a/nixos/modules/services/monitoring/prometheus/exporters/kea.nix b/nixos/modules/services/monitoring/prometheus/exporters/kea.nix new file mode 100644 index 00000000000..b6cd89c3866 --- /dev/null +++ b/nixos/modules/services/monitoring/prometheus/exporters/kea.nix @@ -0,0 +1,38 @@ +{ config +, lib +, pkgs +, options +}: + +with lib; + +let + cfg = config.services.prometheus.exporters.kea; +in { + port = 9547; + extraOpts = { + controlSocketPaths = mkOption { + type = types.listOf types.str; + example = literalExample '' + [ + "/run/kea/kea-dhcp4.socket" + "/run/kea/kea-dhcp6.socket" + ] + ''; + description = '' + Paths to kea control sockets + ''; + }; + }; + serviceOpts = { + serviceConfig = { + ExecStart = '' + ${pkgs.prometheus-kea-exporter}/bin/kea-exporter \ + --address ${cfg.listenAddress} \ + --port ${toString cfg.port} \ + ${concatStringsSep " \\n" cfg.controlSocketPaths} + ''; + SupplementaryGroups = [ "kea" ]; + }; + }; +} -- cgit 1.4.1