UPS APC to shutdown VMs?

AlexLup

Member
Mar 19, 2018
215
12
23
40
I got this running with apcd in a docker container checking the UPS via the network, with a crontab script looking for the apcd created file. Simple setup.
 

sebcbien

Member
Jun 7, 2020
43
7
8
51
Thanks, but my ups is usb only ...
So, no solution for usb UPS rather than installing on host ?
thanks !
 

Q-wulf

Well-Known Member
Mar 3, 2013
612
37
48
my test location
Thanks, but my ups is usb only ...
So, no solution for usb UPS rather than installing on host ?
thanks !

You could use a USB to network device, then pipe that into a KVM of your choice.
www.seh-technology.com myUTN comes to mind (we use that to provide Datev-USB-Dongles to Windows 2019 Servers) and Standalone Datev-Remote Desktops (for Home Office during Covid19)
 

Q-wulf

Well-Known Member
Mar 3, 2013
612
37
48
my test location
Seh is stable. It works. it does not have hick-ups and it plays nice within a hot environment.
I have Seh USB to network hubs in my environments that have been running for 8+ years without needing ANY manual input post setting up.

I am willing to pay the 150€/piece. You might not be. There sure are alternatives out there.
 
Oct 7, 2018
40
6
13
According to the APC manual, apcupsd is looking for nodes in /dev/usb/hiddev*. So, you may want to try passing that through instead of /dev/bus/usb/xxx/yyy. I finally got this working for my APC Back-UPS XS 1500G after doing the following:

On the host:
Code:
chown root:100000 /dev/usb/hiddev0
chmod 660 /dev/usb/hiddev0

And in my LXC .conf:
Code:
lxc.cgroup.devices.allow: c 180:* rwm
lxc.mount.entry: /dev/usb/hiddev0 dev/usb/hiddev0 none bind,optional,create=file

Et voila (in LXC):
Code:
root@ups1:~# apcaccess
APC      : 001,036,0860
DATE     : 2021-04-09 19:30:44 +0000
HOSTNAME : ups1
VERSION  : 3.14.14 (31 May 2016) debian
UPSNAME  : ups1
CABLE    : USB Cable
DRIVER   : USB UPS Driver
UPSMODE  : Stand Alone
STARTTIME: 2021-04-09 19:30:43 +0000
MODEL    : Back-UPS XS 1500G
STATUS   : ONLINE
LINEV    : 121.0 Volts
LOADPCT  : 21.0 Percent
BCHARGE  : 100.0 Percent
TIMELEFT : 31.1 Minutes
MBATTCHG : 5 Percent
MINTIMEL : 3 Minutes
MAXTIME  : 0 Seconds
SENSE    : Medium
LOTRANS  : 88.0 Volts
HITRANS  : 139.0 Volts
ALARMDEL : 30 Seconds
BATTV    : 27.3 Volts
LASTXFER : No transfers since turnon
NUMXFERS : 0
TONBATT  : 0 Seconds
CUMONBATT: 0 Seconds
XOFFBATT : N/A
SELFTEST : NO
STATFLAG : 0x05000008
SERIALNO : 4B1504P15630
BATTDATE : 2015-01-21
NOMINV   : 120 Volts
NOMBATTV : 24.0 Volts
NOMPOWER : 865 Watts
FIRMWARE : 866.L8 .D USB FW:L8
END APC  : 2021-04-09 19:31:39 +0000
 

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 your own in 60 seconds.

Buy now!