• Edit
  • Delete

Ubuntu Nut UPS (with Eaton 3s)

Nut / UPS

https://srackham.wordpress.com/2013/02/27/configuring-nut-for-the-eaton-3s-ups-on-ubuntu-linux/

https://networkupstools.org/docs/man/usbhid-ups.html

https://networkupstools.org/stable-hcl.html

Status Values

https://networkupstools.org/docs/man/genericups.html

  • OL - On line (no power failure) (opposite of OB - on battery)
  • LB - Low battery
  • SD - Shutdown load
  • CP - Cable power (must be present for cable to have valid reading)
  • CTS - Clear to Send. Received from the UPS.
  • RTS - Ready to Send. Sent by the PC.
  • DCD - Data Carrier Detect. Received from the UPS.
  • RNG - Ring indicate. Received from the UPS.
  • DTR - Data Terminal Ready. Sent by the PC.
  • ST - Send a BREAK on the transmit data line

A "-" in front of a signal name (like -RNG) means that the indicated condition is signaled with an active low signal. For example, [LB=-RNG] means the battery is low when the ring indicate line goes low, and that the battery is OK when that line is held high.

 

Installation

  • apt-get install nut

  • lsusb

    • 0463:ffff MGE UPS Systems UPS

  • vi /etc/default/nut

    • START_UPSD=yes
      UPSD_OPTIONS=""
      START_UPSMON=yes
      UPSMON_OPTIONS=""
  • vi /etc/nut/ups.conf
    • [eaton3s]
              driver=usbhid-ups
              port=auto
              desc="EATON UPS"
              #offdelay=60         
              #ondelay=70
      
      # !!! Comment out, invalid for Ubuntu 18.04:
      #maxretry = 3
  • vi /etc/nut/upsmon.conf
    • MONITOR eaton3s@localhost 1 monuser pass master
      SHUTDOWNCMD "/etc/nut/shutdown"
      
  • vi /etc/nut/nut.conf
    • MODE=standalone
  • vi /etc/nut/upsd.users
    • [monuser]
      password=pass
      upsmon master
  • vi /etc/nut/shutdown
    • #!/bin/bash
      
      # UPS didn't shutdown, so we wrote this script
      
      upsdrvctl stop
      upsdrvctl shutdown
      
      halt
  • chmod 750 /etc/nut/shutdown
  • chown root:nut /etc/nut/shutdown

Reboot and test

  • Ubuntu 16.04 and older
    • service upsd status
    • service upsmon status
  • The commands above do not exist in Ubuntu 18.04. Instead?
    • service nut-server status
    • service nut-monitor status
    • service nut-driver status
  • upsc eaton3s
  • upsmon -c fsd
    • upsmon shuts down computer, simulates power loss

Problem: Nut Driver does not start up correctly on reboot

  • vi /etc/rc.local
    • #!/bin/sh -e
      #
      # rc.local
      #
      # This script is executed at the end of each multiuser runlevel.
      # Make sure that the script will "exit 0" on success or any other
      # value on error.
      
      # Sometime UPS driver does not start up correctly
      sleep 300
      service nut-driver restart
      
      exit 0