about summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorWilliButz <WilliButz@users.noreply.github.com>2021-03-11 19:18:29 +0100
committerGitHub <noreply@github.com>2021-03-11 19:18:29 +0100
commitf5c01cf9d4e744426c938b000e235011f7076929 (patch)
treef213558b746bb792ddbf374b8bfceede049328d9 /nixos/modules
parent3ceef8186cc4e70149c23e21ffb85ecccbce10aa (diff)
parent344b02919ee4d4b9ffbd7ebca44f99a8202f9749 (diff)
Merge pull request #113370 from chkno/prometheus-systemd-exporter-no-flags
prometheus-systemd-exporter: Init at 0.4.0
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/services/monitoring/prometheus/exporters.nix1
-rw-r--r--nixos/modules/services/monitoring/prometheus/exporters/systemd.nix18
2 files changed, 19 insertions, 0 deletions
diff --git a/nixos/modules/services/monitoring/prometheus/exporters.nix b/nixos/modules/services/monitoring/prometheus/exporters.nix
index 4c24784868539..115ecbf12b5e6 100644
--- a/nixos/modules/services/monitoring/prometheus/exporters.nix
+++ b/nixos/modules/services/monitoring/prometheus/exporters.nix
@@ -53,6 +53,7 @@ let
     "smokeping"
     "sql"
     "surfboard"
+    "systemd"
     "tor"
     "unifi"
     "unifi-poller"
diff --git a/nixos/modules/services/monitoring/prometheus/exporters/systemd.nix b/nixos/modules/services/monitoring/prometheus/exporters/systemd.nix
new file mode 100644
index 0000000000000..0514469b8a61e
--- /dev/null
+++ b/nixos/modules/services/monitoring/prometheus/exporters/systemd.nix
@@ -0,0 +1,18 @@
+{ config, pkgs, lib, ... }:
+
+with lib;
+
+let cfg = config.services.prometheus.exporters.systemd;
+
+in {
+  port = 9558;
+
+  serviceOpts = {
+    serviceConfig = {
+      ExecStart = ''
+        ${pkgs.prometheus-systemd-exporter}/bin/systemd_exporter \
+          --web.listen-address ${cfg.listenAddress}:${toString cfg.port}
+      '';
+    };
+  };
+}