diff --git a/hosts/ildkule/configuration.nix b/hosts/ildkule/configuration.nix index 8181bfa..99e14bf 100644 --- a/hosts/ildkule/configuration.nix +++ b/hosts/ildkule/configuration.nix @@ -6,8 +6,8 @@ ../../base.nix ../../misc/metrics-exporters.nix + ./services/monitoring ./services/nginx - ./services/metrics ]; sops.defaultSopsFile = ../../secrets/ildkule/ildkule.yaml; diff --git a/hosts/ildkule/services/metrics/dashboards/go-processes.json b/hosts/ildkule/services/monitoring/dashboards/go-processes.json similarity index 100% rename from hosts/ildkule/services/metrics/dashboards/go-processes.json rename to hosts/ildkule/services/monitoring/dashboards/go-processes.json diff --git a/hosts/ildkule/services/metrics/dashboards/mysql.json b/hosts/ildkule/services/monitoring/dashboards/mysql.json similarity index 100% rename from hosts/ildkule/services/metrics/dashboards/mysql.json rename to hosts/ildkule/services/monitoring/dashboards/mysql.json diff --git a/hosts/ildkule/services/metrics/dashboards/node-exporter-full.json b/hosts/ildkule/services/monitoring/dashboards/node-exporter-full.json similarity index 100% rename from hosts/ildkule/services/metrics/dashboards/node-exporter-full.json rename to hosts/ildkule/services/monitoring/dashboards/node-exporter-full.json diff --git a/hosts/ildkule/services/metrics/dashboards/postgres.json b/hosts/ildkule/services/monitoring/dashboards/postgres.json similarity index 100% rename from hosts/ildkule/services/metrics/dashboards/postgres.json rename to hosts/ildkule/services/monitoring/dashboards/postgres.json diff --git a/hosts/ildkule/services/metrics/dashboards/synapse.json b/hosts/ildkule/services/monitoring/dashboards/synapse.json similarity index 100% rename from hosts/ildkule/services/metrics/dashboards/synapse.json rename to hosts/ildkule/services/monitoring/dashboards/synapse.json diff --git a/hosts/ildkule/services/metrics/default.nix b/hosts/ildkule/services/monitoring/default.nix similarity index 81% rename from hosts/ildkule/services/metrics/default.nix rename to hosts/ildkule/services/monitoring/default.nix index a0a6a40..e68ef7a 100644 --- a/hosts/ildkule/services/metrics/default.nix +++ b/hosts/ildkule/services/monitoring/default.nix @@ -2,8 +2,9 @@ { imports = [ - ./prometheus ./grafana.nix ./loki.nix + ./prometheus + ./uptime-kuma.nix ]; } diff --git a/hosts/ildkule/services/metrics/grafana.nix b/hosts/ildkule/services/monitoring/grafana.nix similarity index 98% rename from hosts/ildkule/services/metrics/grafana.nix rename to hosts/ildkule/services/monitoring/grafana.nix index 65d59e5..a4d022f 100644 --- a/hosts/ildkule/services/metrics/grafana.nix +++ b/hosts/ildkule/services/monitoring/grafana.nix @@ -17,7 +17,7 @@ in { secretFile = path: "$__file{${path}}"; in { server = { - domain = "ildkule.pvv.ntnu.no"; + domain = "grafana.pvv.ntnu.no"; http_port = 2342; http_addr = "127.0.0.1"; }; diff --git a/hosts/ildkule/services/metrics/loki.nix b/hosts/ildkule/services/monitoring/loki.nix similarity index 100% rename from hosts/ildkule/services/metrics/loki.nix rename to hosts/ildkule/services/monitoring/loki.nix diff --git a/hosts/ildkule/services/metrics/prometheus/default.nix b/hosts/ildkule/services/monitoring/prometheus/default.nix similarity index 100% rename from hosts/ildkule/services/metrics/prometheus/default.nix rename to hosts/ildkule/services/monitoring/prometheus/default.nix diff --git a/hosts/ildkule/services/metrics/prometheus/gogs.nix b/hosts/ildkule/services/monitoring/prometheus/gogs.nix similarity index 100% rename from hosts/ildkule/services/metrics/prometheus/gogs.nix rename to hosts/ildkule/services/monitoring/prometheus/gogs.nix diff --git a/hosts/ildkule/services/metrics/prometheus/matrix-synapse.nix b/hosts/ildkule/services/monitoring/prometheus/matrix-synapse.nix similarity index 100% rename from hosts/ildkule/services/metrics/prometheus/matrix-synapse.nix rename to hosts/ildkule/services/monitoring/prometheus/matrix-synapse.nix diff --git a/hosts/ildkule/services/metrics/prometheus/mysqld.nix b/hosts/ildkule/services/monitoring/prometheus/mysqld.nix similarity index 100% rename from hosts/ildkule/services/metrics/prometheus/mysqld.nix rename to hosts/ildkule/services/monitoring/prometheus/mysqld.nix diff --git a/hosts/ildkule/services/metrics/prometheus/node.nix b/hosts/ildkule/services/monitoring/prometheus/node.nix similarity index 100% rename from hosts/ildkule/services/metrics/prometheus/node.nix rename to hosts/ildkule/services/monitoring/prometheus/node.nix diff --git a/hosts/ildkule/services/metrics/prometheus/postgres.nix b/hosts/ildkule/services/monitoring/prometheus/postgres.nix similarity index 100% rename from hosts/ildkule/services/metrics/prometheus/postgres.nix rename to hosts/ildkule/services/monitoring/prometheus/postgres.nix diff --git a/hosts/ildkule/services/metrics/prometheus/rules/synapse-v2.rules b/hosts/ildkule/services/monitoring/prometheus/rules/synapse-v2.rules similarity index 100% rename from hosts/ildkule/services/metrics/prometheus/rules/synapse-v2.rules rename to hosts/ildkule/services/monitoring/prometheus/rules/synapse-v2.rules diff --git a/hosts/ildkule/services/monitoring/uptime-kuma.nix b/hosts/ildkule/services/monitoring/uptime-kuma.nix new file mode 100644 index 0000000..036c919 --- /dev/null +++ b/hosts/ildkule/services/monitoring/uptime-kuma.nix @@ -0,0 +1,20 @@ +{ config, pkgs, lib, ... }: +let + cfg = config.services.uptime-kuma; + domain = "uptime.pvv.ntnu.no"; +in { + services.uptime-kuma = { + enable = true; + settings = { + PORT = "5059"; + HOST = "127.0.1.2"; + }; + }; + + services.nginx.virtualHosts.${domain} = { + enableACME = true; + forceSSL = true; + kTLS = true; + locations."/".proxyPass = "http://${cfg.settings.HOST}:${cfg.settings.PORT}"; + }; +} diff --git a/misc/metrics-exporters.nix b/misc/metrics-exporters.nix index 3018936..9f32a28 100644 --- a/misc/metrics-exporters.nix +++ b/misc/metrics-exporters.nix @@ -14,6 +14,8 @@ "::1" values.hosts.ildkule.ipv4 values.hosts.ildkule.ipv6 + values.hosts.ildkule.ipv4_global + values.hosts.ildkule.ipv6_global ]; };