nixos/prometheus-blackbox-exporter: add config check
This commit is contained in:
parent
dcc12cea9f
commit
c28ded36ef
@ -4,6 +4,13 @@ with lib;
|
|||||||
|
|
||||||
let
|
let
|
||||||
cfg = config.services.prometheus.exporters.blackbox;
|
cfg = config.services.prometheus.exporters.blackbox;
|
||||||
|
|
||||||
|
checkConfig = file: pkgs.runCommand "checked-blackbox-exporter.conf" {
|
||||||
|
preferLocalBuild = true;
|
||||||
|
buildInputs = [ pkgs.buildPackages.prometheus-blackbox-exporter ]; } ''
|
||||||
|
ln -s ${file} $out
|
||||||
|
blackbox_exporter --config.check --config.file $out
|
||||||
|
'';
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
port = 9115;
|
port = 9115;
|
||||||
@ -21,7 +28,7 @@ in
|
|||||||
ExecStart = ''
|
ExecStart = ''
|
||||||
${pkgs.prometheus-blackbox-exporter}/bin/blackbox_exporter \
|
${pkgs.prometheus-blackbox-exporter}/bin/blackbox_exporter \
|
||||||
--web.listen-address ${cfg.listenAddress}:${toString cfg.port} \
|
--web.listen-address ${cfg.listenAddress}:${toString cfg.port} \
|
||||||
--config.file ${cfg.configFile} \
|
--config.file ${checkConfig cfg.configFile} \
|
||||||
${concatStringsSep " \\\n " cfg.extraFlags}
|
${concatStringsSep " \\\n " cfg.extraFlags}
|
||||||
'';
|
'';
|
||||||
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
|
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user