From 788e60da564c8def596c59953494dbb652633e99 Mon Sep 17 00:00:00 2001 From: Aine Date: Sun, 19 Mar 2023 22:34:43 +0200 Subject: [PATCH 1/2] prometheus-blackbox-exporter --- docs/services/prometheus-blackbox-exporter.md | 31 +++++++++++++++ docs/supported-services.md | 3 +- group_vars/mash_servers | 38 +++++++++++++++++++ requirements.yml | 3 ++ 4 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 docs/services/prometheus-blackbox-exporter.md diff --git a/docs/services/prometheus-blackbox-exporter.md b/docs/services/prometheus-blackbox-exporter.md new file mode 100644 index 0000000..2b1bb91 --- /dev/null +++ b/docs/services/prometheus-blackbox-exporter.md @@ -0,0 +1,31 @@ +# Prometheus Blackbox Expoter + +This playbook can configure [Prometheus Blackbox Exporter](https://github.com/prometheus/blackbox_exporter). + +## Configuration + +To enable this service, add the following configuration to your `vars.yml` file and re-run the [installation](../installing.md) process: + +```yaml +######################################################################## +# # +# prometheus-blackbox-exporter # +# # +######################################################################## + +prometheus_blackbox_exporter_enabled: true +prometheus_blackbox_exporter_hostname: mash.example.com +prometheus_blackbox_exporter_path_prefix: /metrics/blackbox-exporter +prometheus_blackbox_exporter_basicauth_user: your_username +prometheus_blackbox_exporter_basicauth_password: your password + +######################################################################## +# # +# /prometheus-blackbox-exporter # +# # +######################################################################## +``` + +## Usage + +After you installed the blackbox exporter, your blackbox prober will be available on `mash.example.com/metrics/blackbox-exporter` with basic auth credentials you configured diff --git a/docs/supported-services.md b/docs/supported-services.md index b2a90fd..cb11a76 100644 --- a/docs/supported-services.md +++ b/docs/supported-services.md @@ -11,7 +11,8 @@ | [Miniflux](https://miniflux.app/) | Minimalist and opinionated feed reader. | [Link](services/miniflux.md) | | [Nextcloud](https://nextcloud.com/) | The most popular self-hosted collaboration solution for tens of millions of users at thousands of organizations across the globe. | [Link](services/nextcloud.md) | | [PeerTube](https://joinpeertube.org/) | A tool for sharing online videos | [Link](services/peertube.md) | -| [Prometheus Node Exporter](https://github.com/prometheus/node_exporter) | Exporter for machine metrics | [Link](services/prometheus-node-exporter.md) | +| [Prometheus Node Exporter](https://github.com/prometheus/node_exporter) | Exporter for machine metrics | [Link](services/prometheus-node-exporter.md) | +| [Prometheus Blackbox Exporter](https://github.com/prometheus/blackbox_exporter) | Blackbox probing of HTTP/HTTPS/DNS/TCP/ICMP and gRPC endpoints | [Link](services/prometheus-blackbox-exporter.md) | | [Postgres](https://www.postgresql.org) | A powerful, open source object-relational database system | [Link](services/postgres.md) | | [Postgres Backup](https://github.com/prodrigestivill/docker-postgres-backup-local) | A solution for backing up PostgresSQL to local filesystem with periodic backups. | [Link](services/postgres-backup.md) | | [Radicale](https://radicale.org/) | A Free and Open-Source CalDAV and CardDAV Server (solution for hosting contacts and calendars) | [Link](services/radicale.md) | diff --git a/group_vars/mash_servers b/group_vars/mash_servers index e3c4943..900bf90 100644 --- a/group_vars/mash_servers +++ b/group_vars/mash_servers @@ -75,6 +75,8 @@ devture_systemd_service_manager_services_list_auto: | + ([{'name': (peertube_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'peertube']}] if peertube_enabled else []) + + ([{'name': (prometheus_blackbox_exporter_identifier + '.service'), 'priority': 500, 'groups': ['mash', 'metrics', 'prometheus-blackbox-exporter']}] if prometheus_blackbox_exporter_enabled else []) + + ([{'name': (prometheus_node_exporter_identifier + '.service'), 'priority': 500, 'groups': ['mash', 'metrics', 'prometheus-node-exporter']}] if prometheus_node_exporter_enabled else []) + ([{'name': (radicale_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'radicale']}] if radicale_enabled else []) @@ -651,6 +653,42 @@ peertube_systemd_required_services_list: | ######################################################################## +######################################################################## +# # +# prometheus_blackbox_exporter # +# # +######################################################################## + +prometheus_blackbox_exporter_enabled: false + +prometheus_blackbox_exporter_identifier: "{{ mash_playbook_service_identifier_prefix }}prometheus-blackbox-exporter" + +prometheus_blackbox_exporter_base_path: "{{ mash_playbook_base_path }}/prometheus-blackbox-exporter" + +prometheus_blackbox_exporter_uid: "{{ mash_playbook_uid }}" +prometheus_blackbox_exporter_gid: "{{ mash_playbook_gid }}" + +prometheus_blackbox_exporter_basicauth_enabled: true +prometheus_blackbox_exporter_basicauth_user: "{{ '%s' | format(mash_playbook_generic_secret_key) | password_hash('sha512', 'blackbox.user', rounds=655555) | to_uuid }}" +prometheus_blackbox_exporter_basicauth_password: "{{ '%s' | format(mash_playbook_generic_secret_key) | password_hash('sha512', 'blackbox.password', rounds=655555) | to_uuid }}" + +prometheus_blackbox_exporter_container_additional_networks: | + {{ + ([mash_playbook_reverse_proxyable_services_additional_network] if mash_playbook_reverse_proxyable_services_additional_network else []) + }} + +prometheus_blackbox_exporter_container_labels_traefik_enabled: "{{ mash_playbook_traefik_labels_enabled }}" +prometheus_blackbox_exporter_container_labels_traefik_docker_network: "{{ mash_playbook_reverse_proxyable_services_additional_network }}" +prometheus_blackbox_exporter_container_labels_traefik_entrypoints: "{{ devture_traefik_entrypoint_primary }}" +prometheus_blackbox_exporter_container_labels_traefik_tls_certResolver: "{{ devture_traefik_certResolver_primary }}" + +######################################################################## +# # +# /prometheus_blackbox_exporter # +# # +######################################################################## + + ######################################################################## # # # prometheus_node_exporter # diff --git a/requirements.yml b/requirements.yml index 8e6edca..22ba990 100644 --- a/requirements.yml +++ b/requirements.yml @@ -66,6 +66,9 @@ - src: git+https://gitlab.com/etke.cc/roles/prometheus_node_exporter.git version: v1.5.0-4 +- src: git+https://gitlab.com/etke.cc/roles/prometheus_blackbox_exporter.git + version: v0.23.0-0 + - src: git+https://gitlab.com/etke.cc/roles/redmine.git version: v5.0.5-1 From 7e7be4942ded81560b414e40e1c1c7106d90eb71 Mon Sep 17 00:00:00 2001 From: Slavi Pantaleev Date: Mon, 20 Mar 2023 09:08:26 +0200 Subject: [PATCH 2/2] Let prometheus-blackbox-exporter config breathe a bit --- docs/services/prometheus-blackbox-exporter.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/services/prometheus-blackbox-exporter.md b/docs/services/prometheus-blackbox-exporter.md index 2b1bb91..7c629f4 100644 --- a/docs/services/prometheus-blackbox-exporter.md +++ b/docs/services/prometheus-blackbox-exporter.md @@ -14,8 +14,10 @@ To enable this service, add the following configuration to your `vars.yml` file ######################################################################## prometheus_blackbox_exporter_enabled: true + prometheus_blackbox_exporter_hostname: mash.example.com prometheus_blackbox_exporter_path_prefix: /metrics/blackbox-exporter + prometheus_blackbox_exporter_basicauth_user: your_username prometheus_blackbox_exporter_basicauth_password: your password @@ -28,4 +30,4 @@ prometheus_blackbox_exporter_basicauth_password: your password ## Usage -After you installed the blackbox exporter, your blackbox prober will be available on `mash.example.com/metrics/blackbox-exporter` with basic auth credentials you configured +After you've installed the blackbox exporter, your blackbox prober will be available on `mash.example.com/metrics/blackbox-exporter` with the basic auth credentials you've configured.