diff options
author | Christian Pointner <equinox@spreadspace.org> | 2021-07-28 13:50:00 +0200 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2021-07-28 13:50:00 +0200 |
commit | 312c81d93d087642979939f37d20c64527d7ad82 (patch) | |
tree | dc1e2ca613acc032a38a7462bebe2020cfbd9429 /roles | |
parent | add nut aka UPS to prometheus monitoring (diff) |
promehteus nut exporter: make exported variables and statuses configureable
Diffstat (limited to 'roles')
-rw-r--r-- | roles/monitoring/prometheus/exporter/nut/defaults/main.yml | 28 | ||||
-rw-r--r-- | roles/monitoring/prometheus/exporter/nut/templates/service.j2 | 2 |
2 files changed, 29 insertions, 1 deletions
diff --git a/roles/monitoring/prometheus/exporter/nut/defaults/main.yml b/roles/monitoring/prometheus/exporter/nut/defaults/main.yml new file mode 100644 index 00000000..e358627c --- /dev/null +++ b/roles/monitoring/prometheus/exporter/nut/defaults/main.yml @@ -0,0 +1,28 @@ +--- +prometheus_exporter_nut_variables: + - "battery.charge" + - "battery.runtime" + - "battery.voltage" + - "battery.voltage.nominal" + - "input.frequency" + - "input.frequency.nominal" + - "input.voltage" + - "input.voltage.nominal" + - "output.frequency" + - "output.frequency.nominal" + - "output.voltage" + - "output.voltage.nominal" + - "ups.load" + - "ups.power" + - "ups.power.nominal" + - "ups.realpower" + - "ups.realpower.nominal" + - "ups.status" + +prometheus_exporter_nut_statuses: + - "OL" + - "OB" + - "LB" + - "RB" + - "OFF" + - "OVER" diff --git a/roles/monitoring/prometheus/exporter/nut/templates/service.j2 b/roles/monitoring/prometheus/exporter/nut/templates/service.j2 index ffafcb3c..99613f50 100644 --- a/roles/monitoring/prometheus/exporter/nut/templates/service.j2 +++ b/roles/monitoring/prometheus/exporter/nut/templates/service.j2 @@ -4,7 +4,7 @@ Description=Prometheus nut exporter [Service] Restart=always User=prometheus-exporter -ExecStart=/usr/bin/prometheus-nut-exporter --web.listen-address="127.0.0.1:9199" +ExecStart=/usr/bin/prometheus-nut-exporter --web.listen-address="127.0.0.1:9199" --nut.vars_enable="{{ prometheus_exporter_nut_variables | join(',') }}" --nut.statuses="{{ prometheus_exporter_nut_statuses | join(',') }}" # systemd hardening-options AmbientCapabilities= |