mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-11-22 08:34:38 +01:00
https://github.com/mweinelt/kea-exporter/blob/v0.7.0/HISTORY Updates the module to use the target name, because it now supports both UDS as well as HTTP URLs.
54 lines
1.1 KiB
Nix
54 lines
1.1 KiB
Nix
{ config
|
|
, lib
|
|
, pkgs
|
|
, utils
|
|
, ...
|
|
}:
|
|
|
|
with lib;
|
|
|
|
let
|
|
cfg = config.services.prometheus.exporters.kea;
|
|
in {
|
|
imports = [
|
|
(mkRenamedOptionModule [ "controlSocketPaths" ] [ "targets" ])
|
|
];
|
|
port = 9547;
|
|
extraOpts = {
|
|
targets = mkOption {
|
|
type = types.listOf types.str;
|
|
example = literalExpression ''
|
|
[
|
|
"/run/kea/kea-dhcp4.socket"
|
|
"/run/kea/kea-dhcp6.socket"
|
|
"http://127.0.0.1:8547"
|
|
]
|
|
'';
|
|
description = lib.mdDoc ''
|
|
Paths or URLs to the Kea control socket.
|
|
'';
|
|
};
|
|
};
|
|
serviceOpts = {
|
|
after = [
|
|
"kea-dhcp4-server.service"
|
|
"kea-dhcp6-server.service"
|
|
];
|
|
serviceConfig = {
|
|
User = "kea";
|
|
DynamicUser = true;
|
|
ExecStart = utils.escapeSystemdExecArgs ([
|
|
(lib.getExe pkgs.prometheus-kea-exporter)
|
|
"--address" cfg.listenAddress
|
|
"--port" cfg.port
|
|
] ++ cfg.extraFlags ++ cfg.targets);
|
|
RuntimeDirectory = "kea";
|
|
RuntimeDirectoryPreserve = true;
|
|
RestrictAddressFamilies = [
|
|
# Need AF_UNIX to collect data
|
|
"AF_UNIX"
|
|
];
|
|
};
|
|
};
|
|
}
|