mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-22 06:53:01 +00:00
nixos/tests/prometheus-exporters: add exportarr-sonarr test (#285119)
This commit is contained in:
commit
5634c21398
@ -356,6 +356,46 @@ let
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
exportarr-sonarr = let apikey = "eccff6a992bc2e4b88e46d064b26bb4e"; in {
|
||||||
|
nodeName = "exportarr_sonarr";
|
||||||
|
exporterConfig = {
|
||||||
|
enable = true;
|
||||||
|
url = "http://127.0.0.1:8989";
|
||||||
|
apiKeyFile = pkgs.writeText "dummy-api-key" apikey;
|
||||||
|
};
|
||||||
|
metricProvider = {
|
||||||
|
services.sonarr.enable = true;
|
||||||
|
systemd.services.sonarr.serviceConfig.ExecStartPre =
|
||||||
|
let
|
||||||
|
sonarr_config = pkgs.writeText "config.xml" ''
|
||||||
|
<Config>
|
||||||
|
<LogLevel>info</LogLevel>
|
||||||
|
<EnableSsl>False</EnableSsl>
|
||||||
|
<Port>8989</Port>
|
||||||
|
<SslPort>9898</SslPort>
|
||||||
|
<UrlBase></UrlBase>
|
||||||
|
<BindAddress>*</BindAddress>
|
||||||
|
<ApiKey>${apikey}</ApiKey>
|
||||||
|
<AuthenticationMethod>None</AuthenticationMethod>
|
||||||
|
<UpdateMechanism>BuiltIn</UpdateMechanism>
|
||||||
|
<Branch>main</Branch>
|
||||||
|
<InstanceName>Sonarr</InstanceName>
|
||||||
|
</Config>
|
||||||
|
'';
|
||||||
|
in
|
||||||
|
[
|
||||||
|
''${pkgs.coreutils}/bin/install -D -m 777 ${sonarr_config} -T /var/lib/sonarr/.config/NzbDrone/config.xml''
|
||||||
|
];
|
||||||
|
};
|
||||||
|
exporterTest = ''
|
||||||
|
wait_for_unit("sonarr.service")
|
||||||
|
wait_for_open_port(8989)
|
||||||
|
wait_for_unit("prometheus-exportarr-sonarr-exporter.service")
|
||||||
|
wait_for_open_port(9708)
|
||||||
|
succeed("curl -sSf http://localhost:9708/metrics | grep sonarr_series_total")
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
fastly = {
|
fastly = {
|
||||||
exporterConfig = {
|
exporterConfig = {
|
||||||
enable = true;
|
enable = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user