From 0638a5d2e64c8fddd58cef166fc5f8cd83034829 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Barnouin?= Date: Mon, 14 Apr 2025 15:05:10 +0200 Subject: [PATCH] Working crowdsec AND prometheus config --- services/grafana/default.nix | 70 +++++++++++++++++++++++------------- systems/minimalLXCConfig.nix | 2 +- systems/minimalVMConfig.nix | 2 +- 3 files changed, 48 insertions(+), 26 deletions(-) diff --git a/services/grafana/default.nix b/services/grafana/default.nix index 05bdb2f..ff16f71 100644 --- a/services/grafana/default.nix +++ b/services/grafana/default.nix @@ -137,14 +137,6 @@ in { } ]; } - { - job_name = "crowdsec_authentik"; - static_configs = [ - { - targets = ["192.168.1.125:6060"]; - } - ]; - } { job_name = "nginx"; static_configs = [ @@ -153,14 +145,6 @@ in { } ]; } - { - job_name = "crowdsec_nginx"; - static_configs = [ - { - targets = ["${cfg.proxy_ip}:6060"]; - } - ]; - } { job_name = "redis"; static_configs = [ @@ -201,14 +185,6 @@ in { } ]; } - { - job_name = "crowdsec_nextcloud"; - static_configs = [ - { - targets = ["192.168.1.45:6060"]; - } - ]; - } { job_name = "jellyfin"; static_configs = [ @@ -226,14 +202,60 @@ in { } ]; } + { + job_name = "crowdsec_authentik"; + metrics_path = "/metrics"; + static_configs = [ + { + targets = ["192.168.1.125:6060"]; + } + ]; + } + { + job_name = "crowdsec_nextcloud"; + metrics_path = "/metrics"; + static_configs = [ + { + targets = ["192.168.1.45:6060"]; + } + ]; + } + { + job_name = "crowdsec_nginx"; + metrics_path = "/metrics"; + static_configs = [ + { + targets = ["${cfg.proxy_ip}:6060"]; + } + ]; + } { job_name = "crowdsec_jellyfin"; + metrics_path = "/metrics"; static_configs = [ { targets = ["192.168.1.42:6060"]; } ]; } + { + job_name = "crowdsec_forgejo"; + metrics_path = "/metrics"; + static_configs = [ + { + targets = ["192.168.1.14:6060"]; + } + ]; + } + { + job_name = "crowdsec_grafana"; + metrics_path = "/metrics"; + static_configs = [ + { + targets = ["192.168.1.27:6060"]; + } + ]; + } ]; }; loki = { diff --git a/systems/minimalLXCConfig.nix b/systems/minimalLXCConfig.nix index cf89677..2dfd7a5 100644 --- a/systems/minimalLXCConfig.nix +++ b/systems/minimalLXCConfig.nix @@ -14,7 +14,7 @@ networking = { firewall = { enable = true; - allowedTCPPorts = [22 9002]; + allowedTCPPorts = [22 6060 9002]; }; }; diff --git a/systems/minimalVMConfig.nix b/systems/minimalVMConfig.nix index e802fa4..9af15f2 100644 --- a/systems/minimalVMConfig.nix +++ b/systems/minimalVMConfig.nix @@ -13,7 +13,7 @@ networking = { firewall = { enable = true; - allowedTCPPorts = [22 9002]; + allowedTCPPorts = [22 6060 9002]; }; };