diff options
Diffstat (limited to '')
| -rw-r--r-- | modules/by-name/mo/monitoring/components/scrutiny.nix | 56 |
1 files changed, 25 insertions, 31 deletions
diff --git a/modules/by-name/mo/monitoring/components/scrutiny.nix b/modules/by-name/mo/monitoring/components/scrutiny.nix index 31871cd..adb515e 100644 --- a/modules/by-name/mo/monitoring/components/scrutiny.nix +++ b/modules/by-name/mo/monitoring/components/scrutiny.nix @@ -8,18 +8,11 @@ in { options.vhack.monitoring.scrutiny = { enable = lib.mkEnableOption "scrutiny service"; - - fqdn = lib.mkOption { - type = lib.types.nullOr lib.types.str; - description = '' - If a string, this will be the domain under which the scrutiny web interface will be servced. - - If null, the web interface will not be served and only the prometheus metrics will be accessible. - ''; - }; }; - config = { + # We don't currently _care_ about the health of the hardware, because hetzner does + # this for us (nor can we care, because it's not exposed in the VPS) + config = lib.mkIf false { vhack.monitoring = { prometheus.sources = [ { @@ -27,12 +20,29 @@ in { extra.metrics_path = "/api/metrics"; target = "127.0.0.1:${toString config.services.scrutiny.settings.web.listen.port}"; } + { + name = "smartctl"; + target = "127.0.0.1:${toString config.services.prometheus.exporters.smartctl.port}"; + } ]; grafana.dashboards = [ ../dashboards/Health.json ]; }; + users = { + groups = { + smartctl-exporter-access.gid = config.vhack.constants.ids.gids.smartctl-exporter-access; + }; + users = { + smartctl-exporter-access = { + isSystemUser = true; + group = "smartctl-exporter-access"; + uid = config.vhack.constants.ids.uids.smartctl-exporter-access; + }; + }; + }; + services = { scrutiny = { enable = true; @@ -62,27 +72,11 @@ in { enable = true; }; }; - - # nginx.statusPage = lib.mkDefault config.services.nginx.enable; - nginx = lib.mkIf (cfg.fqdn != null) { - virtualHosts."${cfg.fqdn}" = { - locations."/".proxyPass = "http://127.0.0.1:${toString config.services.scrutiny.settings.web.listen.port}"; - - enableACME = true; - forceSSL = true; - }; - }; - - netdata = { - enable = true; - config = { - # web.mode = "none"; - # web."bind to" = "127.0.0.1:19999"; - global = { - "debug log" = "syslog"; - "access log" = "syslog"; - "error log" = "syslog"; - }; + prometheus = { + exporters.smartctl = { + enable = true; + port = 9115; + listenAddress = "127.0.0.1"; }; }; }; |
