about summary refs log tree commit diff
path: root/modules/node-exporter.nix
blob: 8e769031435b84be142fddda07fee17b223a8ce1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{
  config,
  lib,
  this,
  ...
}:
with lib;
let
  cfg = config.nixfiles.modules.node-exporter;
in
{
  options.nixfiles.modules.node-exporter.enable = mkEnableOption "Prometheus Node Exporter";

  config = mkIf cfg.enable {
    services.prometheus.exporters.node = {
      enable = true;
      listenAddress = mkDefault this.wireguard.ipv4.address;
      port = 9100;
      enabledCollectors = [
        "buddyinfo"
        "cgroups"
        "ethtool"
        "interrupts"
        "ksmd"
        "lnstat"
        "logind"
        "mountstats"
        "network_route"
        "processes"
        "qdisc"
        "systemd"
        "zoneinfo"
      ];
    };
  };
}

Consider giving Nix/NixOS a try! <3