summaryrefslogtreecommitdiffstats
path: root/krebs/2configs/shack/prometheus/blackbox.nix
blob: 82ce003e886a303762fbfb7adf0b37c6b6088c51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{pkgs, ... }:
{
  systemd.services.prometheus-blackbox-exporter.serviceConfig = {
    CapabilityBoundingSet = ["CAP_NET_RAW"]; # icmp allow
    AmbientCapabilities = ["CAP_NET_RAW"];
  };
  services.prometheus.exporters.blackbox = {
    enable = true;
    # openFirewall = true; # not requred if running on the same host as prometheus
    port = 9115;
    configFile = pkgs.writeText "icmp" ''
      modules:
        icmp:
          prober: icmp
          icmp:
            preferred_ip_protocol: ip4
    '';
  };
}