summaryrefslogtreecommitdiff
path: root/roles/monitoring/prometheus/exporter/register/templates/nut/ups.yml.j2
blob: 6c549e1ef23db4b9747e3452658724c143725ecc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
- 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 %}
    __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  %}
{% for name, value in prometheus_target_labels.items() %}
    {{ name }}: '{{ value }}'
{% endfor %}