diff options
Diffstat (limited to 'hosts/vidhar/prometheus')
-rw-r--r-- | hosts/vidhar/prometheus/default.nix | 33 |
1 files changed, 33 insertions, 0 deletions
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 = [ |