https://github.com/joeshaw/tripplite-ups-exporter
Prometheus exporter for Tripp Lite UPSes over USB HID
https://github.com/joeshaw/tripplite-ups-exporter
golang prometheus-exporter tripp-lite ups
Last synced: 6 months ago
JSON representation
Prometheus exporter for Tripp Lite UPSes over USB HID
- Host: GitHub
- URL: https://github.com/joeshaw/tripplite-ups-exporter
- Owner: joeshaw
- License: mit
- Created: 2020-07-15T20:58:34.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2022-11-10T18:47:24.000Z (over 2 years ago)
- Last Synced: 2024-06-20T16:52:45.954Z (12 months ago)
- Topics: golang, prometheus-exporter, tripp-lite, ups
- Language: Go
- Homepage:
- Size: 2.93 KB
- Stars: 5
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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](https://github.com/karalabe/hid) 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.