Docker container to expose apcupsd data for use by Prometheus/Grafana
Connects to APC UPS devices via a USB and exposes data for consumption by Prometheus. I use this on a Raspberry Pi to add my UPS data to InternetPi.
This project makes use of apcupsd_exporter to expose apcupsd's metrics over HTTP in a form Prometheus can easily consume.
Edit apcupsd.conf
as you see fit, particuarly if you prefer to use an Ethernet connected APC UPS device. You must rebuild
existing container images after changes to this file.
Build the container locally by running:
docker build -t apcupsd-docker:latest .
Assuming you have a docker-compose.yaml
file already for Prom/Grafana, add a service as follows:
apcups:
image: apcupsd-docker:latest
expose:
- 9162
ports:
- 9162:9162
restart: always
devices:
- "/dev/usb/hiddev0:/dev/usb/hiddev0"
Add somethign like this to your prometheus.yml
- job_name: 'ups'
static_configs:
- targets: ['apcups:9162']
A sample Grafana dashboard configuration file is provided in /grafana/ups.json
.
- Add the ability to pull configuration at runtime rather than build time