summaryrefslogtreecommitdiff
path: root/roles/monitoring/prometheus/exporter
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2024-06-29 22:55:29 +0200
committerChristian Pointner <equinox@spreadspace.org>2024-06-29 22:57:05 +0200
commit91fc6ce942be1da2026e7b8dcefda5cc86a8fdb3 (patch)
treeed3b75dd233b41d9981da641108b94c511c8e88d /roles/monitoring/prometheus/exporter
parentrevamp prometheus metric lables for ssl/probe (diff)
revamp prometheus metric lables for ipmi/remote and nut/ups
Diffstat (limited to 'roles/monitoring/prometheus/exporter')
-rw-r--r--roles/monitoring/prometheus/exporter/register/filter_plugins/prometheus.py2
-rw-r--r--roles/monitoring/prometheus/exporter/register/templates/nut/ups.yml.j21
2 files changed, 3 insertions, 0 deletions
diff --git a/roles/monitoring/prometheus/exporter/register/filter_plugins/prometheus.py b/roles/monitoring/prometheus/exporter/register/filter_plugins/prometheus.py
index 473eb655..50e34865 100644
--- a/roles/monitoring/prometheus/exporter/register/filter_plugins/prometheus.py
+++ b/roles/monitoring/prometheus/exporter/register/filter_plugins/prometheus.py
@@ -9,6 +9,8 @@ from ansible import errors
_multitarget_id_map_ = {
"blackbox/probe": (lambda vars, config: (vars['inventory_hostname'], "%s-%s" % (config['svc_kind'], config['svc_instance']))),
"ssl/probe": (lambda vars, config: (vars['inventory_hostname'], "%s-%s-%s" % (config['module'], config['sslcert_instance'], vars['inventory_hostname']))),
+ "ipmi/remote": (lambda vars, config: (vars['inventory_hostname'], vars['inventory_hostname'])),
+ "nut/ups": (lambda vars, config: (vars['inventory_hostname'], config['ups'])),
"whawty-nginx-sso": (lambda vars, config: (vars['inventory_hostname'], "%s-%s" % (config['app_instance'], vars['inventory_hostname']))),
}
diff --git a/roles/monitoring/prometheus/exporter/register/templates/nut/ups.yml.j2 b/roles/monitoring/prometheus/exporter/register/templates/nut/ups.yml.j2
index 5181f4e4..6c549e1e 100644
--- a/roles/monitoring/prometheus/exporter/register/templates/nut/ups.yml.j2
+++ b/roles/monitoring/prometheus/exporter/register/templates/nut/ups.yml.j2
@@ -1,6 +1,7 @@
- targets: [ '{{ (target.exporter_hostname == prometheus_server) | ternary('127.0.0.1:9999', hostvars[target.exporter_hostname].prometheus_scrape_endpoint) }}' ]
labels:
instance: '{{ target.instance }}'
+ ups_instance: '{{ target.config.ups }}'
__param_ups: '{{ target.config.ups }}'
__param_server: '{{ target.config.server | default('127.0.0.1') }}'
{% if 'username' in target.config %}