Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
UPS with Gentoo support
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
abduct
Apprentice
Apprentice


Joined: 19 Mar 2015
Posts: 215

PostPosted: Fri Aug 31, 2018 10:17 pm    Post subject: UPS with Gentoo support Reply with quote

Hi, I was planning to purchase a UPS for my new workstation and I was looking at https://www.amazon.com/CyberPower-CP1500AVRLCD-Intelligent-Outlets-Mini-Tower/dp/B000FBK3QK

I found two ways to communicate with the UPS, one via https://forums.gentoo.org/viewtopic-t-1041668-start-0.html using the power control panel software via cyberpower, the other using NUT https://wiki.gentoo.org/wiki/NUT.

The first has all the features built in, UPS monitoring, server shutdown, email notifications, etc. The later doesn't come with that built in that I can see.

So my question is: Is there a way to script NUT to allow for email notifications, shutting down the system cleanly when it detects a power failure after a timeout grace period, etc

If not I will have to play around with the closed source applications cyberpower provides and attempt to install it from the provided ebuild.

Does anyone recommend some decent quality for the price UPS for home workstation use?

Thanks.
Back to top
View user's profile Send private message
russK
l33t
l33t


Joined: 27 Jun 2006
Posts: 665

PostPosted: Fri Aug 31, 2018 10:39 pm    Post subject: Reply with quote

I have an APC very similar to the CyberPower one you link to that I have been quite happy with, but the CyberPower has so many reviews and questions answered on Amazon that it's probably not a bad choice.

https://networkupstools.org/index.html
The features page says it can do SMS and email. I don't use NUT so I don't know. I'm usually sitting right at my computer when the power goes out, I don't need a notification :D your application may be different.

Cheers
Back to top
View user's profile Send private message
John R. Graham
Administrator
Administrator


Joined: 08 Mar 2005
Posts: 10590
Location: Somewhere over Atlanta, Georgia

PostPosted: Fri Aug 31, 2018 10:54 pm    Post subject: Reply with quote

Hi abduct,

NUT can be scripted to do anything. Pretty easily, too. If you're in the US, I would check out http://www.refurbups.com/ and get an APC ups. Have had very good luck with this supplier (and with APC).

- John
_________________
I can confirm that I have received between 0 and 499 National Security Letters.
Back to top
View user's profile Send private message
Fitzcarraldo
Advocate
Advocate


Joined: 30 Aug 2008
Posts: 2038
Location: United Kingdom

PostPosted: Fri Aug 31, 2018 10:59 pm    Post subject: Reply with quote

If you are not particularly wedded to CyberPower, I have found that APC UPSs work with machines running Linux. The open-source APC UPS Daemon apcupsd is available for Gentoo (sys-power/apcupsd) and it can send email notifications, shut down the system cleanly when it detects a power failure after a timeout grace period, and so on.

Are you looking for a'standby/backup' UPS or a 'line-interactive' UPS? The former type will not supply power to the machine if the battery dies (i.e. fails for good) while there is mains supply; the latter will still provide power to the machine if the battery dies while there is mains supply. Anyway, APC sell both types. APC style their standby/backup models as 'Back-UPS' and their line-interactive models as 'Smart-UPS'. As you would expect, the Back-UPS models are cheaper than the Smart-UPS models. apcupsd can be used with both types, but you need to check the specification for each model to make sure.

I use an APC Back-UPS to protect a 24/7 server which is running apcupsd and sends me e-mails for various reasons (loss of mains power; return of mains power; battery low; shutting down the server; etc.) and it shuts down the server if battery power falls below a user-specified threshold (there are different thresholds -- see the apcupsd User Manual for details). In retrospect, for a 24/7 server I should have bought a Smart-UPS rather than a Back-UPS, as the UPS battery died in its second year while there was mains power supply, and power was cut to my server. (Fortunately no damage to the data on the server, but I happened to be away on a work trip and could not replace the 12-volt lead-acid battery until I returned home a couple of weeks later).
_________________
Clevo W230SS: amd64, VIDEO_CARDS="intel modesetting nvidia".
Compal NBLB2: ~amd64, xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC systemd-utils[udev] elogind KDE on both.

My blog
Back to top
View user's profile Send private message
abduct
Apprentice
Apprentice


Joined: 19 Mar 2015
Posts: 215

PostPosted: Sat Sep 01, 2018 1:14 am    Post subject: Reply with quote

Thanks for the replies!

I am not partial to cyberpower, although I have heard from a friend that works with them saying that they caught fire a few times. Although who knows if this was a off chance or defective product. I will look at that refurb UPS site though.

Price is an issue though. I am looking for something in the 100-200$ range so the cyberpower fit that budget.

As for the smart-ups/backup-ups, if I had to choose a smart UPS may be the way to go. My main thing is I want to allow my server to gracefully shutdown during a power outage to protect my software raid arrays. This is for my home server.

The features I need specifically is graceful shutdown and email alerts. Anything extra is bonus. If I could script the support myself that would be bonus as I could customize features for myself.

Is there a central repo for NUT examples somewhere? Is it a generic API for gathering information, or does it change depending on which drivers you load?

Thanks again.
Back to top
View user's profile Send private message
Akkara
Bodhisattva
Bodhisattva


Joined: 28 Mar 2006
Posts: 6702
Location: &akkara

PostPosted: Sat Sep 01, 2018 5:50 am    Post subject: Reply with quote

Here's something that is not directly addressing your question, but is something to consider. It regards battery life.

UPSes run their batteries very hard, and that is why they only last a year or so. Because of that, I generally advise to get a UPS with a much longer run-time than you expect to need. This does two things: first, it's draining the battery slower, which helps it last longer. Then, as the battery starts to degrade, you can delay replacing it because of the extra capacity.

Ideally, the max discharge rate out of a sealed lead-acid battery should not exceed the so-called "1C" rate. "1C" is when the amperes being drawn, equals (numerically) the rated amp-hours of the battery. (And even that rate is considered quite high.) So a 9 amp-hour battery, being discharged at 9 amps, is being discharged at the "1C" rate. A 9 amp-hour, being discharged at 9 amps, you'd expect to last an hour, but the reality is closer to 30-40 minutes. That's because a battery's rated amp-hour capacity is measured at a much smaller discharge, usually 1/10th or 1/20th of that (where the battery would last close to 10 or 20 hours). The faster you discharge a battery, the less "amp-hours" you can get out of it.

If you discharge faster than "1C", the runtimes drop very quickly. Looking at the datasheet for your UPS, it shows 11 minutes runtime at half load (450 W), and 3 minute runtime at full load (900 W). If it were a linear relationship, the full-load runtime would be half of 11, or 5.5 minutes.

It is losing almost 50% of the battery capacity going from half-load to full-load. This tells me the battery is highly overtaxed. Looking at page 2 shows it uses two 12V, 8.5 amp-hour batteries. 12V * 8.5 A-H is 200 watt-hours of rated battery capacity. But 900 watts * 3 minutes is 45 watt-hours. Less than 25% of the battery capacity is actually available to power the machine. The rest is being wasted in inefficiency and heat and causing damage to the battery.

This is not to say it is a bad UPS. Just don't listen to its advertised ratings. If you want low-maintenence longevity, this UPS is fine for loads of 150 watts or less. If your server draws more than that, I strongly advise getting a more capable UPS.

You mentioned a pretty tight budget early on. For a small low-power server you should be fine. But if it has a lot of disks and draws a lot of power, I don't know if you can achieve this ideal on that budget. Either be prepared to replace batteries after every 2nd outage (I'm not kidding here - find out how much replacement batteries will cost - you'll need 2 of them according to that datasheet). Or try to scrounge up a big cheap used UPS that's in good shape electrically, then buy new batteries for it and enjoy a long service life. It is easily possible to go 5-6 years between battery changes, if designed and spec'ed well. Good luck!
_________________
Many think that Dilbert is a comic. Unfortunately it is a documentary.
Back to top
View user's profile Send private message
steve_v
Guru
Guru


Joined: 20 Jun 2004
Posts: 388
Location: New Zealand

PostPosted: Sat Sep 01, 2018 7:56 am    Post subject: Reply with quote

Akkara wrote:
try to scrounge up a big cheap used UPS that's in good shape electrically, then buy new batteries for it and enjoy a long service life.

This^.
Go get an old APC unit, the bigger the better, and put new batteries in it. Generally speaking, you want it to run at <40% load to get a reasonable life out of the batteries.
APC stuff isn't cheap new, but one can get second-hand units for a song. The SU-1000 I run at home is 22 years old, cost me ~$15 (plus a home-made cable), and has served me well for the last 10 years and two batteries.
It's an RS-232 interface unit though, so you'll want something slightly newer if you don't have a serial port.
Back to top
View user's profile Send private message
abduct
Apprentice
Apprentice


Joined: 19 Mar 2015
Posts: 215

PostPosted: Sat Sep 01, 2018 4:42 pm    Post subject: Reply with quote

Thanks for the information Akkara and steve_v. I did see the specs of the UPS and felt it was a bit low, but I was not expecting hours of runtime, just enough to shutdown. Although I am going to start searching for used UPS and perhaps I can score a better one.

A place where I work throws out UPS's regularly due to batteries going dead (they make too much money to be inconvenienced to just repair the UPS's so they recycle them and buy new). Has anyone tried replacing the batteries themselves or used batteries not rated for the UPS?

I have heard of people putting car batteries and such on a UPS (externally mounted/wired) vastly increasing the amp hours a UPS can provide. I wouldn't be against the idea since this is for my home network, although I don't know if this is actually possible. I would of imagined that the UPS would have a micro controller programmed to a specific rating of battery for protections. But if the charging and such simply checks the voltage to tell when the batteries low/finished charging then I don't see why such a mod wouldn't work.

What is a decent amp hour rating I should be looking at. I am going to run a Dell T7600 4 HDD, dual CPU workstation off it as a headless server (which will power down after a timeout period such as 30-90 seconds to save the raid array) which will be mostly IDLE. Considering my OLD rackmount draws about 250w running ancient hardware (dd2 etc) I can imagine this server drawing around 100-200w idle. Then the only other constant load would be a modem and wifi router, just for my homes occupants convenience. I imagine after the server is such down that the modem and router would draw barely anything.
Back to top
View user's profile Send private message
steve_v
Guru
Guru


Joined: 20 Jun 2004
Posts: 388
Location: New Zealand

PostPosted: Mon Sep 03, 2018 5:49 am    Post subject: Reply with quote

abduct wrote:
Has anyone tried replacing the batteries themselves or used batteries not rated for the UPS?
Yup. There's no reason to buy the official battery packs if one can get something with close-enough specs (and dimensions) elsewhere. You will want valve-regulated types, with a comparable discharge rate.
Pretty sure I have a couple of spare panasonics for mine under the desk somewhere, and they cost me a fraction of the official APC pack.

abduct wrote:
I have heard of people putting car batteries and such on a UPS (externally mounted/wired) vastly increasing the amp hours a UPS can provide.

I know people who have used old car batteries with a cable out the side too. I wouldn't recommend it, but it does work. ;)

abduct wrote:
I would of imagined that the UPS would have a micro controller programmed to a specific rating of battery for protections.
I know that APC units do, and I also know that it can be recalibrated: with the official dongle, some unofficial software, or manually with a serial terminal.
You'll probably want to do this anyway if the batteries have been totally dead for a while, as the battery constant in the firmware can get far enough out of whack to make the UPS reject even official packs.

abduct wrote:
What is a decent amp hour rating I should be looking at.
My 1000w unit uses a pair of 12v 12Ah batteries, and I get 30-45 minutes running my home server (dual X5460, 48GB, 12xHDD), switch & router. Last I checked, load is 200-450w, with most time spent at the lower end of that.
Batteries have been lasting me 4-ish years, with weekly selftests and the occasional (2-3/year) power outage. Setting it up so the load is shut down before the batteries get too low is key to decent longevity.
Back to top
View user's profile Send private message
Akkara
Bodhisattva
Bodhisattva


Joined: 28 Mar 2006
Posts: 6702
Location: &akkara

PostPosted: Mon Sep 03, 2018 6:43 am    Post subject: Reply with quote

abduct wrote:
I have heard of people putting car batteries and such on a UPS (externally mounted/wired) vastly increasing the amp hours a UPS can provide. [...] I would of imagined that the UPS would have a micro controller programmed to a specific rating of battery for protections. But if the charging and such simply checks the voltage to tell when the batteries low/finished charging then I don't see why such a mod wouldn't work.

The charging voltage of a sealed lead-acid, and of a liquid vented one, is slightly different. The ideal voltages also vary with temperature. Ideally a UPS would have a temperature sensor mounted near the battery(ies) to cover all this. (I don't know if they do.) So going to external batteries would require tweaking the charge voltage if necessary, and moving that sensor (if it exists). In short, it is complicated. It can be made to work, if you (and the circuit) understand the fine details of charging a lead-acid battery.

The best setup I've seen uses surplus RV-style inverter designed to use an external battery, attached to an array of deep-cycle marine batteries (with each individually switched to allow for maintenance without total shutdown). They've only recently had to replace the batteries, after 10 years of operation and thru several long outages.

Quote:
What is a decent amp hour rating I should be looking at. I am going to run a Dell T7600 4 HDD, dual CPU workstation off it as a headless server (which will power down after a timeout period such as 30-90 seconds to save the raid array) which will be mostly IDLE. Considering my OLD rackmount draws about 250w running ancient hardware (dd2 etc) I can imagine this server drawing around 100-200w idle. Then the only other constant load would be a modem and wifi router, just for my homes occupants convenience. I imagine after the server is such down that the modem and router would draw barely anything.

200w idle, let's say it is 300w under load (I'm assuming mostly file service, not heavy compute.) 300w * 5 minutes / (60 min/hour) = 25 watt-hours. If that's coming from a 12V battery, that's about 2 amp-hours assuming perfect efficiency (unrealistic), 4 amp-hours accounting for inefficiency, and 8 amp-hours because battery life suffers when discharged more than 50%.

But the unfortunate reality of lead-acid batteries is that you need to budget at least 30 minutes of runtime to get good battery life, simply because the limitation is how fast you can discharge them without shortening their life too much. Even if you don't need that much capacity. That would be 150 W-h, coming from 12V would require about 18 amp-hours after counting inefficiency.

For short-duration high-power loads like you will have, a lithium-ion based UPS is probably a better choice. They have a much higher peak power capacity and don't need to be over-provisioned as much. But the charging is even more complicated and touchy. As is the risk of fire.

...
(random thought followup)

One thing I haven't seen, and which I wonder "why not", is a battery and charge-controller hooked up directly to the power-supply 12V rail. Power goes out, battery keeps supplying 12V. Yes it won't be quite that simple, you'll need a bit of a step-down from the somewhat higher an variable battery voltage to the 12V rail, and a corresponding step-up to charge. But that small amount of tweakage should be a lot easier and much more efficient that going from 12V to 120AC, then back down again.

Laptops are a bit like that, their battery serving as a "built-in UPS". Except laptops keep too high a charge on their batteries, in the expectation that they be taken mobile at any time. A laptop that is kept permanently plugged in will soon lose battery capacity due to lithium's dislike of high charge voltage especially when combined with the high temperature of an operating laptop.

It seems like something a case manufacturer would want to make and sell: Case with built-in power-supply and UPS all in one. Just add battery.
_________________
Many think that Dilbert is a comic. Unfortunately it is a documentary.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54324
Location: 56N 3W

PostPosted: Mon Sep 03, 2018 9:33 am    Post subject: Reply with quote

Akkara wrote:
(random thought followup)

One thing I haven't seen, and which I wonder "why not", is a battery and charge-controller hooked up directly to the power-supply 12V rail. Power goes out, battery keeps supplying 12V. Yes it won't be quite that simple, you'll need a bit of a step-down from the somewhat higher an variable battery voltage to the 12V rail, and a corresponding step-up to charge. But that small amount of tweakage should be a lot easier and much more efficient that going from 12V to 120AC, then back down again.

Laptops are a bit like that, their battery serving as a "built-in UPS". Except laptops keep too high a charge on their batteries, in the expectation that they be taken mobile at any time. A laptop that is kept permanently plugged in will soon lose battery capacity due to lithium's dislike of high charge voltage especially when combined with the high temperature of an operating laptop.

It seems like something a case manufacturer would want to make and sell: Case with built-in power-supply and UPS all in one. Just add battery.


The whole DC to AC conversion is not really required any more. It dates back to a time when most power supplies used a mains frequency transformer.
With switched mode PSUs, the input AC is converted straight to DC then the "switched mode" bit converts the DC to high frequency AC so you can have a much smaller and lighter transformer.
The "switched mode" does a bit more than that, since the switching pulse width is controlled to regulate the output voltage.

Where all this is going is that in theory, a computer switched mode PSU will be quite happy with a DC input ... 10 car batteries gets you 120v (approx) .. and cuts out the middle man.
The down side is that only half the PSU input bridge rectifier will be used, so you really need to check that it can handle twice the rated current.
Then there is the fire hazard with all that stored energy. DC is far more dangerous on contact than AC too. There are lots more down sides.

Getting back to the "why not" computer PSUs don't do power conversion from 12v to anywhere else. Its only rectified input voltage to everywhere and even then, only one output voltage is regulated.
The design would need to change from mains to 12v then 12v to everywhere else and it would need to work with and without a battery.
That's two conversions which is bad for efficiency. Its also approximately what laptops do.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
steve_v
Guru
Guru


Joined: 20 Jun 2004
Posts: 388
Location: New Zealand

PostPosted: Tue Sep 04, 2018 10:10 am    Post subject: Reply with quote

Akkara wrote:
Ideally a UPS would have a temperature sensor mounted near the battery(ies) to cover all this. (I don't know if they do.)
Most do have a temperature sensor, though IME the cheap ones are far more interested in the inverter temperature than the battery. I've seen a fair few inexpensive UPS that do nothing more complex than constant-voltage trickle/float charge... and that's one of the reasons battery life is crap. Most UPSs are crap altogether.

Akkara wrote:
It can be made to work, if you (and the circuit) understand the fine details of charging a lead-acid battery.
That depends on your definition of "work" :P
Lead acid batteries can be and often are charged with little more than a transformer and rectifier. It's not particularly good for them, but unlike lithium chemistries they can stand considerable abuse.
I'm not a battery expert by any means, but my day job does involve them fairly regularly, though in somewhat larger installations than your average home UPS.

Akkara wrote:
One thing I haven't seen, and which I wonder "why not", is a battery and charge-controller hooked up directly to the power-supply 12V rail. Power goes out, battery keeps supplying 12V. Yes it won't be quite that simple, you'll need a bit of a step-down from the somewhat higher an variable battery voltage to the 12V rail, and a corresponding step-up to charge. But that small amount of tweakage should be a lot easier and much more efficient that going from 12V to 120AC, then back down again.
More efficient, yes. But not easy to do with cheap readily-available components unless you like designing switchmode regulators, which is considered akin to voodoo outside the field.
Back to top
View user's profile Send private message
bunder
Bodhisattva
Bodhisattva


Joined: 10 Apr 2004
Posts: 5934

PostPosted: Tue Sep 04, 2018 1:54 pm    Post subject: Reply with quote

I have 3 of that model of UPS, but they had another display design than the one they're currently using.

Code:

chris@haswell ~ $ upsc CYBERPOWER
battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 20
battery.mfr.date: CPS
battery.runtime: 3900
battery.runtime.low: 300
battery.type: PbAcid
battery.voltage: 13.7
battery.voltage.nominal: 12
device.mfr: CPS
device.model:  CP 1500C
device.type: ups
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: auto
driver.parameter.synchronous: no
driver.version: 2.7.4
driver.version.data: CyberPower HID 0.4
driver.version.internal: 0.41
input.transfer.high: 140
input.transfer.low: 90
input.voltage: 115.0
input.voltage.nominal: 120
output.voltage: 115.0
ups.beeper.status: disabled
ups.delay.shutdown: 20
ups.delay.start: 30
ups.load: 5
ups.mfr: CPS
ups.model:  CP 1500C
ups.productid: 0501
ups.realpower.nominal: 388
ups.status: OL
ups.test.result: Done and warning
ups.timer.shutdown: -60
ups.timer.start: 0
ups.vendorid: 0764


edit: sorry just realized you were looking to send emails on events... looks like /etc/nut/upssched.conf is the file you want to play around with.
_________________
Neddyseagoon wrote:
The problem with leaving is that you can only do it once and it reduces your influence.

banned from #gentoo since sept 2017
Back to top
View user's profile Send private message
abduct
Apprentice
Apprentice


Joined: 19 Mar 2015
Posts: 215

PostPosted: Tue Sep 04, 2018 8:47 pm    Post subject: Reply with quote

@bunder What software is that?

I got myself a free UPS (APC XS1300), but I think the batteries may be shot. I will have to do some investigation and trouble shooting on it. Worse case I spend 50-70$ on new batteries + interface cable and/or recycle it and keep looking for one.
Back to top
View user's profile Send private message
bunder
Bodhisattva
Bodhisattva


Joined: 10 Apr 2004
Posts: 5934

PostPosted: Tue Sep 04, 2018 9:05 pm    Post subject: Reply with quote

upsc is part of nut.
_________________
Neddyseagoon wrote:
The problem with leaving is that you can only do it once and it reduces your influence.

banned from #gentoo since sept 2017
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum