nixos/prometheus-kea-exporter: init

Changed files
+39
nixos
modules
services
monitoring
prometheus
+1
nixos/modules/services/monitoring/prometheus/exporters.nix
···
"fritzbox"
"json"
"jitsi"
+
"kea"
"keylight"
"knot"
"lnd"
+38
nixos/modules/services/monitoring/prometheus/exporters/kea.nix
···
+
{ 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" ];
+
};
+
};
+
}