From 80bf65fe1c65cfeb1a88a3a8bf6b27fe97faecff Mon Sep 17 00:00:00 2001 From: nihonium Date: Thu, 31 Oct 2024 23:05:19 +0300 Subject: [PATCH] initial commit --- blackbox.yml | 10 ++++++++++ docker-compose.yml | 14 ++++++++++++++ prometheus.yml | 19 +++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 blackbox.yml create mode 100644 docker-compose.yml create mode 100644 prometheus.yml diff --git a/blackbox.yml b/blackbox.yml new file mode 100644 index 0000000..db40e73 --- /dev/null +++ b/blackbox.yml @@ -0,0 +1,10 @@ +modules: + http_2xx: + prober: http + timeout: 10s + valid_http_versions: [ " " ] + valid_http_statuses: [ "2xx", "3xx" ] + method: GET + headers: + User-Agent: "PTSTART INT-4 Blackbox Exporter" + follow_redirects: true diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..6d701e9 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,14 @@ +services: + prometheus: + image: prom/prometheus + volumes: + - ./prometheus.yml:/etc/prometheus/prometheus.yml + ports: + - "9090:9090" + + blackbox_exporter: + image: prom/blackbox-exporter + volumes: + - ./blackbox.yml:/etc/blackbox_exporter/blackbox.yml + ports: + - "9115:9115" diff --git a/prometheus.yml b/prometheus.yml new file mode 100644 index 0000000..77fff1f --- /dev/null +++ b/prometheus.yml @@ -0,0 +1,19 @@ +global: + scrape_interval: 15s + evaluation_interval: 15s + +scrape_configs: + - job_name: 'blackbox' + metrics_path: /probe + params: + module: [http_2xx] + static_configs: + - targets: + - ptsecurity.com + relabel_configs: + - source_labels: [__address__] + target_label: __param_target + - source_labels: [__param_target] + target_label: instance + - target_label: __address__ + replacement: blackbox_exporter:9115