Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prometheus.exporters.qbittorrent: init #77

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

milahu
Copy link
Owner

@milahu milahu commented Sep 20, 2024

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