prometheus: add blackbox exporter
This commit is contained in:
8
roles/prometheus/templates/blackbox_exporter.yml.j2
Normal file
8
roles/prometheus/templates/blackbox_exporter.yml.j2
Normal file
@@ -0,0 +1,8 @@
|
||||
---
|
||||
|
||||
modules:
|
||||
icmp:
|
||||
prober: icmp
|
||||
timeout: 5s
|
||||
icmp:
|
||||
preferred_ip_protocol: "ip4"
|
||||
@@ -26,6 +26,35 @@ scrape_configs:
|
||||
static_configs:
|
||||
- targets: ["localhost:9090"]
|
||||
|
||||
- job_name: "blackbox"
|
||||
static_configs:
|
||||
- targets: ["blackbox_exporter:9115"]
|
||||
|
||||
{% if prometheus_ping_hosts | length > 0 %}
|
||||
- job_name: "icmp"
|
||||
metrics_path: "/probe"
|
||||
params:
|
||||
module: ["icmp"]
|
||||
static_configs:
|
||||
- targets:
|
||||
{% for host in prometheus_ping_hosts %}
|
||||
- "{{ host.name }}::{{ host.type | default('monitored') }}"
|
||||
{% endfor %}
|
||||
relabel_configs:
|
||||
- source_labels: [__address__]
|
||||
regex: '(.+)::(.+)'
|
||||
target_label: __param_target
|
||||
replacement: '${1}'
|
||||
- source_labels: [__address__]
|
||||
regex: '(.+)::(.+)'
|
||||
target_label: host_type
|
||||
replacement: '${2}'
|
||||
- source_labels: [__param_target]
|
||||
target_label: instance
|
||||
- target_label: __address__
|
||||
replacement: blackbox_exporter:9115
|
||||
{%- endif %}
|
||||
|
||||
{% if prometheus_hcloud_enabled %}
|
||||
- job_name: hcloud
|
||||
hetzner_sd_configs:
|
||||
|
||||
Reference in New Issue
Block a user