aboutsummaryrefslogtreecommitdiff
path: root/modules/monitoring
diff options
context:
space:
mode:
authorMax Audron <audron@cocaine.farm>2025-07-31 15:32:46 +0200
committerMax Audron <audron@cocaine.farm>2025-07-31 15:32:46 +0200
commit4fcbf49cbed4b5cccb837045bde898605d620f65 (patch)
treeaf2e6439bccc10763cb79d4d9affca878993c2b6 /modules/monitoring
parenttry to run authentik natively (diff)
add more monitoring exporters and scrapers
Diffstat (limited to '')
-rw-r--r--modules/monitoring/default.nix43
-rw-r--r--modules/monitoring/node-exporter.nix31
2 files changed, 57 insertions, 17 deletions
diff --git a/modules/monitoring/default.nix b/modules/monitoring/default.nix
index 68df69b..05ca338 100644
--- a/modules/monitoring/default.nix
+++ b/modules/monitoring/default.nix
@@ -11,22 +11,9 @@ with self.lib.nginx;
webExternalUrl = "https://prometheus.vapor.systems";
exporters = {
- node = {
- enable = true;
- enabledCollectors = [ "systemd" ];
- };
-
- zfs = {
- enable = true;
- };
-
postgres = {
enable = true;
};
-
- nginx = {
- enable = true;
- };
};
globalConfig = {
@@ -37,25 +24,35 @@ with self.lib.nginx;
{
job_name = "node";
static_configs = [
- { targets = [ "localhost:${toString config.services.prometheus.exporters.node.port}" ]; }
+ { targets = [ "ettves:${toString config.services.prometheus.exporters.node.port}" ]; }
+ { targets = [ "phaenn:${toString config.services.prometheus.exporters.node.port}" ]; }
];
}
{
job_name = "zfs";
static_configs = [
- { targets = [ "localhost:${toString config.services.prometheus.exporters.zfs.port}" ]; }
+ { targets = [ "ettves:${toString config.services.prometheus.exporters.zfs.port}" ]; }
+ { targets = [ "phaenn:${toString config.services.prometheus.exporters.zfs.port}" ]; }
+ ];
+ }
+ {
+ job_name = "smartctl";
+ static_configs = [
+ { targets = [ "ettves:${toString config.services.prometheus.exporters.smartctl.port}" ]; }
+ { targets = [ "phaenn:${toString config.services.prometheus.exporters.smartctl.port}" ]; }
];
}
{
job_name = "postgres";
static_configs = [
- { targets = [ "localhost:${toString config.services.prometheus.exporters.postgres.port}" ]; }
+ { targets = [ "ettves:${toString config.services.prometheus.exporters.postgres.port}" ]; }
];
}
{
job_name = "nginx";
static_configs = [
- { targets = [ "localhost:${toString config.services.prometheus.exporters.nginx.port}" ]; }
+ { targets = [ "ettves:${toString config.services.prometheus.exporters.nginx.port}" ]; }
+ { targets = [ "phaenn:${toString config.services.prometheus.exporters.nginx.port}" ]; }
];
}
{
@@ -64,11 +61,23 @@ with self.lib.nginx;
{ targets = [ "localhost:${toString config.services.quassel.settings.metrics.port}" ]; }
];
}
+ {
+ job_name = "authentik";
+ static_configs = [
+ { targets = [ "ettves:9300" ]; }
+ { targets = [ "ettves:9303" ]; }
+ { targets = [ "ettves:9304" ]; }
+ ];
+ }
];
};
services.nginx.statusPage = true;
+ services.udev.extraRules = ''
+ SUBSYSTEM=="nvme", KERNEL=="nvme[0-9]*", GROUP="disk"
+ '';
+
security.acme.certs = {
"vapor.systems" = {
extraDomainNames = [ "*.vapor.systems" ];
diff --git a/modules/monitoring/node-exporter.nix b/modules/monitoring/node-exporter.nix
new file mode 100644
index 0000000..1b7481d
--- /dev/null
+++ b/modules/monitoring/node-exporter.nix
@@ -0,0 +1,31 @@
+{ self, config, lib, pkgs, ... }:
+
+with self.lib.nginx;
+{
+ services.prometheus = {
+ exporters = {
+ node = {
+ enable = true;
+ enabledCollectors = [ "systemd" ];
+ };
+
+ zfs = {
+ enable = true;
+ };
+
+ nginx = {
+ enable = true;
+ };
+
+ smartctl = {
+ enable = true;
+ };
+ };
+ };
+
+ services.nginx.statusPage = true;
+
+ services.udev.extraRules = ''
+ SUBSYSTEM=="nvme", KERNEL=="nvme[0-9]*", GROUP="disk"
+ '';
+}