Config for Network UPS Tool (NUT) for Prolink

sleeper52

New Member
Mar 24, 2023
27
8
3
I recently bought a Prolink PRO1501SFCU UPS for my Proxmox server.
I watched Techno Tim's YouTube video on how to setup NUT but it doesn't seem to work for me.

What I've done:
1. created a Proxmox debian turnkey core Linux container (unprivileged container = no; nesting = 1)

2. Installed nut, nut-server, nut-client (2.7.4-13)

3. ran lsusb
Code:
Bus 006 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 005 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 003: ID 1d6b:0104 Linux Foundation Multifunction Composite Gadget
Bus 003 Device 002: ID 0b05:18f3 ASUSTek Computer, Inc. AURA LED Controller
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 05e3:0608 Genesys Logic, Inc. Hub
Bus 001 Device 002: ID 0665:5161 Cypress Semiconductor USB to Serial
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

4. if I run nut-scanner -U I get an error
Code:
Neon library not found. XML search disabled.
Scanning USB bus.

5. If I run lsusb -D /dev/bus/usb/001/002
Code:
Device: ID 0665:5161 Cypress Semiconductor USB to Serial
Couldn't open device, some information will be missing
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x0665 Cypress Semiconductor
  idProduct          0x5161 USB to Serial
  bcdDevice            0.02
  iManufacturer           1 INNO TECH
  iProduct                2 USB to Serial
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0022
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          3
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              4
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.00
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      27
         Report Descriptors:
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               1

6. This is what I've placed on the /etc/nut/ups.conf file
Code:
pollinterval = 1
maxretry = 3

[prolink]
    driver = blazer_usb
    subdriver = cypress
    protocol = mustek
    port = auto
    desc = "Prolink PRO1501SFCU"
    vendorid = 0665
    productid = 5161

7. this is what I've placed on the /etc/nut/upsmon.conf file
Code:
RUN_AS_USER root

MONITOR prolink@localhost 1 admin secret master

8. this is what I've placed in the /etc/nut/upsd.conf file
Code:
LISTEN 0.0.0.0 3493

9. this is what I've placed in the /etc/nut/nut.conf file
Code:
MODE=netserver

10. this is what I've placed in the /etc/nut/upsd.users file
Code:
[monuser]
    password = secret
    admin master

11. if I run upsc prolink@localhost I get this error message
Code:
Init SSL without certificate database
Error: Driver not connected

I'm not sure what to do next.
 
UPDATE: so i partially managed to get NUT working directly on the Proxmox OS (not on a container or VM). Seems the new NUT version 2.8.0-7 solved a lof of issues. By following Techno Tim's guide I managed to get it all the way to query UPS with NUT server and produced this result:
Code:
root@pve:/etc/nut# upsc prolink@localhost
Init SSL without certificate database
battery.charge: 100
battery.voltage: 26.80
battery.voltage.high: 26.00
battery.voltage.low: 20.80
battery.voltage.nominal: 24.0
device.type: ups
driver.name: nutdrv_qx
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 1
driver.parameter.port: auto
driver.parameter.productid: 5161
driver.parameter.synchronous: auto
driver.parameter.vendorid: 0665
driver.version: 2.8.0
driver.version.data: Voltronic-QS 0.07
driver.version.internal: 0.32
driver.version.usb: libusb-1.0.26 (API: 0x1000109)
input.voltage: 241.4
input.voltage.fault: 241.4
output.current.nominal: 6.0
output.frequency: 60.2
output.frequency.nominal: 60
output.voltage: 241.4
output.voltage.nominal: 230
ups.beeper.status: enabled
ups.delay.shutdown: 30
ups.delay.start: 180
ups.firmware.aux: PM-V
ups.load: 11
ups.productid: 5161
ups.status: OL
ups.type: offline / line interactive
ups.vendorid: 0665

Now, I'm unable to launch the webGUI after installing apache2 and nut-cgi
Code:
root@pve:/etc/nut# apt install apache2 nut-cgi
Selecting previously unselected package libavif15:amd64.
Preparing to unpack .../11-libavif15_0.11.1-1_amd64.deb ...
Unpacking libavif15:amd64 (0.11.1-1) ...
Selecting previously unselected package libde265-0:amd64.
Preparing to unpack .../12-libde265-0_1.0.11-1_amd64.deb ...
Unpacking libde265-0:amd64 (1.0.11-1) ...
Selecting previously unselected package libheif1:amd64.
Preparing to unpack .../13-libheif1_1.15.1-1_amd64.deb ...
Unpacking libheif1:amd64 (1.15.1-1) ...
Selecting previously unselected package libxpm4:amd64.
Preparing to unpack .../14-libxpm4_1%3a3.5.12-1.1_amd64.deb ...
Unpacking libxpm4:amd64 (1:3.5.12-1.1) ...
Selecting previously unselected package libgd3:amd64.
Preparing to unpack .../15-libgd3_2.3.3-9_amd64.deb ...
Unpacking libgd3:amd64 (2.3.3-9) ...
Selecting previously unselected package nut-cgi.
Preparing to unpack .../16-nut-cgi_2.8.0-7_amd64.deb ...
Unpacking nut-cgi (2.8.0-7) ...
Setting up libabsl20220623:amd64 (20220623.1-1) ...
Setting up libxpm4:amd64 (1:3.5.12-1.1) ...
Setting up libapr1:amd64 (1.7.2-3) ...
Setting up libgav1-1:amd64 (0.18.0-1+b1) ...
Setting up apache2-data (2.4.57-2) ...
Setting up libde265-0:amd64 (1.0.11-1) ...
Setting up libyuv0:amd64 (0.0~git20230123.b2528b0-1) ...
Setting up libaprutil1:amd64 (1.6.3-1) ...
Setting up libavif15:amd64 (0.11.1-1) ...
Setting up libheif1:amd64 (1.15.1-1) ...
Setting up libaprutil1-ldap:amd64 (1.6.3-1) ...
Setting up libaprutil1-dbd-sqlite3:amd64 (1.6.3-1) ...
Setting up libgd3:amd64 (2.3.3-9) ...
Setting up apache2-utils (2.4.57-2) ...
Setting up nut-cgi (2.8.0-7) ...
Setting up apache2-bin (2.4.57-2) ...
Setting up apache2 (2.4.57-2) ...
apache-htcacheclean.service is a disabled or a static unit not running, not starting it.
Processing triggers for man-db (2.11.2-2) ...
Processing triggers for libc-bin (2.36-9+deb12u1) ...
root@pve:/etc/nut# sudo a2enmod cgi
Your MPM seems to be threaded. Selecting cgid instead of cgi.
Module cgid already enabled
root@pve:/etc/nut# sudo systemctl restart apache2
root@pve:/etc/nut# find / -type d -iname "apache*"
/etc/apache2
/usr/share/doc/apache2-bin
/usr/share/doc/apache2-utils
/usr/share/doc/apache2
/usr/share/doc/apache2-data
/usr/share/bug/apache2-bin
/usr/share/bug/apache2
/usr/share/apache2
/usr/lib/apache2
/run/apache2
/run/systemd/propagate/apache2.service
/run/lock/apache2
/sys/fs/cgroup/system.slice/apache2.service
/var/lib/apache2
/var/cache/apache2
/var/log/apache2

1690344593852.png
 
Last edited:
Update: I have finally successfully got the Prolink PRO1501SFCU running with NUT.
The process and configuration is as below.

1. Ensure the USB cable from the UPS is connected to the Proxmox server

2. SSH into the Proxmox server or open it's shell terminal; we will be configuring this as the NUT server.

3. Update the repositories and packages
apt update && apt dist-upgrade -y

4. Install the NUT package
Code:
apt install NUT
NOTE: As of using Proxmox 8, I could only get NUT 2.8.x-x to work as the prior versions (ie. 2.7.x-x) had a lot of errors
Code:
root@pve:~# apt-cache policy nut nut-server nut-client
nut:
  Installed: 2.8.0-7
  Candidate: 2.8.0-7
  Version table:
 *** 2.8.0-7 500
        500 http://deb.debian.org/debian bookworm/main amd64 Packages
        100 /var/lib/dpkg/status
nut-server:
  Installed: 2.8.0-7
  Candidate: 2.8.0-7
  Version table:
 *** 2.8.0-7 500
        500 http://deb.debian.org/debian bookworm/main amd64 Packages
        100 /var/lib/dpkg/status
nut-client:
  Installed: 2.8.0-7
  Candidate: 2.8.0-7
  Version table:
 *** 2.8.0-7 500
        500 http://deb.debian.org/debian bookworm/main amd64 Packages
        100 /var/lib/dpkg/status
NOTE: If you had a prior version of NUT installed, ensure you use the command
apt purge nut or do apt autoremove
to ensure that it's dependencies (ie. nut-server, nut-client, etc.) and config files are also removed. I had some trouble after installing the new NUT version as the prior configs (ie. /etc/nut, /run/nut, and some services) were interfering.

5. Check if the UPS usb cable is detected by the Proxmox server.
Code:
root@pve:~# lsusb
...
Bus 001 Device 002: ID 0665:5161 Cypress Semiconductor USB to Serial
...
root@pve:~# lsusb -v -s 001:002

Bus 001 Device 002: ID 0665:5161 Cypress Semiconductor USB to Serial
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0
  bDeviceSubClass         0
  bDeviceProtocol         0
  bMaxPacketSize0         8
  idVendor           0x0665 Cypress Semiconductor
  idProduct          0x5161 USB to Serial
  bcdDevice            0.02
  iManufacturer           1 INNO TECH
  iProduct                2 USB to Serial
  iSerial                 0
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0022
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          3 20100813
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0
      bInterfaceProtocol      0
      iInterface              4 Sample HID
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.00
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      27
         Report Descriptors:
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               1
Device Status:     0x0000
  (Bus Powered)

6. After installing NUT, perform a scan using the nut-scanner tool and copy it's values
Code:
root@pve:~# nut-scanner -U
Scanning USB bus.
[nutdev1]
        driver = "nutdrv_qx"
        port = "auto"
        vendorid = "0665"
        productid = "5161"
        product = "USB to Serial"
        vendor = "INNO TECH"
        bus = "001"

7. Navigate to the /etc/nut directory and backup all the default/sample config files
Code:
root@pve:~# cd /etc/nut
root@pve:/etc/nut# ls
nut.conf  ups.conf  upsd.conf  upsd.users  upsmon.conf  upssched-cmd  upssched.conf
root@pve:/etc/nut# mv nut.conf nut.example.conf
root@pve:/etc/nut# mv upsd.conf upsd.example.conf
root@pve:/etc/nut# mv upsd.users upsd.example.users
root@pve:/etc/nut# mv ups.conf ups.example.conf
root@pve:/etc/nut# mv upsmon.conf upsmon.example.conf
root@pve:/etc/nut# mv upssched.conf upssched.example.conf
root@pve:/etc/nut# ls
nut.conf  ups.conf  upsd.conf  upsd.users  upsmon.conf  upssched-cmd  upssched.conf
nut.example.conf  upsd.example.conf  upsd.example.users  ups.example.conf  upsmon.example.conf  upssched.example.conf

8. Create a new nut.conf file nano /etc/nut/nut.conf and enter the following
Code:
MODE=netserver

9. Create a new ups.conf file nano /etc/nut/ups.conf and enter the following
Code:
pollinterval = 15
maxretry = 3

offdelay = 180
ondelay = 300

#Enter the nut-scanner -U values here
[prolink]
        driver = nutdrv_qx
        port = auto
        desc = "Prolink PRO1501SFCU UPS"
        vendorid = 0665
        productid = 5161
NOTE: Enter the details of the UPS values as according to the values provided in the nut-scanner -U command.
NOTE: You can name the UPS whatever you like inside the brackets; the name will be used in calling the UPS (ie. upsc prolink@localhost)

10. Once both config files are saved, you can run it by typing upsdrvctl start and you should get a result similar to
Code:
Network UPS Tools - UPS driver controller 2.8.0
Network UPS Tools - Generic Q* USB/Serial driver 0.32 (2.8.0)
USB communication driver (libusb 1.0) 0.43
Using protocol: Voltronic-QS 0.07
No values for battery high/low voltages
Using 'guesstimation' (low: 20.800000, high: 26.000000)!
Battery runtime will not be calculated (runtimecal not set)

Broadcast message from root@pve (somewhere) (Wed Aug  2 11:46:33 2023):

Communications with UPS prolink@localhost established

11. Create a new upsd.conf file nano /etc/nut/upsd.conf and enter the following
Code:
LISTEN 0.0.0.0 3493
LISTEN :: 3493

12. Create a new upsd.users file nano /etc/nut/upsd.users and enter the following
Code:
[upsadmin]
# Administrative user
password = ********
# Allow changing values of certain variables in the UPS.
actions = SET
# Allow setting the "Forced Shutdown" flag in the UPS.
actions = FSD
# Allow all instant commands
instcmds = ALL
upsmon master

[upsuser]
# Normal user
password = ********
upsmon slave
NOTE: you can name the user accounts whatever you like by changing the values inside the brackets; in our case the account names are upsadmin for the master and upsuser for the slave/client
NOTE: Enter the your own password value in place of ********

13. Create a new upsmon.conf file nano /etc/nut/upsmon.conf and enter the following
Code:
RUN_AS_USER root
MONITOR prolink@localhost 1 upsadmin ******* master

MINSUPPLIES 1
SHUTDOWNCMD "/sbin/shutdown -h"
NOTIFYCMD /usr/sbin/upssched
POLLFREQ 2
POLLFREQALERT 1
HOSTSYNC 15
DEADTIME 15
MAXAGE 24
POWERDOWNFLAG /etc/killpower

NOTIFYMSG ONLINE "UPS %s on line power"
NOTIFYMSG ONBATT "UPS %s on battery"
NOTIFYMSG LOWBATT "UPS %s battary is low"
NOTIFYMSG FSD "UPS %s: forced shutdown in progress"
NOTIFYMSG COMMOK "Communications with UPS %s established"
NOTIFYMSG COMMBAD "Communications with UPS %s lost"
NOTIFYMSG SHUTDOWN "Auto logout and shutdown proceeding"
NOTIFYMSG REPLBATT "UPS %s battery needs to be replaced"
NOTIFYMSG NOCOMM "UPS %s is unavailable"
NOTIFYMSG NOPARENT "upsmon parent process died - shutdown impossible"

NOTIFYFLAG ONLINE   SYSLOG+WALL+EXEC
NOTIFYFLAG ONBATT   SYSLOG+WALL+EXEC
NOTIFYFLAG LOWBATT  SYSLOG+WALL+EXEC
NOTIFYFLAG FSD      SYSLOG+WALL+EXEC
NOTIFYFLAG COMMOK   SYSLOG+WALL+EXEC
NOTIFYFLAG COMMBAD  SYSLOG+WALL+EXEC
NOTIFYFLAG SHUTDOWN SYSLOG+WALL+EXEC
NOTIFYFLAG REPLBATT SYSLOG+WALL
NOTIFYFLAG NOCOMM   SYSLOG+WALL+EXEC
NOTIFYFLAG NOPARENT SYSLOG+WALL

RBWARNTIME 43200
NOCOMMWARNTIME 600

FINALDELAY 5
NOTE: replace ******* with the master password

14. Create a new upssched.conf file nano /etc/nut/upssched.conf and enter the following
Code:
CMDSCRIPT /etc/nut/upssched-cmd
PIPEFN /etc/nut/upssched.pipe
LOCKFN /etc/nut/upssched.lock

AT ONBATT * START-TIMER onbatt 30
AT ONLINE * CANCEL-TIMER onbatt online
AT ONBATT * START-TIMER earlyshutdown 30
AT LOWBATT * EXECUTE onbatt
AT COMMBAD * START-TIMER commbad 30
AT COMMOK * CANCEL-TIMER commbad commok
AT NOCOMM * EXECUTE commbad
AT SHUTDOWN * EXECUTE powerdown
AT SHUTDOWN * EXECUTE powerdown

15. Create a new upssched-cmd file nano /etc/nut/upssched-cmd and enter the following
Code:
#!/bin/sh
 case $1 in
       onbatt)
          logger -t upssched-cmd "UPS running on battery"
          ;;
       earlyshutdown)
          logger -t upssched-cmd "UPS on battery too long, early shutdown"
          /usr/sbin/upsmon -c fsd
          ;;
       shutdowncritical)
          logger -t upssched-cmd "UPS on battery critical, forced shutdown"
          /usr/sbin/upsmon -c fsd
          ;;
       upsgone)
          logger -t upssched-cmd "UPS has been gone too long, can't reach"
          ;;
       *)
          logger -t upssched-cmd "Unrecognized command: $1"
          ;;
 esac

16. Ensure that the upssched-cmd file is executable
Code:
chmod +x /etc/nut/upssched-cmd

17. Restart the Proxmox server (which is now the nut-server) or run the following commands
Code:
service nut-server restart
service nut-client restart
systemctl restart nut-monitor
upsdrvctl stop
upsdrvctl start

18. Test the NUT server using the command upsc prolink@localhost
Code:
root@pve:/etc/nut# upsc prolink@localhost
Init SSL without certificate database
battery.charge: 100
battery.voltage: 26.80
battery.voltage.high: 26.00
battery.voltage.low: 20.80
battery.voltage.nominal: 24.0
device.type: ups
driver.name: nutdrv_qx
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 15
driver.parameter.port: auto
driver.parameter.productid: 5161
driver.parameter.synchronous: auto
driver.parameter.vendorid: 0665
driver.version: 2.8.0
driver.version.data: Voltronic-QS 0.07
driver.version.internal: 0.32
driver.version.usb: libusb-1.0.26 (API: 0x1000109)
input.voltage: 245.6
input.voltage.fault: 245.6
output.current.nominal: 6.0
output.frequency: 60.2
output.frequency.nominal: 60
output.voltage: 245.6
output.voltage.nominal: 230
ups.beeper.status: enabled
ups.delay.shutdown: 30
ups.delay.start: 180
ups.firmware.aux: PM-V
ups.load: 13
ups.productid: 5161
ups.status: OL
ups.type: offline / line interactive
ups.vendorid: 0665

19. You can display the list of commands with parameters that can be changed by typing upsrw prolink@loclhost
Code:
root@pve:/etc/nut# upsrw prolink@localhost
[ups.delay.shutdown]
Interval to wait after shutdown with delay command (seconds)
Type: RANGE NUMBER
Option: "12-540" SELECTED

[ups.delay.start]
Interval to wait before (re)starting the load (seconds)
Type: RANGE NUMBER
Option: "60-599940" SELECTED

You can change the said parameters by typing upsrw -s ups.delay.shutdown=180 prolink@localhost
NOTE: in this example, I used 180 which is in seconds
NOTE: you will be asked to enter the username we've entered in the /etc/nut/upsd.users file (in this case upsadmin) and it's corresponding password
NOTE: the changes in the parameters will be reflected when typing upsc prolink@localhost
Code:
root@pve:/etc/nut# upsrw -s ups.delay.shutdown=180 prolink@localhost
Username (root): upsadmin
Password:
OK
root@pve:/etc/nut# upsc prolink@localhost
Init SSL without certificate database
battery.charge: 100
battery.voltage: 26.80
battery.voltage.high: 26.00
battery.voltage.low: 20.80
battery.voltage.nominal: 24.0
device.type: ups
driver.name: nutdrv_qx
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 15
driver.parameter.port: auto
driver.parameter.productid: 5161
driver.parameter.synchronous: auto
driver.parameter.vendorid: 0665
driver.version: 2.8.0
driver.version.data: Voltronic-QS 0.07
driver.version.internal: 0.32
driver.version.usb: libusb-1.0.26 (API: 0x1000109)
input.voltage: 239.2
input.voltage.fault: 239.2
output.current.nominal: 6.0
output.frequency: 59.9
output.frequency.nominal: 60
output.voltage: 239.2
output.voltage.nominal: 230
ups.beeper.status: enabled
ups.delay.shutdown: 180
ups.delay.start: 180
ups.firmware.aux: PM-V
ups.load: 12
ups.productid: 5161
ups.status: OL
ups.type: offline / line interactive
ups.vendorid: 0665

20. Create a Proxmox LXC container setup as a NUT-client to host the UPS status on your local browser by typing it's URL
NOTE: any container will do; I created a Debian Turnkey core Linux container with 1 core, 512MB or RAM, and 2GB of storage, and a static IP
NOTE: ensure "start at boot" is enabled for this container

21. SSH on to the LXC container or open it's shell terminal

22. On the LXC container terminal, update repositories and it's packages
Code:
apt update && apt dist-upgrade -y

23. On the LXC container terminal, install apache2, nut-cgi, and nut-client pacakge
NOTE: you can also choose to install the entire NUT package which includes both nut-server, and nut-client but we will only configure the nut-client portion of this container as it will be used as such
Code:
apt install apache2 nut-cgi nut-client -y

24. On the LXC container, navigate to the /etc/nut directory and backup the default/sample configs similar to what we did in the NUT server
Code:
root@prolink /etc/nut# mv /etc/nut/hosts.conf /etc/nut/hosts.example.conf
root@prolink /etc/nut# mv /etc/nut/nut.conf /etc/nut/nut.example.conf
root@prolink /etc/nut# mv /etc/nut/upsmon.conf /etc/nut/upsmon.example.conf
root@prolink /etc/nut# mv /etc/nut/upsset.conf /etc/nut/upsset.example.conf

25. On the LXC container /etc/nut directory, create a new nut.conf file nano /etc/nut/nut.conf and enter the following
Code:
MODE=netclient

26. On the LXC container /etc/nut directory, create a new hosts.conf file nano /etc/nut/hosts.conf and enter the following
Code:
MONITOR prolink@xxx.xxx.xxx.xxx "Prolink PRO1501SFCU UPS"
NOTE: replace xxx.xxx.xxx.xxx with the IP of the NUT server

27. On the LXC container /etc/nut directory, create a new upsset.conf file nano /etc/nut/upsset.conf and enter the following
Code:
I_HAVE_SECURED_MY_CGI_DIRECTORY

28. On the LXC container /etc/nut directory, create a new upsmon.conf file nano /etc/nut/upssmon.conf and enter the following
Code:
RUN_AS_USER root
MONITOR prolink@xxx.xxx.xxx 1 upsuser ******* slave
NOTE: replace xxx.xxx.xxx.xxx with the IP of the NUT server; replace ******* with the client/slave password you've entered in the NUT server upsd.users file

29. On the LXC container, enter the command
Code:
a2enmod cgi

30. On the LXC container, restart apache
Code:
systemctl restart apache2

31. You can now see the UPS status by typing http://xxx.xxx.xxx.xxx/cgi-bin/nut/upsstats.cgi on the browser from any device in your local network.
NOTE: replace xxx.xxx.xxx.xxx with the IP address of the LXC container configured as the NUT client
 
Last edited:
I want to mark this thread as SOLVED but I don't see an option to edit my original post for some reason.
 
Hello,
I have NUT running on a Proxmox VM but have been unable to get it running in a container. Having issues with getting the driver to connect even though it shows the USB device (lsblk) as available. How did you setup the pass through for USB?

I tired and with no luck this: added to the primary node config file (/etc/pve/lxc/307.conf): lxc.cgroup2.devices.allow: c 189:* rwm lxc.mount.entry: /dev/bus/usb/001/002 dev/bus/usb/001/002 none bind,optional,create=file

Thanks for any help!
al
 
Hello,
I have NUT running on a Proxmox VM but have been unable to get it running in a container. Having issues with getting the driver to connect even though it shows the USB device (lsblk) as available. How did you setup the pass through for USB?

I tired and with no luck this: added to the primary node config file (/etc/pve/lxc/307.conf): lxc.cgroup2.devices.allow: c 189:* rwm lxc.mount.entry: /dev/bus/usb/001/002 dev/bus/usb/001/002 none bind,optional,create=file

Thanks for any help!
al
Hi al. I also had problems passing through the USB when I initially had the container as the NUT server. In the end, I installed the NUT server directly onto the Proxmox OS and used the container as the NUT client whose only purpose is to display the UPS status on the browser.
 
Thanks for the quick response! I am tryiing to avoid installing anything on the PVE primary node. So I guess for now I will leave it running as a VM. Was hoping to use a container due to less overhead etc.

In any case it runs fine on the VM.

Thanks again,
al...
 
  • Like
Reactions: sleeper52
Thanks for the quick response! I am tryiing to avoid installing anything on the PVE primary node. So I guess for now I will leave it running as a VM. Was hoping to use a container due to less overhead etc.

In any case it runs fine on the VM.

Thanks again,
al...
out of curiosity, have you tried setting your container to 'unprivileged container=no'? It's located on the container's options menu in the Proxmox GUI.
 
Thank you for this thread. I need to get a UPS attached to my proxmox host.

I'm not sure it would be a good idea having the nut server in a container. You'd want nut to be able to shut down the proxmox server, and a container couldn't do that.

You might say: well, then I can put nut-client on the proxmox server. You can, but then the client (proxmox server) would have to shut down _before_ the container that as the server... which can't happen. The containers must shut down first. That gets into a chicken and egg situation.
 
I did not want to install anything on the Proxmox VE server so I created a small VM to run NUT. In the event the UPS battery is running low NUT needs to shut down the PM VE server (which in turn would shutdown all the containers and other VM's). So, I have created a script (which basically ssh's into the PM VE) then issues a shutdown command to the PM VE server. I tested it once and it seemed to work ok but, need to make some adjustments to the process.
 
@sleeper52 thank you so much, your guide was a huge help, I have it working thanks to you.

One silly thing, but worth mentioning, step 11, it is necessary to put the IP of the server too, for later on when you access it from the client:

LISTEN 0.0.0.0 3493
LISTEN :: 3493
LISTEN xxx.xxx.xxx.xxx 3493

Otherwise you get access denied.

Next is finding a way to notify when switching to battery!
 
1-31 worked perfectly for my APC Back-UPS NS 1500M2. Just had to change all the "prolink" references to "APC"
Thanks for all the time you spent on this amazing doc. Attached are my edits for APC
 

Attachments

  • nut dev1redact.txt
    2.2 KB · Views: 4
  • Like
Reactions: sleeper52
@sleeper52 thank you so much, your guide was a huge help, I have it working thanks to you.

One silly thing, but worth mentioning, step 11, it is necessary to put the IP of the server too, for later on when you access it from the client:

LISTEN 0.0.0.0 3493
LISTEN :: 3493
LISTEN xxx.xxx.xxx.xxx 3493

Otherwise you get access denied.

Next is finding a way to notify when switching to battery!
When I added that line It broke my connection. Took it out and system is working fine. I am using an APC UPS.
 
Also here from Techno Tim's video.
Going through your very detailed notes and will give this a try.

Where did you get the information for:
vendorid = "051D"
productid = "0002"

Did I miss that referenced somewhere?
 
Also here from Techno Tim's video.
Going through your very detailed notes and will give this a try.

Where did you get the information for:
vendorid = "051D"
productid = "0002"

Did I miss that referenced somewhere?
after installing NUT, you need to run nut-scanner -U which will provide you the info. This is what I get from running that command:

Bash:
root@pve:~# nut-scanner -U
Scanning USB bus.
[nutdev1]
        driver = "nutdrv_qx"
        port = "auto"
        vendorid = "0665"
        productid = "5161"
        product = "USB to Serial"
        vendor = "INNO TECH"
        bus = "001"
 
  • Like
Reactions: SilicaStorm
@sleeper52 thank you so much, your guide was a huge help, I have it working thanks to you.

One silly thing, but worth mentioning, step 11, it is necessary to put the IP of the server too, for later on when you access it from the client:

LISTEN 0.0.0.0 3493
LISTEN :: 3493
LISTEN xxx.xxx.xxx.xxx 3493

Otherwise you get access denied.

Next is finding a way to notify when switching to battery!
Question in Item #11
LISTEN xxx.xxx.xxx.xxx 3493
Should this IP address be the Client in the Container or the IP address of the Server as the Proxmox host?
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!