milahu / nixpkgs

Nix Packages collection
MIT License
1 stars 0 forks source link

prometheus.exporters.qbittorrent: init #77

Open milahu opened 2 months ago

milahu commented 2 months ago

fix https://github.com/NixOS/nixpkgs/issues/264637

example config, using nur.repos.milahu.prometheus-qbittorrent-exporter

/etc/nixos/configuration.nix ```nix { # override nixos modules # https://stackoverflow.com/a/46407944/10440128 disabledModules = [ "services/monitoring/prometheus/exporters.nix" ]; imports = [ /home/user/src/nixpkgs/nixos/modules/services/monitoring/prometheus/exporters.nix ]; # https://nixos.wiki/wiki/Grafana # nixpkgs/nixos/modules/services/monitoring/grafana.nix # https://xeiaso.net/blog/prometheus-grafana-loki-nixos-2020-11-20/ # http://localhost:3000/ # login: admin:admin services.grafana = { enable = true; declarativePlugins = with pkgs.grafanaPlugins; [ grafana-piechart-panel # for prometheus-qbittorrent-exporter ]; }; # https://xeiaso.net/blog/prometheus-grafana-loki-nixos-2020-11-20/ services.prometheus = { enable = true; port = 9001; # /var/lib/prometheus2/ #retentionTime = "15d"; # default -> 80 MB retentionTime = "740d"; # 2 years -> 4 GB exporters = { node = { enable = true; enabledCollectors = [ "systemd" ]; port = 9002; }; qbittorrent = { enable = true; port = 9003; qbittorrentPort = 1952; package = pkgs.nur.repos.milahu.prometheus-qbittorrent-exporter; }; }; scrapeConfigs = [ { job_name = "chrysalis"; static_configs = [{ targets = [ "127.0.0.1:${toString config.services.prometheus.exporters.node.port}" "127.0.0.1:${toString config.services.prometheus.exporters.qbittorrent.port}" ]; }]; } ]; }; } ```

ping @riley-martine

feel free to create a PR for https://github.com/NixOS/nixpkgs i am banned for "hatespeech"