summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorKjetil Orbekk <kj@orbekk.com>2021-03-10 09:19:24 -0500
committerKjetil Orbekk <kj@orbekk.com>2021-03-10 09:19:24 -0500
commit076d4020e55631eb16bc09c3f541634b6cf17812 (patch)
tree37812639c02102b039f919e8c772c7d54bbb5d42 /modules
parent185f9fc56771954f45bfb0b8eaf41e33d67212c2 (diff)
backup probing
Diffstat (limited to 'modules')
-rw-r--r--modules/monitoring.nix11
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/monitoring.nix b/modules/monitoring.nix
index 4e645c7..8d154ba 100644
--- a/modules/monitoring.nix
+++ b/modules/monitoring.nix
@@ -11,6 +11,10 @@ in
type = lib.types.int;
default = aliases.services.grafana.port;
};
+ textFileDir = lib.mkOption {
+ type = lib.types.str;
+ default = "/var/lib/prometheus-node-exporter-text-files";
+ };
grafana-domain = lib.mkOption {
type = lib.types.str;
default = "grafana.orbekk.com";
@@ -88,6 +92,7 @@ in
enable = true;
enabledCollectors = [ "systemd" ];
port = cfg.prometheus-exporter-port;
+ extraFlags = ["--collector.textfile.directory=${cfg.textFileDir}"];
};
snmp = {
enable = true;
@@ -97,6 +102,12 @@ in
};
};
+ system.activationScripts.node-exporter-directory.text =
+ ''
+ # Needed for Prometheus node exporter.
+ mkdir -pm 0775 ${cfg.textFileDir}
+ '';
+
services.nginx.virtualHosts.${cfg.grafana-domain} = {
enableACME = true;
forceSSL = true;