ctucx.git: nixfiles

ctucx' nixfiles

commit ba9df59d244de019c86acc90df89a53656aa0093
parent 139a85f7520f67a42db182702594c056498a6ebc
Author: Leah (ctucx) <git@ctu.cx>
Date: Thu, 23 Feb 2023 18:53:45 +0100

configurations/linux/services/prometheus-exporters: enable systemd-exporter
8 files changed, 36 insertions(+), 28 deletions(-)
diff --git a/configurations/linux/services/prometheus-exporters.nix b/configurations/linux/services/prometheus-exporters.nix
@@ -0,0 +1,29 @@
+{config, lib, pkgs, ...}:
+
+{
+
+  services = {
+    prometheus.exporters.node.enable = true;
+    prometheus.exporters.node.listenAddress = "127.0.0.1";
+    prometheus.exporters.node.enabledCollectors = [
+      "systemd"
+    ];
+
+    prometheus.exporters.systemd.enable = true;
+    prometheus.exporters.systemd.listenAddress = "127.0.0.1";
+
+    nginx = {
+      enable = true;
+      virtualHosts."${config.networking.fqdn}" = {
+        enableACME = true;
+        forceSSL   = true;
+        kTLS       = true;
+        locations."/node-exporter".proxyPass    = "http://127.0.0.1:9100/metrics";
+        locations."/systemd-exporter".proxyPass = "http://127.0.0.1:9558/metrics";
+      };
+    };
+  };
+
+  networking.firewall.allowedTCPPorts = [ 80 443 ];
+
+}
diff --git a/configurations/linux/services/prometheus-node-exporter.nix b/configurations/linux/services/prometheus-node-exporter.nix
@@ -1,22 +0,0 @@
-{config, lib, pkgs, ...}:
-
-{
-
-  services = {
-    prometheus.exporters.node.enable = true;
-    prometheus.exporters.node.listenAddress = "127.0.0.1";
-
-    nginx = {
-      enable = true;
-      virtualHosts."${config.networking.fqdn}" = {
-        enableACME = true;
-        forceSSL   = true;
-        kTLS       = true;
-        locations."/node-exporter".proxyPass = "http://127.0.0.1:9100/metrics";
-      };
-    };
-  };
-
-  networking.firewall.allowedTCPPorts = [ 80 443 ];
-
-}
diff --git a/machines/desastro/configuration.nix b/machines/desastro/configuration.nix
@@ -7,7 +7,7 @@
   imports = [
     ./hardware-configuration.nix
 
-    ../../configurations/linux/services/prometheus-node-exporter.nix
+    ../../configurations/linux/services/prometheus-exporters.nix
     ../../configurations/linux/services/restic-server.nix
 
     ./syncthing.nix
diff --git a/machines/hector/configuration.nix b/machines/hector/configuration.nix
@@ -5,7 +5,7 @@
   imports = [
     ./hardware-configuration.nix
 
-    ../../configurations/linux/services/prometheus-node-exporter.nix
+    ../../configurations/linux/services/prometheus-exporters.nix
     ../../configurations/linux/services/restic-server.nix
   ];
 
diff --git a/machines/lollo-old/configuration.nix b/machines/lollo-old/configuration.nix
@@ -7,7 +7,7 @@
 
 #    ./router
 
-    ../../configurations/linux/services/prometheus-node-exporter.nix
+    ../../configurations/linux/services/prometheus-exporters.nix
     ../../configurations/linux/services/syncthing-nginx.nix
 
     ./remote-admin.nix
diff --git a/machines/lollo/configuration.nix b/machines/lollo/configuration.nix
@@ -20,7 +20,7 @@
     # cal- and card-dav server
     ./radicale.nix
 
-    ../../configurations/linux/services/prometheus-node-exporter.nix
+    ../../configurations/linux/services/prometheus-exporters.nix
     ../../configurations/linux/services/restic-server.nix
     ../../configurations/linux/services/syncthing-nginx.nix
 

@@ -166,4 +166,5 @@
 
   system.stateVersion = "22.05"; # Did you read the comment?
   home-manager.users.leah.home.stateVersion = "22.11";
+
 }
diff --git a/machines/trabbi/configuration.nix b/machines/trabbi/configuration.nix
@@ -12,7 +12,7 @@
     ./git
 
     # monitoring
-    ../../configurations/linux/services/prometheus-node-exporter.nix
+    ../../configurations/linux/services/prometheus-exporters.nix
     ./prometheus.nix
     ./grafana
 
diff --git a/machines/wanderduene/configuration.nix b/machines/wanderduene/configuration.nix
@@ -5,7 +5,7 @@
   imports = [
     ./hardware-configuration.nix
 
-    ../../configurations/linux/services/prometheus-node-exporter.nix
+    ../../configurations/linux/services/prometheus-exporters.nix
     ../../configurations/linux/services/dns.nix
   ];