From e6ed60548397627bf10f561f9438201dbba0a36e Mon Sep 17 00:00:00 2001 From: Azat Bahawi Date: Sun, 21 Apr 2024 02:15:42 +0300 Subject: 2024-04-21 --- modules/node-exporter.nix | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 modules/node-exporter.nix (limited to 'modules/node-exporter.nix') diff --git a/modules/node-exporter.nix b/modules/node-exporter.nix new file mode 100644 index 0000000..8e76903 --- /dev/null +++ b/modules/node-exporter.nix @@ -0,0 +1,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" + ]; + }; + }; +} -- cgit 1.4.1