If you are using NUT (Network UPS Tools) you can monitor your UPS current and historical usage with Grafana. There are several Grafana dashboards available for NUT however I decided to settle on Unraid NUT UPS Dashboard TR. Now don’t worry if you are not running Unraid, neither am I and I was able to tweak their Unraid instructions to running in my Docker Swarm environment of Raspberry Pies.
Requirements
This post is not going into setting up Grafana or NUT and is tweaked for running for containerized in a Docker Swarm cluster. However the information here should be enough to setup if you are not using containerization.
- A running instance of Grafana
- A running instance of InfluxDB version 1.x (the exporter script does not support v2+)
- A running instance of NUT
nut-influxdb-exporter
nut-influxdb-exporter is a dockerized Python script that will send data from NUT to InfluxDB. Now here you have 2 options:
- maihai/nut-influxdb-exporter (Creators own Docker image, only supports AMD64 processors)
- eblabs/nut-influxdb-exporter (My multi-arch clone of the above image with supports arm7, arm64 and AMD64 processors)
nut-influxdb-exporter service definition
nut-influxdb-exporter:
image: eblabs/nut-influxdb-exporter
environment:
INFLUXDB_HOST: influxdb
INFLUXDB_PORT: 8086
INFLUXDB_USER: yourusername
INFLUXDB_PASSWORD: 'yourpassword'
INFLUXDB_DATABASE: nut
NUT_HOST: NUTserverIP
NUT_PORT: 3493
NUT_USERNAME: nutusername
NUT_PASSWORD: 'nutpassword'
UPS_NAME: 'yourUPSname'
# VERBOSE: 'true'
Setting up the Datasource in Grafana
- In Grafana go to Configuration -> Datasources
- Select “Add data source”
- Select “InfluxDB”
Influx-UPS-NUT datasource settings
Importing the dashboard into Grafana
- In Grafana go to Create (+) -> Import
- ID is 10914
And now you should be able to monitor your UPS
Looking for a UPS?
I’ve been using APC Uninterruptible Power Supplies for over twenty years. I’ve worked with probably their entire product line from desktop, rack mounted and data center power distribution. If you’ve never had a UPS or need a new one APC is the way to go.