Skip to content

Instantly share code, notes, and snippets.

@betweenbrain
Last active February 4, 2025 14:02
Show Gist options
  • Save betweenbrain/2dd28791f6508d3969ad8a157f3c7041 to your computer and use it in GitHub Desktop.
Save betweenbrain/2dd28791f6508d3969ad8a157f3c7041 to your computer and use it in GitHub Desktop.
Network UPS Tools Setup

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 like Bus 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment