diff options
Diffstat (limited to 'nixos/tests/prometheus-exporters.nix')
-rw-r--r-- | nixos/tests/prometheus-exporters.nix | 71 |
1 files changed, 65 insertions, 6 deletions
diff --git a/nixos/tests/prometheus-exporters.nix b/nixos/tests/prometheus-exporters.nix index d9a52fa89b1c9..6a4abab7cc126 100644 --- a/nixos/tests/prometheus-exporters.nix +++ b/nixos/tests/prometheus-exporters.nix @@ -177,6 +177,26 @@ let ''; }; + borgmatic = { + exporterConfig = { + enable = true; + user = "root"; + }; + metricProvider = { + services.borgmatic.enable = true; + services.borgmatic.settings.source_directories = [ "/home" ]; + services.borgmatic.settings.repositories = [ { label = "local"; path = "/var/backup"; } ]; + services.borgmatic.settings.keep_daily = 10; + }; + exporterTest = '' + succeed("borgmatic rcreate -e none") + succeed("borgmatic") + wait_for_unit("prometheus-borgmatic-exporter.service") + wait_for_open_port(9996) + succeed("curl -sSf localhost:9996/metrics | grep 'borg_total_backups{repository=\"/var/backup\"} 1'") + ''; + }; + collectd = { exporterConfig = { enable = true; @@ -209,6 +229,34 @@ let ''; }; + deluge = { + exporterConfig = { + enable = true; + port = 1234; + listenAddress = "127.0.0.1"; + + delugeUser = "user"; + delugePort = 2345; + delugePasswordFile = pkgs.writeText "password" "weak_password"; + }; + metricProvider = { + services.deluge.enable = true; + services.deluge.declarative = true; + services.deluge.config.daemon_port = 2345; + services.deluge.authFile = pkgs.writeText "authFile" '' + localclient:abcdef:10 + user:weak_password:10 + ''; + }; + exporterTest = '' + wait_for_unit("deluged.service") + wait_for_open_port(2345) + wait_for_unit("prometheus-deluge-exporter.service") + wait_for_open_port(1234) + succeed("curl -sSf http://localhost:1234 | grep 'deluge_torrents'") + ''; + }; + dnsmasq = { exporterConfig = { enable = true; @@ -953,13 +1001,24 @@ let metricProvider = { services.postgresql.enable = true; services.pgbouncer = { - # https://github.com/prometheus-community/pgbouncer_exporter#pgbouncer-configuration - ignoreStartupParameters = "extra_float_digits"; enable = true; - listenAddress = "*"; - databases = { postgres = "host=/run/postgresql/ port=5432 auth_user=postgres dbname=postgres"; }; - authType = "any"; - maxClientConn = 99; + settings = { + pgbouncer = { + listen_addr = "*"; + auth_type = "any"; + max_client_conn = 99; + # https://github.com/prometheus-community/pgbouncer_exporter#pgbouncer-configuration + ignore_startup_parameters = "extra_float_digits"; + }; + databases = { + postgres = concatStringsSep " " [ + "host=/run/postgresql" + "port=5432" + "auth_user=postgres" + "dbname=postgres" + ]; + }; + }; }; }; exporterTest = '' |