diff options
author | Franck Cuny <franck@fcuny.net> | 2022-04-04 14:17:59 -0700 |
---|---|---|
committer | Franck Cuny <franck@fcuny.net> | 2022-04-04 14:17:59 -0700 |
commit | ca2663cdd55205c64deabe371af668f61eef4d30 (patch) | |
tree | 2d844f4cc708aec7ed38221d733ec929a5e59222 /hosts | |
parent | prometheus: attempt to configure blackbox exporter (diff) | |
download | world-ca2663cdd55205c64deabe371af668f61eef4d30.tar.gz |
prometheus: configure correctly the blackbox
Diffstat (limited to '')
-rw-r--r-- | hosts/common/server/prometheus.nix | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/hosts/common/server/prometheus.nix b/hosts/common/server/prometheus.nix index bf6cb54..012fdb5 100644 --- a/hosts/common/server/prometheus.nix +++ b/hosts/common/server/prometheus.nix @@ -60,18 +60,31 @@ in { "--web.enable-admin-api" ]; - blackboxTargets = [{ - job_name = "icmp_probe"; - metrics_path = "/probe/blackbox"; - scrape_interval = "1m"; - params = { module = [ "icmp" ]; }; - targets = [ "8.8.8.8" ]; - static_configs = [{ targets = [ "127.0.0.1:9115" ]; }]; - relabel_configs = relabelConfigs; - }]; - scrapeConfigs = [ { + job_name = "blackbox-ping"; + metrics_path = "/probe"; + params = { module = [ "icmp" ]; }; + static_configs = [{ + targets = + [ "8.8.8.8" "1.1.1.1" "4.4.4.4" "fcuny.net" "git.fcuny.net" ]; + }]; + relabel_configs = [ + { + source_labels = [ "__address__" ]; + target_label = "__param_target"; + } + { + source_labels = [ "__param_target" ]; + target_label = "instance"; + } + { + target_label = "__address__"; + replacement = "localhost:9115"; + } + ]; + } + { job_name = "node"; static_configs = [{ targets = [ "192.168.6.1:9100" "192.168.6.20:9100" ]; }]; |