Question regarding UPS devices being integrated with Linux systems

Priest_Apostate

Active Member
Joined
Nov 7, 2023
Messages
121
Reaction score
29
Credits
1,406
Is there any way to have Linux systems perform a graceful shutdown whenever the UPS to which they switch to battery power due to a brown/blackout?

I'm currently looking for something to allow for that functionality for Windows servers - and naturally thought about Linux counterparts.
 
Last edited:


apcupsd is the way it is done. I have a program I wrote that makes the configuration easy. but install apcupsd and it will allow you to do what you seek.
 
apcupsd is the way it is done. I have a program I wrote that makes the configuration easy. but install apcupsd and it will allow you to do what you seek.
Thanks! Looking that up now - but will this work for other (non-APC) UPS devices?
 
Looking that up now - but will this work for other (non-APC) UPS devices?
It may, I know cyberpower has its own thing. You can try the others and see, worst case is it does not work. it is fairly generic tho so give it a try. what brand are you going to use?
 
It may, I know cyberpower has its own thing. You can try the others and see, worst case is it does not work. it is fairly generic tho so give it a try. what brand are you going to use?
I'm currently using APC - so your recommendation will work for now. Thanks for the recommendation!
 
You will need a USB connector from your UPC to a port on the PC.

dnf or apt-get install apcupsd

edit your /etc/apcupsd/apcupsd.conf file.

  • UPSNAME: Name of your UPS.
  • UPSCABLE: Specify the cable type (e.g., usb, smart, or simple).
  • UPSTYPE: Set to usb if using USB, or serial if using a serial connection.
  • DEVICE: Specify the device path (e.g., /dev/ttyUSB0 for USB or /dev/ttyS0 for serial).
  • Other settings like BATTERYLEVEL, MINUTES, etc., can be adjusted as needed.

systemctl enable apcupsd

systemctl start apcupsd

You can configure the actions in /etc/apcupsd/apccontrol

You can turn off the UPC like this.

/etc/apcupsd/apccontrol -killpower

Usually the logs are in /var/log/apcupsd.log
 
Now if I could only tell the UPS to stay connected so I don't get the notifications and emails about Connection to UPS restored.

Signed,

Matthew Campbell
 

Members online


Top