Add apcupsd_exporter for hypervisor

This commit is contained in:
Finn 2024-08-05 00:05:54 -07:00
parent 4c09b127c3
commit e42a09747e
6 changed files with 62 additions and 4 deletions

View file

@ -18,10 +18,6 @@ nameservers:
monitoring:
hosts:
hypervisor-d.home.finn.io:
ansible_host: 10.5.1.123
home_network: true
http.home.finn.io:
ansible_host: 10.5.1.245
home_network: true
@ -115,3 +111,9 @@ signal_bots:
hosts:
signald-2:
home_network: true
hypervisors:
hosts:
hypervisor-d.home.finn.io:
ansible_host: 10.5.1.123
home_network: true

7
playbook-hypervisor.yaml Normal file
View file

@ -0,0 +1,7 @@
- hosts: hypervisors
vars:
ansible_user: root
roles:
- base
- monitoring
- hypervisor

View file

@ -0,0 +1,7 @@
- name: systemctl daemon-reload
command: systemctl daemon-reload
- name: restart apcupsd_exporter
service:
name: apcupsd_exporter
state: restarted

View file

@ -0,0 +1 @@
- include_tasks: ups.yaml

View file

@ -0,0 +1,27 @@
- name: Install apcupsd
apt:
name: apcupsd
- name: download apcupsd_exporter
get_url:
url: https://git.janky.solutions/api/packages/JankySolutions/generic/infra-apcupsd_exporter/4c09b127c353cd57e6bc369f510fe516a0f65c0d/apcupsd_exporter
checksum: sha256:b17cc67d8ea9c6f1494b581a57a2315e33abf6dfb8edf2e1c14a50a0fb85e768
dest: /usr/local/bin/apcupsd_exporter
mode: "0755"
notify:
- restart apcupsd_exporter
- name: install apcupsd_exporter service
template:
src: apcupsd_exporter.service
dest: /etc/systemd/system/apcupsd_exporter.service
notify:
- systemctl daemon-reload
- restart apcupsd_exporter
- meta: flush_handlers
- name: enable apcupsd_exporter
service:
name: apcupsd_exporter
enabled: true

View file

@ -0,0 +1,14 @@
[Unit]
Description=apcupsd prometheus exporter
After=network.target
[Service]
Type=simple
User=nobody
Group=nogroup
ExecStart=/usr/local/bin/apcupsd_exporter
Restart=always
RestartSec=30
[Install]
WantedBy=multi-user.target