Skip to content

prometheus.exporters.qbittorrent: init#77

Draft
milahu wants to merge 1 commit into
masterfrom
add-prometheus-exporter-qbittorrent
Draft

prometheus.exporters.qbittorrent: init#77
milahu wants to merge 1 commit into
masterfrom
add-prometheus-exporter-qbittorrent

Conversation

@milahu

@milahu milahu commented Sep 20, 2024

Copy link
Copy Markdown
Owner

fix NixOS#264637

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

/etc/nixos/configuration.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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Package request: prometheus-qbittorrent-exporter

1 participant