Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Prometheus blackbox exporter config
#
# Scope: From the monitoring machine, ping (etc.) hosts to check wether
# they are reachable, certs still are valid for a while, etc.
#
# Notes: Blackbox exporter is using the "Multi Target Exporter" pattern,
# see https://prometheus.io/docs/guides/multi-target-exporter/ .
#
# Usage: Import this on a monitoring server
{ config, lib, pkgs, ... }:
let
in {
# The default limit of 1024 often is too small, see for example
# https://github.com/cloudalchemy/ansible-blackbox-exporter/issues/63
config.systemd.services.prometheus-blackbox-exporter.serviceConfig.LimitNOFILE = 65000;
config.services.prometheus.exporters.blackbox = {
enable = true;
configFile = pkgs.writeText "blackbox-exporter.yaml" (builtins.toJSON {
modules = {
https_2xx = {
prober = "http";
timeout = "5s";
http = {
fail_if_not_ssl = true;
# This prober is for IPv4 only.
preferred_ip_protocol = "ip4";
ip_protocol_fallback = false;
};
};
};
});
};
}