diff --git a/modules/monitoring.nix b/modules/monitoring.nix index dc27092..f45afe7 100644 --- a/modules/monitoring.nix +++ b/modules/monitoring.nix @@ -91,8 +91,16 @@ in }; }; - services.prometheus.scrapeConfigs = - (lib.lists.optional config.services.nginx.enable { + services.prometheus.scrapeConfigs = [ + { + job_name = "node"; + static_configs = [ + { + targets = ["127.0.0.1:9115"]; + } + ]; + } + ] ++ (lib.lists.optional config.services.nginx.enable { job_name = "nginx"; static_configs = [ { @@ -106,6 +114,12 @@ in listenAddress = "127.0.0.1"; scrapeUri = "http://localhost:80/nginx_status"; }; + services.prometheus.exporters.node = { + enable = true; + enabledCollectors = ["systemd"]; + port = 9115; + listenAddress = "127.0.0.1"; + }; services.nginx.statusPage = lib.mkDefault config.services.nginx.enable; # sops.secrets."grafana" = {