From 4af8a52b6eb471517aa4096cb934d4455b0fa80f Mon Sep 17 00:00:00 2001 From: Kopatz <7265381+Kropatz@users.noreply.github.com> Date: Sat, 8 Nov 2025 15:48:21 +0100 Subject: [PATCH] add node-exporter to server --- modules/services/grafana.nix | 13 +++++++++++++ modules/services/node-exporter.nix | 17 +++++++++++++++++ systems/amd-server/configuration.nix | 1 + 3 files changed, 31 insertions(+) create mode 100644 modules/services/node-exporter.nix diff --git a/modules/services/grafana.nix b/modules/services/grafana.nix index 7fb178b..ca25192 100644 --- a/modules/services/grafana.nix +++ b/modules/services/grafana.nix @@ -166,6 +166,19 @@ in } ]; } + { + job_name = "host"; + static_configs = [ + { + targets = [ + "192.168.0.20:9100" + ]; + labels = { + instance = "host"; + }; + } + ]; + } { job_name = "scheibnmeister"; static_configs = [ diff --git a/modules/services/node-exporter.nix b/modules/services/node-exporter.nix new file mode 100644 index 0000000..7b18ff8 --- /dev/null +++ b/modules/services/node-exporter.nix @@ -0,0 +1,17 @@ +{ + pkgs, + config, + lib, + ... +}: +let +in +{ + services.prometheus.exporters.node = { + enable = true; + openFirewall = true; + firewallRules = '' + ip saddr 192.168.0.10 tcp dport 9100 counter accept comment node_exporter_allow_from_main_server + ''; + }; +} diff --git a/systems/amd-server/configuration.nix b/systems/amd-server/configuration.nix index f8ef7b0..7a6ee50 100644 --- a/systems/amd-server/configuration.nix +++ b/systems/amd-server/configuration.nix @@ -13,6 +13,7 @@ ./hardware-configuration.nix ../../modules/misc/kernel.nix ../../modules/services/ssh.nix + ../../modules/services/node-exporter.nix ]; custom = {