diff --git a/modules/wireguard-monitoring/default.nix b/modules/wireguard-monitoring/default.nix index 7290394..03ad92c 100644 --- a/modules/wireguard-monitoring/default.nix +++ b/modules/wireguard-monitoring/default.nix @@ -80,10 +80,23 @@ in { replacement = "$2"; } ]; - }]; + }] ++ (if config.services.nginx.enable + then [{ + job_name = "nginx-error-logs"; + static_configs = [{ + targets = [ "localhost" ]; + labels = { + job = "nginx-error-logs"; + host = config.networking.hostName; + __path__ = "/var/log/nginx/*error.log"; + }; + }]; + }] else [ ]); }; }; + users.users.promtail.extraGroups = lib.mkIf config.services.nginx.enable [ "nginx" ]; + # wait for wireguard before starting node-exporter systemd.services.prometheus-node-exporter.after = [ "wireguard-wg0.service" ]; };