about summary refs log tree commit diff
path: root/hosts/common/server
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--hosts/common/server/prometheus.nix33
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" ]; }];