Git Product home page Git Product logo

tripplite-ups-exporter's Introduction

tripplite-ups-exporter

This is a simple Prometheus exporter for Tripp Lite UPS devices that expose their properties as a USB HID device.

As of today this has only been tested on a SMART1500LCD with USB vendor ID 09AE and product ID 2012. It has only been tested on Linux (and specifically a Raspberry Pi) though it should also work on Mac and Windows thanks to the Gopher Interface Devices HID library it uses.

Installing

The tool can be installed with:

go get -u github.com/joeshaw/tripplite-ups-exporter

Because this program needs to access USB devices you may need elevated permissions to access the devices. One way to do this is to run as root, but on Linux you can also set up a udev rule to give access to a unix group. On the Raspberry Pi the default pi user is in the dialout group, which is meant to give access to serial devices. So I just use that and create a file in /etc/udev/rules.d:

echo 'SUBSYSTEM=="usb", ATTRS{idVendor}=="09ae", ATTRS{idProduct}=="2012", GROUP="dialout"' > /etc/udev/rules.d/55-tripplite-ups.rules

And then run:

udevadm control --reload-rules

to load the new rule in.

Then you can run the service:

tripplite-ups-exporter

By default the exporter will listen on port 9528. This can be changed with the -addr flag.

Contributing

Issues and pull requests are welcome. When filing a PR, please make sure the code has been run through gofmt.

License

Copyright 2020 Joe Shaw

tripplite-ups-exporter is licensed under the MIT License. See the LICENSE file for details.

tripplite-ups-exporter's People

Contributors

joeshaw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

duhruh alanbbr

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.