Giter VIP home page Giter VIP logo

pwrstat-exporter's Introduction

Pwrstat Exporter

A Prometheus exporter for CyberPower UPS Linux daemon (pwrstat).

Overview

The Pwrstat Exporter enables Prometheus to monitor data from CyberPower Uninterruptible Power Supply (UPS) systems running on Linux. It uses the pwrstat Linux daemon for data acquisition.

Docker Deployment

Prerequisites Docker installed on your system.

Installation

Run the following command to install the Pwrstat Exporter using Docker:

docker run \
  --name pwrstat-exporter \
  --device /dev/bus/usb:/dev/bus/usb \
  --device /dev/usb/hiddev0:/dev/usb/hiddev0 \
  --privileged \
  --restart unless-stopped \
  -p 8088:8088 \
  -d cardif99/pwrstat-exporter:latest

Alternatively, refer to the provided docker-compose.yaml for a Docker Compose setup.

Building from Source

Prerequisites

  • Golang version 1.16 or higher.

Installation

Clone the repository and build the executable:

git clone https://github.com/kerwenwwer/pwrstat-exporter.git
cd pwrstat-exporter
go build && mv pwrstat-exporter /usr/local/bin/

Usage

The pwrstat command requires sudo privileges:

sudo pwrstat-exporter 

To specify arguments:

sudo pwrstat-exporter --web.listen-address 8088 --web.telemetry-path /metrics

Systemd Service Integration

Configuration Create a systemd service configuration file at /etc/systemd/system/pwrstat-exporter.service:

[Unit]
Description=pwrstat-exporter

[Service]
TimeoutStartSec=0
ExecStart=/usr/local/bin/pwrstat-exporter

[Install]
WantedBy=multi-user.target

Reload the systemd daemon, enable the service at startup, and start the service:

sudo systemctl daemon-reload
sudo systemctl enable pwrstat-exporter
sudo service pwrstat-exporter start

Grafana Integration

A custom Grafana dashboard is available for visualizing the data. Import the dashboard using the grafana-dashboard.json file. grafana

pwrstat-exporter's People

Contributors

kerwenwwer avatar lorenzocardinali avatar silence-eternal avatar jortgies avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.