These notes from http://tedfelix.com/software/nut-network-ups-tools.html and https://zackreed.me/installing-nut-on-ubuntu/
- Install NUT
$ sudo apt-get install nut
- Identify UPS
$ lsusb
You may see something likeBus 006 Device 005: ID 0764:0501 Cyber Power System, Inc. CP1500 AVR UPS
- Update ups.conf
$ nano /etc/nut/ups.conf
Add to end of file for a USB connected UPS (e.g. CyberPower 1285 AVR)
[upsname]
driver = usbhid-ups
port = auto
Test the ups.conf file:
$ sudo upsdrvctl start
Normal output:
Network UPS Tools - UPS driver controller 2.6.3
Network UPS Tools - Generic HID driver 0.35 (2.6.3)
USB communication driver 0.31
Using subdriver: CyberPower HID 0.3
- Launch upsd
sudo upsd
Normal output
Network UPS Tools upsd 2.6.3
listening on 127.0.0.1 port 3493
listening on ::1 port 3493
Connected to UPS [upsname]: usbhid-ups-serverups
- Test the upsd with upsc
sudo upsc upsname@localhost
- Log UPS stats every second to a tmp file
upslog -s upsname -l /tmp/upslog.txt -i 1