2021-02-16 23:08:45 -08:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
pkgs,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}:
|
|
|
|
|
2024-04-24 14:41:17 -04:00
|
|
|
let
|
|
|
|
cfg = config.services.prometheus.exporters.systemd;
|
|
|
|
inherit (lib) concatStringsSep;
|
2021-02-16 23:08:45 -08:00
|
|
|
in
|
|
|
|
{
|
|
|
|
port = 9558;
|
|
|
|
|
|
|
|
serviceOpts = {
|
|
|
|
serviceConfig = {
|
|
|
|
ExecStart = ''
|
|
|
|
${pkgs.prometheus-systemd-exporter}/bin/systemd_exporter \
|
2021-11-19 13:09:56 -05:00
|
|
|
--web.listen-address ${cfg.listenAddress}:${toString cfg.port} ${concatStringsSep " " cfg.extraFlags}
|
2021-02-16 23:08:45 -08:00
|
|
|
'';
|
2021-08-08 16:48:49 +02:00
|
|
|
RestrictAddressFamilies = [
|
|
|
|
# Need AF_UNIX to collect data
|
|
|
|
"AF_UNIX"
|
|
|
|
];
|
2021-02-16 23:08:45 -08:00
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|