UPS for two lightweight Linux boxes - looking for advise

I’m looking for a budget friendly UPS. Earlier this week, I hijacked another discussion, but that wasn’t proper communitying… (Thanks for answering anyway, @PrzemoF.)

This is my setup/wish list:

  1. I’ve got two lightweight Linux boxes running (one for openHAB and a few other services, the other one running my NAS): https://www.itgigant.nl/herfstactie-2023/hp-260g2-128gb-ssd-2/ & https://www.itgigant.nl/hp-refurbished/hp-elitedesk-800-g2-mini-pc-i3-8gb-240ssd/. I want to be able to shut them both down gracefully when there’s a power outage. (It’s not necessary to have them running any longer than that.)
  2. The router won’t be connected to the UPS, so network traffic won’t be possible when the power is out. (I see that in the “Advanced” configuration, there is still network communication possible…?)
  3. Both Linux boxes have BIOS which allows them to startup when power is restored.
  4. Since I’m a paranoid person, I wonder whether there’s a failsafe against the UPS having such a low voltage that the Linuxes are cut off anyway while powering up? In other words, is it possible to have a battery level threshold under which the UPS doesn’t provide power?

I know of the list of NUT compatible UPS’s, but I can’t see the wood from the trees there… Could someone recommend me one? Ideally, the price would be € 100 - € 150 (or less, of course :p).

Thanks in advance for anyone’s help!

I’m not sure you can get an UPS to work with two devices with NUT and graceful shutdown it there is no network. Only one device can actually plug into the UPS’s USB port at a time so the second computer won’t know when power is lost and to shutdown from the UPS itself. In a NUT configuration, there is a client/server configuration where the device plugged into the UPS’s USB port is the server and the other machines connect to the server over the network.

In the page you linked to there is a promament warning:

Be sure to plug your network’s physical hardware (switches, hubs, routers, bridges, …) into the UPS!

If you lose network, the only machine that will shutdown nicely will be the one plugged into the UPS’s USB port. The rest will remain blisfully unaware that power was lost until the battery runs out.

So no, if the router is not connected to some sort of UPS, there’s no point in setting up NUT. You either need a separate UPS per box or you need to let one of the machines just lose power without graceful shutdown.

This is actually a problem in an UPS scenario because unless the UPS batter completely runs out, the Linux machine will never see that the power was lost so there won’t be anything to trigger it to come back on when power is restored. As far as it’s aware it never lost power and it was just shutdown normally.

Well, yes. If there’s not enough power in the battery and it’s not passing through power from mains power, the battery will eventually get too low to power the devices. But that’s not a scenario that can occur with the scenario you’ve outlined. If there is no mains power the machines will be shutdown. Only when mains power is restored will the machines be started back up (somehow, maybe WoL?). When there is mains power, most UPS act mainly as a surge protector. It doesn’t matter whether the battery is dead or not and there won’t be any chance of a low voltage issue.

If the devices are running on battery alone, then NUT should be configured to shut down the machines before the battery gets so low that this could be a problem. But most UPS also have a bunch of stuff built in to provide “clean” power to the devices and probably have internal circuitry to cut off the power if the voltage gets too low anyway.

I’ve a CyberPower Pro 1500 S that has worked well for me.

But I think you need to rethink your requirements. UPS and NUT doesn’t really work in a way that is going to let you achieve 2 and 3.

2 Likes

Thanks for your elaborate answer - as always :slight_smile:

Okay, so maybe I should connect the router to the UPS then. That’s not impossible, luckily. It would of course require at least 3 outlets.

I’m not sure I understand completely. I assumed this was a feature of a UPS, that it would be able to cut the power going out to the attached devices after n seconds after main power was lost, and start providing power again when the main power was restored (and the battery is loaded sufficiently). Or something like that?

I just shut down both my Linux machines gracefully (sudo shutdown -h now), then pulled the power cords out of the outlets, and put them back in. Both Linuxes started up automatically.

So unless I overestimated the capabilities of a UPS, that would be workable, no?

There is no such feature on any UPS I’ve ever used. I’ve by no means used them all so maybe there’s one that does that but most of your consumer level UPS from CyberPower and APC and the like don’t work that way. They simply provide clean power (stable voltage) and backup power when there’s an outage.

That’s it. They are not smarter nor no more capable than that.

Not workable because you overestimate the capabilities of an UPS. UPS stands for Uninterruptable Power Supply. You can’t have “uninterruptable” if you interupt the power like this when the power returns. The whole purpose of an UPS is to keep your machines running during a brief power outage. That’s pretty much all that the physical UPS device does.

Software can be run on the machines plugged into the UPS (e.g. NUT) that monitors the battery and can take action based on what it finds there. In extreme circumstances (i.e. the power outage is too long) that software can take extreme measures (i.e. shutdown the machines). But there’s nothing really there to do anything once the machines are shut down. NUT isn’t running any more because the machine is shutdown and the UPS device isn’t that smart or configurable (you definitely do not want the UPS to cycle the power on a machine that was never shutdown in the first place).

most APC UPS at least going all the way back to the old Smart_UPS 1400 with the management card offer this
Shutdown Parameters [![UPS Shutdown Parameters Configuration Help]
Define how the UPS behaves on shutdown and restart
Return Battery Capacity: %
Low-Battery Duration: Minutes
Shutdown Delay: Seconds
Return Delay: Seconds
Sleep Time: Hours
as for this

No you could use one outlet on UPS and a power strip to put all the devices you want on the managed outlet
but I 100% agree have your router and switches on UPS if you want to manage multiple devices .
Also, APC at least has an app called power chute that allows even more granular triggering of scripts and is also NUT freindly

The APC SmartUPS line is 3x to 4x the price OP listed. Cheapest one I can find on Amazon is aroung $480 (regualr price $605). Obvisouly you can get a lot more with a lot more cost but for

I know of no UPS with those sorts of settings. But again, I don’t know all UPS devices out there. There may be some.

Isn’t the process described here what I meant? Or are steps 7 and 8 mentioned there not run on the UPS (as I understand the wording), but on some other server, which draws power from an unidentified power source (but that seems unlikely?)?

But of course, maybe that’s impossible with hardware that is in the price range I envisioned…?

Based on this example, you’re thinking that the power will be discontinued after the UPS shuts down the machines. That’s incorrect. Nothing changes with the UPS outlets–your PCs have just been switched off and left plugged in. As Rich said, they never actually lose power unless the UPS’s battery dies.

If your router is also on the UPS, then the battery could actually die. But you can’t really plan around that.

The thing to keep in mind is that an inexpensive UPS doesn’t have much of a brain, and relies on something like NUT to fill in the gap. It has no idea what’s plugged into its outlets–or if those devices were gracefully shut down. So, it can’t toggle the power because that might actually be worse for the electronics plugged into it.

I think you’re misreading this due to the previous misunderstanding.

  1. init then runs your shutdown script. This checks for the POWERDOWNFLAG, finds it, and tells the UPS driver(s) to power off the load by sending commands to the connected UPS device(s) they manage.

“power off the load” doesn’t mean turning off the power at the source. It means sending the shutdown commands via your network. After that, the NUT server would shut itself down.

any of the APC Back-Up ups that has the powerchute software capability will handle what he wants
such as this one for 169 dollars on amazon.

I am quite sure that cyber power has an equivalent and many knock off brands.
Also, all UPS have an ability to turn OFF the managed OUTLET so there are options galore.
If the OP actually has some device he wants to have come back on as soon as power is restored, he could even use a wireless shelly smart switch and a http call to power cycle his servers to see that power removed and restore function.
There are tons of approaches this can be handled by.
Other items to consider are the type of output the UPS provides you most "cheap UPS provide a triangle wave or square wave output power which can be very hard on some devices the higher dollar more expensive UPS will provide a sine wave output that is much easier on power supplies and some other devices that could be run off UPS.
After that you should look at run times as that also weighs into pricing.
The idea that a pc is "lightweight " is actually more after initial start-up and inrush current has to be accounted for during total load calculations. otherwise you could false trip a UPS into overload condition if all those devices power on at same time.

As far as I’m aware, my inexpensive APC and CyberPower UPSes don’t have this ability. I tend to go for the smallest units with USB ports for NUT compatibility.

@ErikDB, my advice is to avoid getting too complicated. Just buy the highest-capacity UPS you can afford with NUT capability, and let it do its job as designed. If an outage is brief, your Linux machines will never turn off and you’ll never notice. If the outage goes for a really long time, the router will drain the battery, which will likely force your restart. And if the Linux machines don’t restart every once in awhile, maybe it’s no big deal.

You could also get a UPS for each machine, so that they each have a dedicated battery. I’d still plug the router into one of them, because that enables openHAB to notify you when there’s a power outage.

if you turn off the UPS does the power go off on the devices you have plugged into the managed “UPS” protected "not surge only outlets?
If so then your UPS has a managed outlet that is switched.
The function of a UPS is to turn off the power if the battery in UPS is almost at depletion or the power inverter in the UPS would self destruct.

Oh, I see what you mean. I interpreted your previous comment as being about controlling individual outlets, as if you had smart plugs in each of them.

My reply regarding smart plug shelly was a way for him to address rich’s statement about power cycling to have the PC bios restart the server.
He should define behaviors for all 3 use cases his power management will need to address.
1.Brownouts
2.Short duration black outs
3. Long duration blackouts.
4. by specifying actions for all 3 conditions you could in fact handle any activity and maybe even use something like a shelly smart switch to kick off some basic script actions as needed on power restore.
5. As I said they are lots of different ways to handle the solution even WOL could be implemented if he wants to go that far.

I have a APC Back-UPS 650. It has a data port, came with a cable and works with NUT
It is about $70 - $80 in the US

Thanks all for your input!

@Andrew_Rowe, is your device fully compatible with NUT? It looks like shutdown.return is the key to avoid a “power race” as it seems to be called, and to ensure “power cycling”.

Or do you solve this in another way?

yes

Great; I read that in your earlier post :slight_smile:

I was wondering more about this… Apparently, not all UPS’s have this command available. Does yours?

I have the same APC UPS, and that’s not in the list of available commands. It does have shutdown.reboot, but I don’t know if that’s useful to you.

openhabian@openhab:~ $ upscmd -l openhabups
Instant commands supported on UPS [openhabups]:

beeper.disable - Disable the UPS beeper
beeper.enable - Enable the UPS beeper
beeper.mute - Temporarily mute the UPS beeper
load.off - Turn off the load immediately
load.off.delay - Turn off the load with a delay (seconds)
shutdown.reboot - Shut down the load briefly while rebooting the UPS
shutdown.stop - Stop a shutdown in progress
test.battery.start.deep - Start a deep battery test
test.battery.start.quick - Start a quick battery test
test.battery.stop - Stop the battery test
test.panel.start - Start testing the UPS panel
test.panel.stop - Stop a UPS panel test

I suppose that does the trick as well? The difference between those two commands seems marginal? (See https://networkupstools.org/docs/developer-guide.chunked/_instant_commands_4.html.)

I think I’ll order a similar unit, and see what it does. To be continued.

From the link you provided, I expect you would want:

shutdown.reboot.graceful - After a delay, shut down the load briefly while rebooting the UPS

Since this “graceful” command exists, I would expect that the other two immediately kill the power as soon as the command is received from the NUT server.