diff --git a/README.md b/README.md index 61311be..d2dccfa 100644 --- a/README.md +++ b/README.md @@ -40,9 +40,10 @@ Other installed packages and tools are described in the config files (like ./hos ## Monitoring -- Prometheus ([source](./hosts/defiant/services/metrics/prometheus.nix)) - Pull-based metrics system that fetches metrics over HTTP from a range of exporters and stores them in a time-series database -- Loki ([source](./hosts/defiant/services/metrics/loki.nix)) - Central logging for all my hosts -- Grafana ([source](./hosts/defiant/services/metrics/grafana.nix)) - Visualization and alerting for all my metrics and logs +- Prometheus ([source](./hosts/defiant/services/monitoring/prometheus.nix)) - Pull-based metrics system that fetches metrics over HTTP from a range of exporters and stores them in a time-series database +- Loki ([source](./hosts/defiant/services/monitoring/loki.nix)) - Central logging for all my hosts +- Grafana ([source](./hosts/defiant/services/monitoring/grafana.nix)) - Visualization and alerting for all my metrics and logs +- Uptime-Kuma ([source](./hosts/defiant/services/monitoring/uptime-kuma.nix)) - Uptime / health check with alerting ## Dotfiles and user tools diff --git a/hosts/defiant/configuration.nix b/hosts/defiant/configuration.nix index df9626c..4729483 100644 --- a/hosts/defiant/configuration.nix +++ b/hosts/defiant/configuration.nix @@ -21,7 +21,7 @@ ./services/hedgedoc.nix ./services/home-assistant.nix ./services/matrix - ./services/metrics + ./services/monitoring ./services/microbin.nix ./services/minecraft.nix ./services/vaultwarden.nix diff --git a/hosts/defiant/services/metrics/dashboards/node-exporter-full.json b/hosts/defiant/services/monitoring/dashboards/node-exporter-full.json similarity index 100% rename from hosts/defiant/services/metrics/dashboards/node-exporter-full.json rename to hosts/defiant/services/monitoring/dashboards/node-exporter-full.json diff --git a/hosts/defiant/services/metrics/dashboards/openwrt.json b/hosts/defiant/services/monitoring/dashboards/openwrt.json similarity index 100% rename from hosts/defiant/services/metrics/dashboards/openwrt.json rename to hosts/defiant/services/monitoring/dashboards/openwrt.json diff --git a/hosts/defiant/services/metrics/dashboards/synology-nas-details.json b/hosts/defiant/services/monitoring/dashboards/synology-nas-details.json similarity index 100% rename from hosts/defiant/services/metrics/dashboards/synology-nas-details.json rename to hosts/defiant/services/monitoring/dashboards/synology-nas-details.json diff --git a/hosts/defiant/services/metrics/default.nix b/hosts/defiant/services/monitoring/default.nix similarity index 85% rename from hosts/defiant/services/metrics/default.nix rename to hosts/defiant/services/monitoring/default.nix index 05803d0..a1fce02 100644 --- a/hosts/defiant/services/metrics/default.nix +++ b/hosts/defiant/services/monitoring/default.nix @@ -6,5 +6,6 @@ ./grafana.nix ./loki.nix ./snmp-exporter.nix + ./uptime-kuma.nix ]; } diff --git a/hosts/defiant/services/metrics/grafana.nix b/hosts/defiant/services/monitoring/grafana.nix similarity index 100% rename from hosts/defiant/services/metrics/grafana.nix rename to hosts/defiant/services/monitoring/grafana.nix diff --git a/hosts/defiant/services/metrics/loki.nix b/hosts/defiant/services/monitoring/loki.nix similarity index 100% rename from hosts/defiant/services/metrics/loki.nix rename to hosts/defiant/services/monitoring/loki.nix diff --git a/hosts/defiant/services/metrics/prometheus.nix b/hosts/defiant/services/monitoring/prometheus.nix similarity index 100% rename from hosts/defiant/services/metrics/prometheus.nix rename to hosts/defiant/services/monitoring/prometheus.nix diff --git a/hosts/defiant/services/metrics/snmp-exporter.nix b/hosts/defiant/services/monitoring/snmp-exporter.nix similarity index 100% rename from hosts/defiant/services/metrics/snmp-exporter.nix rename to hosts/defiant/services/monitoring/snmp-exporter.nix diff --git a/hosts/defiant/services/monitoring/uptime-kuma.nix b/hosts/defiant/services/monitoring/uptime-kuma.nix new file mode 100644 index 0000000..a24797a --- /dev/null +++ b/hosts/defiant/services/monitoring/uptime-kuma.nix @@ -0,0 +1,16 @@ +{ config, pkgs, lib, ... }: +let + cfg = config.services.uptime-kuma; +in { + services.uptime-kuma = { + enable = true; + settings = { + PORT = "5059"; + HOST = "127.0.1.2"; + }; + }; + + services.nginx.virtualHosts."uptime.home.feal.no" = { + locations."/".proxyPass = "http://${cfg.settings.HOST}:${cfg.settings.PORT}"; + }; +}