diff --git a/config/services.nix b/config/services.nix index c0ab036..fe3e0c1 100644 --- a/config/services.nix +++ b/config/services.nix @@ -39,4 +39,12 @@ rec { port = 8081; }; + "metric-exporter" = { + port = 9100; + collectors = [ + "systemd" + "processes" + "thermal_zone" + ]; + }; } diff --git a/services/node-exporter.nix b/services/node-exporter.nix new file mode 100644 index 0000000..c313e8e --- /dev/null +++ b/services/node-exporter.nix @@ -0,0 +1,12 @@ +{ config, pkgs, lib, ... }: +let + serv = import ../config/services.nix; +in { + services.prometheus.exporters.node = { + enable = true; + port = serv."metric-exporter".port; + enabledCollectors = serv."metric-exporter".collectors; + }; + + networking.firewall.allowedTCPPorts = [ serv."metric-exporter".port ]; +}