diff --git a/config/services.nix b/config/services.nix index 9c8344e..7101abc 100644 --- a/config/services.nix +++ b/config/services.nix @@ -20,4 +20,12 @@ turn_relay_range_start = 50300; turn_relay_range_end = 50400; }; + + "metric-exporter" = { + port = 9100; + collectors = [ + "systemd" + "processes" + ]; + }; } \ No newline at end of file diff --git a/services/default.nix b/services/default.nix index 5881602..5307fb7 100644 --- a/services/default.nix +++ b/services/default.nix @@ -4,5 +4,6 @@ ./openssh.nix ./nginx.nix ./livekit.nix + ./node-exporter.nix ]; } \ No newline at end of file diff --git a/services/node-exporter.nix b/services/node-exporter.nix new file mode 100644 index 0000000..f344a15 --- /dev/null +++ b/services/node-exporter.nix @@ -0,0 +1,13 @@ +{ 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; + listenAddress = "127.0.0.1"; + }; + + networking.firewall.allowedTCPPorts = [ serv."metric-exporter".port ]; +}