From 254b510ce71414519b7b0c9340ac011581d2addd Mon Sep 17 00:00:00 2001 From: WilliButz Date: Sun, 17 Jan 2021 12:15:40 +0100 Subject: [PATCH] nixos/promtheus-nextcloud-exporter: update module and test Use new command-line flags of release 0.3.0 and always answer with the expected XML in the VM test instead of using a test-specific fixed path. Co-authored-by: ajs124 --- .../monitoring/prometheus/exporters/nextcloud.nix | 10 +++++----- nixos/tests/prometheus-exporters.nix | 3 ++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/nixos/modules/services/monitoring/prometheus/exporters/nextcloud.nix b/nixos/modules/services/monitoring/prometheus/exporters/nextcloud.nix index aee6bd5e66ce..ce7125bf5a83 100644 --- a/nixos/modules/services/monitoring/prometheus/exporters/nextcloud.nix +++ b/nixos/modules/services/monitoring/prometheus/exporters/nextcloud.nix @@ -46,11 +46,11 @@ in DynamicUser = false; ExecStart = '' ${pkgs.prometheus-nextcloud-exporter}/bin/nextcloud-exporter \ - -a ${cfg.listenAddress}:${toString cfg.port} \ - -u ${cfg.username} \ - -t ${cfg.timeout} \ - -l ${cfg.url} \ - -p ${escapeShellArg "@${cfg.passwordFile}"} \ + --addr ${cfg.listenAddress}:${toString cfg.port} \ + --username ${cfg.username} \ + --timeout ${cfg.timeout} \ + --server ${cfg.url} \ + --password ${escapeShellArg "@${cfg.passwordFile}"} \ ${concatStringsSep " \\\n " cfg.extraFlags} ''; }; diff --git a/nixos/tests/prometheus-exporters.nix b/nixos/tests/prometheus-exporters.nix index 8fcb0a7aa2c3..89d17c9de8c0 100644 --- a/nixos/tests/prometheus-exporters.nix +++ b/nixos/tests/prometheus-exporters.nix @@ -423,7 +423,7 @@ let exporterConfig = { enable = true; passwordFile = "/var/nextcloud-pwfile"; - url = "http://localhost/negative-space.xml"; + url = "http://localhost"; }; metricProvider = { systemd.services.nc-pwfile = let @@ -441,6 +441,7 @@ let basicAuth.nextcloud-exporter = "snakeoilpw"; locations."/" = { root = "${pkgs.prometheus-nextcloud-exporter.src}/serverinfo/testdata"; + tryFiles = "/negative-space.xml =404"; }; }; };