Skip to content

Roken120/prometheus-nut-exporter

 
 

Repository files navigation

Prometheus NUT Exporter

GitHub release CI FOSSA status Docker pulls

A Prometheus exporter for uninterruptable power supplies (UPSes) using Network UPS Tools (NUT).

Usage

NUT

Set up NUT in server mode and make sure the TCP port (3493 by default) is accessible.

Docker

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"

Prometheus

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

Metrics

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.

References

License

GNU General Public License version 3 (GPLv3).

About

Prometheus exporter for Network UPS Tools (NUT)

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 93.1%
  • Dockerfile 3.8%
  • Shell 3.1%