From 1de0d328607e3323ea6f7619c31331c28a3b69b3 Mon Sep 17 00:00:00 2001 From: Gonne Kretschmer Date: Fri, 27 Oct 2023 16:01:07 +0200 Subject: [PATCH] Prometheus Node Exporter metrics configured. --- nixos/roles/default.nix | 8 +----- nixos/roles/prometheusNodeExporter.nix | 36 ++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 7 deletions(-) create mode 100644 nixos/roles/prometheusNodeExporter.nix diff --git a/nixos/roles/default.nix b/nixos/roles/default.nix index 3752a32..bc94eff 100644 --- a/nixos/roles/default.nix +++ b/nixos/roles/default.nix @@ -3,6 +3,7 @@ imports = [ ./admins.nix ./nix_keys.nix + ./prometheusNodeExporter.nix (modulesPath + "/virtualisation/xen-domU.nix") ../modules/impermanence.nix ]; @@ -55,12 +56,5 @@ services = { PasswordAuthentication = false; }; }; - - prometheus.exporters.node = { - enable = true; - port = 9100; }; -}; -# Prometheus Monitoring -networking.firewall.allowedTCPPorts = [ 9100 ]; } diff --git a/nixos/roles/prometheusNodeExporter.nix b/nixos/roles/prometheusNodeExporter.nix new file mode 100644 index 0000000..e717411 --- /dev/null +++ b/nixos/roles/prometheusNodeExporter.nix @@ -0,0 +1,36 @@ +{ + imports = [ ]; + services.prometheus.exporters.node = { + enable = true; + port = 9100; + # Aligned with https://git.rwth-aachen.de/fsdmath/server/prometheus/-/blob/main/node_exporter/etc/default/prometheus-node-exporter + # Original reasons are for these lists are unknown, but along the lines + # “This looks useless for VMs, but that seems nice.” + disabledCollectors = [ + "arp" + "bcache" + "btrfs" + "dmi" + "fibrechannel" + "infiniband" + "nfs" + "nvme" + "powersupplyclass" + "rapl" + "selinux" + "tapestats" + "thermal_zone" + "udp_queues" + "xfs" + "zfs" + ]; + enabledCollectors = [ + "buddyinfo" + "ksmd" + "logind" + "mountstats" + "processes" + ]; + }; + networking.firewall.allowedTCPPorts = [ 9100 ]; +}