summaryrefslogtreecommitdiff
path: root/roles/monitoring/prometheus/server/templates/targets/nut/ups.yml.j2
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2021-10-26 00:49:54 +0200
committerChristian Pointner <equinox@spreadspace.org>2021-10-26 00:49:54 +0200
commit61700fa5c63b6f2a45b2ba3210247b4fe6028afa (patch)
tree128dc93901d267c7e21e741dbfc0a994a658c357 /roles/monitoring/prometheus/server/templates/targets/nut/ups.yml.j2
parentdisable all grafana dashboards for now (diff)
prometheus: scrape exporter running on server using localhost address
Diffstat (limited to 'roles/monitoring/prometheus/server/templates/targets/nut/ups.yml.j2')
-rw-r--r--roles/monitoring/prometheus/server/templates/targets/nut/ups.yml.j22
1 files changed, 1 insertions, 1 deletions
diff --git a/roles/monitoring/prometheus/server/templates/targets/nut/ups.yml.j2 b/roles/monitoring/prometheus/server/templates/targets/nut/ups.yml.j2
index c60077c7..a25cdfe5 100644
--- a/roles/monitoring/prometheus/server/templates/targets/nut/ups.yml.j2
+++ b/roles/monitoring/prometheus/server/templates/targets/nut/ups.yml.j2
@@ -1,4 +1,4 @@
-- targets: [ '{{ hostvars[target.exporter_hostname].prometheus_scrape_endpoint }}' ]
+- targets: [ '{{ (target.exporter_hostname == prometheus_server) | ternary('127.0.0.1:9999', hostvars[target.exporter_hostname].prometheus_scrape_endpoint) }}' ]
labels:
instance: '{{ target.instance }}'
__param_ups: '{{ target.config.ups }}'