From ce301ef21a90189fc5d7958a26a5447d486f422d Mon Sep 17 00:00:00 2001 From: Franz Pletz Date: Wed, 25 Oct 2017 18:21:46 +0200 Subject: prometheus-node-exporter service: add disabledCollectors option --- .../modules/services/monitoring/prometheus/node-exporter.nix | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'nixos/modules/services/monitoring') diff --git a/nixos/modules/services/monitoring/prometheus/node-exporter.nix b/nixos/modules/services/monitoring/prometheus/node-exporter.nix index d464ec8a7f54..908483037d12 100644 --- a/nixos/modules/services/monitoring/prometheus/node-exporter.nix +++ b/nixos/modules/services/monitoring/prometheus/node-exporter.nix @@ -37,6 +37,15 @@ in { ''; }; + disabledCollectors = mkOption { + type = types.listOf types.str; + default = []; + example = ''[ "timex" ]''; + description = '' + Collectors to disable which are enabled by default. + ''; + }; + extraFlags = mkOption { type = types.listOf types.str; default = []; @@ -64,7 +73,8 @@ in { wantedBy = [ "multi-user.target" ]; script = '' exec ${pkgs.prometheus-node-exporter}/bin/node_exporter \ - ${concatMapStrings (x: "--collector." + x + " ") cfg.enabledCollectors} \ + ${concatMapStringsSep " " (x: "--collector." + x) cfg.enabledCollectors} \ + ${concatMapStringsSep " " (x: "--no-collector." + x) cfg.disabledCollectors} \ --web.listen-address ${cfg.listenAddress}:${toString cfg.port} \ ${concatStringsSep " \\\n " cfg.extraFlags} ''; -- cgit 1.4.1