diff options
author | Christian Pointner <equinox@spreadspace.org> | 2021-07-27 22:19:18 +0200 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2021-07-27 22:19:18 +0200 |
commit | a7f837c47621f01723feb96f5fd0d54a13376a01 (patch) | |
tree | 67b468c68392e4774922a17364f5365881f95ce4 /roles/monitoring/prometheus/exporter/nut/tasks/main.yml | |
parent | add prometheus to ele-router (diff) |
add nut aka UPS to prometheus monitoring
Diffstat (limited to 'roles/monitoring/prometheus/exporter/nut/tasks/main.yml')
-rw-r--r-- | roles/monitoring/prometheus/exporter/nut/tasks/main.yml | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/roles/monitoring/prometheus/exporter/nut/tasks/main.yml b/roles/monitoring/prometheus/exporter/nut/tasks/main.yml new file mode 100644 index 00000000..519ac7a0 --- /dev/null +++ b/roles/monitoring/prometheus/exporter/nut/tasks/main.yml @@ -0,0 +1,28 @@ +--- +- name: install apt packages + apt: + name: prom-exporter-nut + state: present + +- name: generate systemd service unit + template: + src: service.j2 + dest: /etc/systemd/system/prometheus-nut-exporter.service + notify: restart prometheus-nut-exporter + +- name: make sure prometheus-nut-exporter is enabled and started + systemd: + name: prometheus-nut-exporter.service + daemon_reload: yes + state: started + enabled: yes + +- name: register exporter + copy: + content: | + method: http + http: + port: 9199 + path: /ups_metrics + dest: /etc/prometheus/exporter/enabled/nut.yml + notify: reload prometheus-exporter-exporter |