Setup blackbox for some HTTP monitoring

This commit is contained in:
Jake Howard
2022-12-04 22:11:49 +00:00
parent e89f13b8a9
commit 75862dbaf9
6 changed files with 112 additions and 29 deletions

View File

@ -0,0 +1,23 @@
modules:
http:
prober: http
timeout: 10s
http_external:
prober: http
timeout: 10s
http:
proxy_url: http://{{ pve_hosts.qbittorrent.ip }}:3128
skip_resolve_phase_with_proxy: true
https_redir:
prober: http
timeout: 10s
http:
method: GET
valid_status_codes: [301, 302, 307, 308]
no_follow_redirects: true
fail_if_ssl: true
fail_if_header_not_matches:
- header: Location
regexp: ^https

View File

@ -14,6 +14,12 @@ services:
ports:
- "{{ pve_hosts.forrest.ip }}:9090:9090"
blackbox:
image: prom/blackbox-exporter:latest
restart: unless-stopped
volumes:
- ./blackbox.yml:/etc/blackbox_exporter/config.yml
networks:
prometheus:
external: true

View File

@ -4,7 +4,6 @@ scrape_configs:
- source_labels: [__name__]
regex: go_.+
action: drop
static_configs:
- targets:
- "{{ pve_hosts.pve.ip }}:9273"
@ -14,7 +13,6 @@ scrape_configs:
- source_labels: [__name__]
regex: go_.+
action: drop
static_configs:
- targets:
- "{{ nebula.clients.walker.ip }}:8080"
@ -23,14 +21,57 @@ scrape_configs:
- job_name: homeassistant
metrics_path: /api/prometheus
authorization:
credentials: "{{ homeassistant_token }}"
metric_relabel_configs:
- source_labels: [__name__]
regex: go_.+
action: drop
static_configs:
- targets: ["{{ pve_hosts.homeassistant.ip }}:8123"]
- job_name: blackbox_http_external
scrape_interval: 1m
metrics_path: /probe
params:
module: [http_external]
static_configs:
- targets:
- https://bin.theorangeone.net
- https://git.theorangeone.net/-/liveness?token={{ gitlab_liveness_access_token }}
- https://grafana.jakehoward.tech/api/health
- https://homeassistant.jakehoward.tech
- https://intersect.jakehoward.tech
- https://mastodon.theorangeone.net/health
- https://matrix.jakehoward.tech:8448/_matrix/federation/v1/version
- https://matrix.jakehoward.tech/_matrix/federation/v1/version
- https://media.jakehoward.tech
- https://notes.theorangeone.net
- https://plausible.theorangeone.net
- https://recipes.jakehoward.tech
- https://theorangeone.net
- https://tt-rss.jakehoward.tech
- https://vaultwarden.jakehoward.tech/alive
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: blackbox:9115
- job_name: blackbox_https_redir
scrape_interval: 10m
metrics_path: /probe
params:
module: [https_redir]
static_configs:
- targets:
- http://{{ hosts.casey_ip }}
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: blackbox:9115