summaryrefslogtreecommitdiff
path: root/roles/monitoring/prometheus/server/templates/targets/nut-ups.yml.j2
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2021-09-21 19:34:25 +0200
committerChristian Pointner <equinox@spreadspace.org>2021-09-21 19:42:54 +0200
commita8e8cb2ed3d5e68d89edd8785ed59f0ee45f81bf (patch)
treee6457f4c46782e27c8d359e966e8afe1afca87a8 /roles/monitoring/prometheus/server/templates/targets/nut-ups.yml.j2
parentch-sensors1 add new 1-wire therm sensor and fix regexp (diff)
prometheus: simplify job config
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.j217
1 files changed, 17 insertions, 0 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
new file mode 100644
index 00000000..da3de3d7
--- /dev/null
+++ b/roles/monitoring/prometheus/server/templates/targets/nut-ups.yml.j2
@@ -0,0 +1,17 @@
+- targets: [ "{{ hostvars[target.config.exporter_hostname].prometheus_scrape_endpoint }}" ]
+ labels:
+ instance: "{{ target.instance }}"
+ __param_ups: {{ target.config.ups }}
+ __param_server: {{ target.config.server | default('127.0.0.1') }}
+{% if 'username' in target.config %}
+ __param_username: {{ target.config.username }}
+{% endif %}
+{% if 'password' in target.config %}
+ __param_password: {{ target.config.password }}
+{% endif %}
+{% if 'variables' in target.config %}
+ __param_variables: {{ target.config.variables }}
+{% endif %}
+{% if 'statuses' in target.config %}
+ __param_statuses: {{ target.config.statuses }}
+{% endif %}