UPS: Is it working?

Status
Not open for further replies.

esamett

Patron
Joined
May 28, 2011
Messages
345
(I did forum search before posting)

I connected a APC Back UPS Pro 1300 (with fancy LCD display) via USB. My particular model isn't explicitly listed in the driver list but most APC USB UPS are shown to use the same driver. Following directions in the manual I unplugged/replugged the USB and read the port off the green display. I think it was something .2. (ugen0.2?) I changed time to shut down from 30 to 240 for a two minute wait period. I set the email as the same as the admin address. i**@**.com.

This morning I got this security run message:
Code:
freenas.domain kernel log messages:
> CPU: AMD FX(tm)-4130 Quad-Core Processor            (3812.81-MHz K8-class CPU)
> da7 at mps0 bus 0 scbus0 target 7 lun 0
> da7: <ATA HGST HDN724040AL A5E0> Fixed Direct Access SCSI-6 device 
> da7: Serial Number      PK2334PBK7JY9T
> da7: 600.000MB/s transfers
> da7: Command Queueing enabled
> da7: 3815447MB (7814037168 512 byte sectors: 255H 63S/T 486401C)
> SMP: AP CPU #3 Launched!
> SMP: AP CPU #2 Launched!
> da13 at mps1 bus 0 scbus3 target 9 lun 0
> da13: <ATA Hitachi HDS5C302 A580> Fixed Direct Access SCSI-6 device 
> da13: Serial Number      ML0220F30VUPUD
> da13: 600.000MB/s transfers
> da13: Command Queueing enabled
> da13: 1907729MB (3907029168 512 byte sectors: 255H 63S/T 243201C)
> Timecounter "TSC-low" frequency 1906403208 Hz quality 1000
> vboxdrv: fAsync=0 offMin=0x8d2 offMax=0x2b72
> ugen0.2: <American Power Conversion> at usbus0 (disconnected)
> ugen0.2: <American Power Conversion> at usbus0

-- End of security output --

The second to last line refer to the UPS disconnected. I have not received any UPS specific messages and do not know how to verify if NAS auto shutdown is working short of yanking the power plug.

Advice?

Thanks,
evan
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Yank the plug and see if you get an email. Then plug it back in before it shut shutdown.
 

rogerh

Guru
Joined
Apr 18, 2014
Messages
1,111
From the CLI ('Shell' in the GUI) run "upsc <your ups name>@localhost" If it gives you an output other than failure to connect then the driver is working.
 

esamett

Patron
Joined
May 28, 2011
Messages
345
Thanks. I didn't do anything else yet but this morning I got message in email:
Code:
ONLINE - ups

I think my FreeNAS is a Woman. Difficult to understand...
 

esamett

Patron
Joined
May 28, 2011
Messages
345
Code:
battery.charge: 100
battery.charge.low: 10
battery.charge.warning: 50
battery.date: 2001/09/25
battery.mfr.date: 2013/10/12
battery.runtime: 1722
battery.runtime.low: 120
battery.type: PbAc
battery.voltage: 27.3
battery.voltage.nominal: 24.0
device.mfr: American Power Conversion
device.model: Back-UPS RS 1300G
device.serial: 4B1341P35984
device.type: ups
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: /dev/ugen0.2
driver.version: 2.7.1
driver.version.data: APC HID 0.95
driver.version.internal: 0.38
input.sensitivity: medium
input.transfer.high: 147
input.transfer.low: 88
input.transfer.reason: input voltage out of range
input.voltage: 120.0
input.voltage.nominal: 120
ups.beeper.status: enabled
ups.delay.shutdown: 20
ups.firmware: 863.L5 .D
ups.firmware.aux: L5
ups.load: 32
ups.mfr: American Power Conversion
ups.mfr.date: 2013/10/12
ups.model: Back-UPS RS 1300G
ups.productid: 0002
ups.realpower.nominal: 780
ups.serial: 4B1341P35984
ups.status: OL
ups.test.result: No test initiated
ups.timer.reboot: 0
ups.timer.shutdown: -1
ups.vendorid: 051d
[root@freenas ~]#
 

rogerh

Guru
Joined
Apr 18, 2014
Messages
1,111
Seems to be working. And, since email is working, it will tell you if it stops doing so. You really want to test whether it can actually shutdown Freenas sometime when you are happy to shutdown the server. Don't worry about checking whether NUT can shut down the UPS - that function is not implemented in Freenas.
 

pjc

Contributor
Joined
Aug 26, 2014
Messages
187
Don't worry about checking whether NUT can shut down the UPS - that function is not implemented in Freenas.
Wait, what? FreeNAS won't shut down? Or are you just saying that it's NUT that handles it and not FreeNAS code?
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
I believe what he is saying is that NUT can shut down the *UPS* itself (if true, I didn't know this), but that you can't access that functionality from FreeNAS. Why would someone want this functionality anyway, I don't know...

FreeNAS works with nut to shut *ITSELF* down, of course, based upon the UPS situation.
 

rogerh

Guru
Joined
Apr 18, 2014
Messages
1,111
I believe what he is saying is that NUT can shut down the *UPS* itself (if true, I didn't know this), but that you can't access that functionality from FreeNAS. Why would someone want this functionality anyway, I don't know...

FreeNAS works with nut to shut *ITSELF* down, of course, based upon the UPS situation.

Yes, that's exactly what I meant. I won't go into why people want to shut the UPS down, but some of us do!
 

no_connection

Patron
Joined
Dec 15, 2013
Messages
480
Shutting down the UPS will save battery life, especially if there is other equipment like switches on there.
It will also allow the server to start again once the power is returned and the batteries charged enough.

This functionality is very dependent on UPS and if you don't know exactly how and why you want/need it it's best to just manually start the server.
IPMI and similar is ideal here.

If you have a dumb UPS you can run into a situation there the battery is pretty much drained, power comes on and your server starts, then power dies again leaving you with too short of a runtime to safely shut down the server before the batteries die.
Not to mention that you can run into a config/user error so that the UPS shuts off power while you are booting up the server.

An intelligent UPS will allow you to set a minimum charge level before it allows power to come on thus starting a server (that has autostart on mains enabled) safely.

So don't forget to set the server to remain powered off on mains return, not "last state" or power on.
 

pjc

Contributor
Joined
Aug 26, 2014
Messages
187
Thanks for clearing that up.

Any tips on how to actually test the UPS and shutdown? I'd pull the plug, but I don't want to kill everything else on the UPS...

Maybe I can pull the plug into the NAS shuts down and hope that there's still enough battery to plug the UPS back in before total battery depletion?
 

no_connection

Patron
Joined
Dec 15, 2013
Messages
480
If there isn't enough battery to do what you said, you really have a problem at hand. So you probably want to find out now rather than later.

Another option is to use a dummy load on the UPS and run your server from mains (or another UPS if you have one).

If I remember right FreeNAS should shut down when low battery warning comes on, regardless if the set timer have not run out. (have not tested this).

Not sure if FN sends message on UPS shutdown, at least console should react immediately to show if it is being shut down.

Last time I had a power failure FN was not shut down when I came down. I didn't have console running so I'm not sure if it was already in the way down when I hit the power button. Log said it was halting(or should have been at least), but the time it took me to get down because of the beeping it should already have been off.
 

rogerh

Guru
Joined
Apr 18, 2014
Messages
1,111
If there isn't enough battery to do what you said, you really have a problem at hand. So you probably want to find out now rather than later.

Another option is to use a dummy load on the UPS and run your server from mains (or another UPS if you have one).

If I remember right FreeNAS should shut down when low battery warning comes on, regardless if the set timer have not run out. (have not tested this).

As originally configured, FreeNAS will shut down on 'low battery' with no fixed time limit, but you can set a timer instead to shut it down sooner. There is a bug which makes it shutdown in exactly twice the time you set, https://bugs.freenas.org/issues/5913 , so you have to account for this.
 

no_connection

Patron
Joined
Dec 15, 2013
Messages
480
I meant if you set a longer time than battery capacity will allow. Meaning low battery warning comes before scheduled shutdown. I have not tested if it will actually shut down when hitting low battery then, or if it will happily wait for timer to end meaning it will run out of power before beginning shutdown.
 

rogerh

Guru
Joined
Apr 18, 2014
Messages
1,111
I meant if you set a longer time than battery capacity will allow. Meaning low battery warning comes before scheduled shutdown.

That's really not a sensible thing to do. If you want it to run on battery as long as possible, it is best not to set a timer at all. The main value of a timer is to avoid discharging the battery too much if you you are likely to have long or multiple power outages. Having said that, NUT is supposed to shut down on low battery even if on a timer; but there are a lot of, shall we say, idiosyncrasies in how NUT is set up in Freenas. Not least is the effect of the above mentioned bug, which means that if you set a five minute timer it will take 10 minutes to shut Freenas down. And here is the real killer; if you have set a five minute timer, then Freenas will take five minutes to shut down after a low battery signal. Even if it actually responds to it.
 

pjc

Contributor
Joined
Aug 26, 2014
Messages
187
Got it. I should just use shutdown on low battery. I'll give that a try when I get a chance, and unless there's a big problem with my setup, nothing else should go down as long as I plug the UPS back in after FreeNAS shuts down (since I should still have some lingering battery capacity).

A question about configuration, though: what is the monitor user/password used for? The docs aren't clear as to whether that would be used to set up the FreeNAS box as a master or a slave (or both). Mostly I care about whether I need to change the password if I don't plan to do any remote UPS monitoring?

Does the "Remote monitor" checkbox mean that it'll use that username/password to listen for a remote directive to shut down? Or that it will provide remote access to the local UPS's status? And if I don't check it, does the username/password have any effect?
 

pjc

Contributor
Joined
Aug 26, 2014
Messages
187
Oops, one more question: the default setting (at least in 9.2.1.9) is for "on battery" + 30 seconds timer. I want it to be "low battery", and from the above I understand that the 30 seconds will still have an effect.

How do I make it "low battery" only with no timer. Delete the timer value first, then switch to "low battery"?
 

rogerh

Guru
Joined
Apr 18, 2014
Messages
1,111
I would suggest you change the timer to 5 seconds (which is the NUT default for one of the values the timer value modifies) and leave it as "on battery" while you save this configuration. This will permanently change the relevant timer and you can then change to "on low battery" and save this. That is, if they haven't repaired bug 5913 without telling us!
 

rogerh

Guru
Joined
Apr 18, 2014
Messages
1,111
Oh, your other questions. You do need to set a password as part of NUT (upsmon) uses it to communicate with another part of NUT (upsd). But you don't need to tick 'remote monitor' unless you want other hosts to interrogate FreeNAS for the ups state.

The reason for the manoeuvre in my above post is that you can't alter the timer once you are in "low battery" mode. I honestly don't know if you can alter both in the same step by altering the timer first and then the drop down box and successfully save the timer value. Possibly, but I know my way works.
 
Status
Not open for further replies.
Top