From edfa45bc9c45ad0629ae8bcf3ae9f12eab9ae5d8 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Tue, 27 Jul 2021 19:34:20 +0200 Subject: add accesspoint job to promethues --- inventory/host_vars/ele-mon.yml | 13 +++++++++++++ .../prometheus/server/templates/prometheus.yml.j2 | 1 + 2 files changed, 14 insertions(+) diff --git a/inventory/host_vars/ele-mon.yml b/inventory/host_vars/ele-mon.yml index a8840ef2..9fe9558c 100644 --- a/inventory/host_vars/ele-mon.yml +++ b/inventory/host_vars/ele-mon.yml @@ -72,3 +72,16 @@ prometheus_alertmanager_web_route_prefix: /alertmanager/ grafana_secret_key: "{{ vault_grafana_secret_key }}" + + +prometheus_server_jobs_extra: | + - job_name: 'node-openwrt' + scheme: http + static_configs: + - targets: + - 192.168.42.170:9100 + - 192.168.42.171:9100 + - 192.168.42.172:9100 + - 192.168.42.173:9100 + - 192.168.42.174:9100 + - 192.168.42.175:9100 diff --git a/roles/monitoring/prometheus/server/templates/prometheus.yml.j2 b/roles/monitoring/prometheus/server/templates/prometheus.yml.j2 index 6845a2d2..6db34920 100644 --- a/roles/monitoring/prometheus/server/templates/prometheus.yml.j2 +++ b/roles/monitoring/prometheus/server/templates/prometheus.yml.j2 @@ -52,5 +52,6 @@ scrape_configs: - "/etc/prometheus/jobs/{{ job }}/*.yml" {% endfor %} {% if prometheus_server_jobs_extra is defined %} + {{ prometheus_server_jobs_extra | indent(2) }} {% endif %} -- cgit v1.2.3