summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hosts/surtr/dns/default.nix2
-rw-r--r--hosts/vidhar/prometheus/default.nix33
2 files changed, 34 insertions, 1 deletions
diff --git a/hosts/surtr/dns/default.nix b/hosts/surtr/dns/default.nix
index 28e0df73..d2ad0bb6 100644
--- a/hosts/surtr/dns/default.nix
+++ b/hosts/surtr/dns/default.nix
@@ -207,7 +207,7 @@ in {
207 207
208 settings = { 208 settings = {
209 server = { 209 server = {
210 interface = ["lo"]; 210 interface = ["lo@5353"];
211 prefer-ip6 = true; 211 prefer-ip6 = true;
212 access-control = ["127.0.0.0/8 allow" "::1/128 allow"]; 212 access-control = ["127.0.0.0/8 allow" "::1/128 allow"];
213 root-hints = "${pkgs.dns-root-data}/root.hints"; 213 root-hints = "${pkgs.dns-root-data}/root.hints";
diff --git a/hosts/vidhar/prometheus/default.nix b/hosts/vidhar/prometheus/default.nix
index 0bf1ca58..2c9831e5 100644
--- a/hosts/vidhar/prometheus/default.nix
+++ b/hosts/vidhar/prometheus/default.nix
@@ -80,6 +80,20 @@ in {
80 "--collector.unit-whitelist=(dhcpcd-dsl|pppd-telekom|corerad|ndppd)\.service" 80 "--collector.unit-whitelist=(dhcpcd-dsl|pppd-telekom|corerad|ndppd)\.service"
81 ]; 81 ];
82 }; 82 };
83 blackbox = {
84 enable = true;
85 configFile = pkgs.writeText "blackbox-config.yaml" (builtins.toJSON {
86 modules = {
87 "dns_soa" = {
88 prober = "dns";
89 dns = {
90 query_name = ".";
91 query_type = "SOA";
92 };
93 };
94 };
95 });
96 };
83 }; 97 };
84 98
85 globalConfig = { 99 globalConfig = {
@@ -201,6 +215,25 @@ in {
201 relabel_configs = relabelHosts; 215 relabel_configs = relabelHosts;
202 scrape_interval = "5s"; 216 scrape_interval = "5s";
203 } 217 }
218 { job_name = "blackbox";
219 metrics_path = "/probe";
220 params = { module = ["dns_soa"]; };
221 static_configs = [
222 { targets = ["127.0.0.53:53" "127.0.0.1:5353"]; }
223 ];
224 relabel_configs = [
225 { source_labels = ["__address__"];
226 target_label = "__param_target";
227 }
228 { source_labels = ["__param_target"];
229 target_label = "instance";
230 }
231 { replacement = "localhost:${toString config.services.prometheus.exporters.blackbox.port}";
232 target_label = "__address__";
233 }
234 ];
235 scrape_interval = "5s";
236 }
204 ]; 237 ];
205 238
206 rules = [ 239 rules = [