mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-24 16:03:23 +00:00
nixos/prometheus-blackbox-exporter: add config check
This commit is contained in:
parent
dcc12cea9f
commit
c28ded36ef
@ -4,6 +4,13 @@ with lib;
|
||||
|
||||
let
|
||||
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
|
||||
{
|
||||
port = 9115;
|
||||
@ -21,7 +28,7 @@ in
|
||||
ExecStart = ''
|
||||
${pkgs.prometheus-blackbox-exporter}/bin/blackbox_exporter \
|
||||
--web.listen-address ${cfg.listenAddress}:${toString cfg.port} \
|
||||
--config.file ${cfg.configFile} \
|
||||
--config.file ${checkConfig cfg.configFile} \
|
||||
${concatStringsSep " \\\n " cfg.extraFlags}
|
||||
'';
|
||||
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
|
||||
|
Loading…
Reference in New Issue
Block a user