SOLVED UPS configuration?

Status
Not open for further replies.

RobertT

Explorer
Joined
Sep 28, 2014
Messages
54
I just got a UPS and am trying to set it up on my 9.3-beta freenas. Normally I would ask this on the regular help forum but since I am on beta I am posting here.

So first off I am pretty sure things are talking fine. I tested with "upsc -l" and "upsc ups". I can see info on the UPS from that.

I see in the console log this:
Dec 2 20:30:14 hostname upsmon[7154]: Login on UPS [ups] failed - got [ERR ACCESS-DENIED]

Do I need to worry about that? I just typed in a random password. I also tryed typing in (from the freenas docs) "fixmepass". Neither seemed to get rid of that error. Will freenas really shutdown when power is out? Any way I can tell without actually pulling power?
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
are you using a remote monitor or local?
 

pjc

Contributor
Joined
Aug 26, 2014
Messages
187
How is your UPS connected to your server? USB? If so, look for it to show up in the logs when you power up or plug it in. ("grep usbgen /var/log/messages"). Then make sure you point the UPS configuration at that device, e.g. /dev/usbgen1.2.
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
When using USB that uses the hid driver specifying a device doesn't do anything.
 

pjc

Contributor
Joined
Aug 26, 2014
Messages
187
Which driver? For mine, it says the port is required. APC ups 2 Smart-UPS USB USB (usbhid-ups)
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Any of the drivers that have usbhid-ups don't care about the port. You can enter any value you want and it will work.

The driver ignores the "port" value in ups.conf. Unlike previous versions of this driver, it is now possible to control multiple UPS units simultaneously with this driver, provided they can be distinguished by setting some combination of the "vendor", "product", "serial", "vendorid", and "productid" options. For instance:

[mge]
driver = usbhid-ups
port = auto
vendorid = 0463
 

pjc

Contributor
Joined
Aug 26, 2014
Messages
187
Cool, I didn't know that.

I'm also seeing the "ERR ACCESS-DENIED" in the log. Could be related to https://bugs.freenas.org/issues/6929.

In the mean time, @RobertT, you can go to the shell and type "upsc ups" and it'll list everything it knows about the UPS if it's working.
 

RobertT

Explorer
Joined
Sep 28, 2014
Messages
54
So yes I see lots of data when I type "upsc ups"..
here is some of the data..

Code:
device.mfr: American Power Conversion
device.model: Back-UPS RS 1000
device.serial: JB0311019574
device.type: ups
driver.name: usbhid-ups
driver.parameter.pollfreq: 30
driver.parameter.pollinterval: 2
driver.parameter.port: /dev/ugen0.6
driver.version: 2.7.2
driver.version.data: APC HID 0.95
driver.version.internal: 0.38


So is there any way for me to know without pulling power if freenas will shutdown properly during an outage?
 

pjc

Contributor
Joined
Aug 26, 2014
Messages
187
So is there any way for me to know without pulling power if freenas will shutdown properly during an outage?
Not with absolute certainty, no. You've at least confirmed that FreeNAS knows about your UPS. Also, did you turn UPS "on" in the services control panel?

What do you have configured for your UPS settings in GUI? Specifically, when does it shut down? On battery for 30 seconds? There's apparently a bug in the timer code that makes it wait 2x that: https://bugs.freenas.org/issues/5913 .

See also this thread: https://forums.freenas.org/index.php?threads/ups-is-it-working.23859/
 

RobertT

Explorer
Joined
Sep 28, 2014
Messages
54
UPS service is ON.
I set to shutdown just before battery runs out.

If I were to change it to as soon as power lost then I could test it is working.
Where would I watch to see it was preparing to shutdown?
Will it abort the shutdown if power is restored?
 

pjc

Contributor
Joined
Aug 26, 2014
Messages
187
You can watch on the console, or from the shell: "tail -f /var/log/messages".

Once it starts shutdown, I don't think it will abort. But you don't want it to anyway, you want to make sure that "low battery" still gives your machine enough time to complete the shutdown.

Just do it when you can afford a reboot.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
If you have your email set up properly you should also get email notification your UPS is onbatt when you pull the plug, even for a second, it doesn't matter if you have the UPS setting to shutdown on low battery or not. You will get another email stating your UPS is back on power once you plug it in. If you get those emails then you can be 99% assured that your UPS will trigger a shutdown as you specified.

Also, if you have the console messages enabled in the footer of your GUI, you will see those messages when you pull the cord and plug it back in. This is another great piece of feedback but the emails are the real proof you have the UPS turned on and acting on the data.
 

pjc

Contributor
Joined
Aug 26, 2014
Messages
187
Good point. You can see if it notices the onbatt/offbatt pretty much immediately.

But if you're not sure whether your battery's "low battery" gives you enough time to shut down, you'll want to test that specifically.

Be aware that the default of 30 seconds before starting shutdown is not ideal for certain UPSs that do period battery checks. For example, every 3 months, mine goes on battery power for 1 minute to make sure the batteries are still OK. That would make my server shutdown every 3 months... :)

(I was glad it tested, too, since it warned me when my batteries were toast...and boy, were they. Cracked and all. I hadn't noticed the you're-supposed-to-replace-them-every-5-years marking, so they'd been on nonstop for 7 years.)
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
I hadn't noticed the you're-supposed-to-replace-them-every-5-years marking, so they'd been on nonstop for 7 years.)
7 years is very good life span for an UPS battery.
 

pjc

Contributor
Joined
Aug 26, 2014
Messages
187
As I now know. :) I'm not sure how far in advance of the failed diagnostic they actually failed. Maybe they really only lasted 6 years...
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
I've never had a UPS batter last 5 years. LOL. Typically I see 3-4 years.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
I agree, typically I see 4 years and then it's time to order a new set of batteries. But batteries are cheaper than an entire new UPS.
 
J

jkh

Guest
I see in the console log this:
Dec 2 20:30:14 hostname upsmon[7154]: Login on UPS [ups] failed - got [ERR ACCESS-DENIED]
That was a bug in our new password encryption code - it has been fixed in the latest update.
 
Status
Not open for further replies.
Top