A Prometheus exporter for uninterruptable power supplies (UPSes) using Network UPS Tools (NUT).
Set up NUT in server mode and make sure the TCP port (3493 by default) is accessible.
Note: The Docker image tags stable
and bleeding
are no longer used. Use latest
(unstable) and 1
(stable v1) instead.
Example docker-compose.yml
:
version: "3.7"
services:
nut-exporter:
image: hon95/prometheus-nut-exporter:1
environment:
- TZ=Europe/Oslo
# Defaults
#- HTTP_PORT=9995
#- HTTP_PATH=/nut
#- LOG_REQUESTS_CONSOLE=false
#- PRINT_METRICS_AND_EXIT=false
ports:
- "9995:9995/tcp"
Example prometheus.yml
:
global:
scrape_interval: 15s
scrape_timeout: 10s
scrape_configs:
- job_name: "nut"
static_configs:
# Insert NUT server address here
- targets: ["nut-server:3493"]
metrics_path: /nut
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
# Insert NUT exporter address here
replacement: nut-exporter:9995
See metrics.
To check if a specific UPS is unavailable, use something like: absent(nut_status{job="...", ups="..."})
I only have a few PowerWalker UPSes to test with, so I've only added metrics for useful variables for those. If you want more metrics/vars, you're welcome to request it or implement it yourself.
- NUT: GENERICUPS(8)
- NUT Developer Guide: 9. Network protocol information
- NUT Developer Guide: A.1. Variables
GNU General Public License version 3 (GPLv3).