APC UPS - help needed!

Status
Not open for further replies.

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Well, I set my shutdown timer for 15 minutes, and 20 minutes went by and no shutdown and no email that it was operating on UPS. I got a broadcast message on the terminal that it was operating on battery. It would be nice if the 'Alert' icon changed to orange and there was a countdown timer somewhere, but it would be even better if it actually emailed and shutdown. Anyway for clarity/reference, this is build 8195 from the 8.01 branch.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
The trunk build I have works for me. I set the timer for 1200 seconds (for testing I used 300 seconds) and "UPS goes on battery". I get the message the UPS is on battery and when the timer hits the console only shows the system shutting down. I like your suggestion to alter in the GUI and countdown timer would be nice too.

This works for my system so I can't state it works for every system/UPS. I'll PM you my IP Address, if you want you can d/l the build and give it a try.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
I never know what goes on with the developers and I know the UPS issue was fixed in the truck well before 8.0.1-Release, there was a step backwards if you will, so I don't "know" if it has been migrated yet. If we had a recent nightly build we might know but since one of their computers doesn't work, nightly builds are on the back burner. When you look at the changes being made, sometimes it's to the trunk, sometimes it's to the branches, sometimes to both. You got me as to where these two stand side by side.

Just to try an add some clarity for people that might not understand what we're talking about with the 'branch' and 'trunk' source, here's my thoughts. The source that @joeschuck is compiling/building FreeNAS from is the 'trunk'. From what I understand, this is the stuff that's continuing toward version 8.1, which could be considered 'alpha'. The 8.01 release 'branch', what I'm building from, is stuff that's already part of 8.01, but continuing to correct stuff that wasn't fixed or included in the 'Official' release of 8.01 and will be included in a maintenance / patch release to 8.01 at some time in near future.

I could be mistaken, and/or stuff that has been fixed hasn't been 'back ported' into the 'branch' source tree yet.
 

olegsomphane

Dabbler
Joined
Oct 6, 2011
Messages
18
http://forums.freenas.org/showthrea...on-battery-mode.&p=12082&viewfull=1#post12082

I think they had problems with their build system and a lot of the fixes didn't make it into the final release because of that. They've since backported those fixes into the 'branch' source tree (not trunk) and if you build that you get a lot of the fixes that were unintentionally left out. I've built it and have it available. If you don't want to build it yourself and send me a PM I can give you a link. It also fixes the email notifications and some other stuff, but I don't have a list of exactly what is fixed.

Edit: I should clarify, what I've built is the FreeNAS-8.0.1-RELEASE-amd64 (8146)
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
I tested Mark's version and his is clearly 8.1, which would mean 'alpha'. I wasn't able to import my settings from 8.01 using the saved settings I exported from my NAS. I also downloaded another version from the 8.01 branch (8214), and built it, and the UPS shutdown and email about being on battery wasn't sent either. So we're either stuck until they make an official 8.01 update release, or back port the fixes for the UPS, or you want to use an alpha version. (Which 8.01 kinda feels like in a way anyway...)
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
I think of the trunk builds (8.1 tagged) just 8.0.1 with improvements. They should be adding more functionality although I haven't seen it, but it's always use at your own risk, but to be honest, all this software is that way right now. If you choose to use another build and didn't want to wipe out your current setup, might I suggest using a different USB flash drive. This is my method for testing something out.
 

William Grzybowski

Wizard
iXsystems
Joined
May 27, 2011
Messages
1,754
You're right, i just found a missing merge commit, which is responsible to schedule shutdown and send emails, r8222.

It should be ok for the next release with fixes for 8.0.1 (aka 8.0.2 or 8.0.1-p1)
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
Thanks William, you're a quiet guy, but usually when you say something it's good news ;) I'll give 8.01 r8222 a try, thanks!
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
This is why it drives me nuts to figure out what is going on between trunk and branches and I only test what is in the trunk because I normally see more updates going in there. William, thanks for correcting it. Protosd, let me know how it turns out.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
William, I built 8.01 branch r8237. The UPS shutdown timer works now and the system shutdown properly, but I didn't receive any email. I receive the test email properly from the settings page. Is there something else that needs to be merged?
 

Milhouse

Guru
Joined
Jun 1, 2011
Messages
564
@William: I don't mean to hijack this thread but as you're posting in it... are there plans to add *Network* UPS support, either in 8.0.x or 8.1 (it's not clear from the 8.1 roadmap if Network UPS will be supported). Unfortunately local (USB) UPS support is of no use to me as I have a central UPS powering several network-connected devices, of which FreeNAS is but one... would be happy to help test Network support if/when it is added! :)
 

William Grzybowski

Wizard
iXsystems
Joined
May 27, 2011
Messages
1,754
William, I built 8.01 branch r8237. The UPS shutdown timer works now and the system shutdown properly, but I didn't receive any email. I receive the test email properly from the settings page. Is there something else that needs to be merged?

Not that i'm aware, if you have any knowledge in shell script you could try tweaking /usr/local/bin/custom-upssched-cmd

Running:
echo "Shutdown" | mail -s "subject" "to@domain.com" from CLI

Checking logs, and make sure email notifier is enable in UPS service settings
 

William Grzybowski

Wizard
iXsystems
Joined
May 27, 2011
Messages
1,754
@William: I don't mean to hijack this thread but as you're posting in it... are there plans to add *Network* UPS support, either in 8.0.x or 8.1 (it's not clear from the 8.1 roadmap if Network UPS will be supported). Unfortunately local (USB) UPS support is of no use to me as I have a central UPS powering several network-connected devices, of which FreeNAS is but one... would be happy to help test Network support if/when it is added! :)

There are plans, yes, however this gonna be very hard to achieve without community patches as I don't have the equipment...

https://support.freenas.org/ticket/915
 

Milhouse

Guru
Joined
Jun 1, 2011
Messages
564
There are plans, yes, however this gonna be very hard to achieve without community patches as I don't have the equipment...

https://support.freenas.org/ticket/915

Probably not useful, but this thread on the FreeNAS 7 forum details the hacks I made to get network rather than local UPS support working in FreeNAS 7. I'm obviously not suggesting the changes will be as trivial in FreeNAS 8, but with a bit of luck the changes to add Network support shouldn't be significant either.

In the case of FreeNAS 0.7, it was simply a matter of configuring the UPS driver to monitor a specific IP address instead of localhost, and changing the monitor "type" from master to slave.

Also, if you don't have any equipment I think there may be a dummy-ups driver in the Network UPS tools - would this allow you to simulate a network attached UPS (possibly even a locally attached UPS)?

If I can be of any assistance, please let me know.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
William, I built 8.01 branch r8237. The UPS shutdown timer works now and the system shutdown properly, but I didn't receive any email. I receive the test email properly from the settings page. Is there something else that needs to be merged?

You must update the email address for root. By default it's empty, you need to go to view users and change email. Enter the address you want the messages to go to. See if that helps, unless you have already done that. That was the only tricky part to getting emails for system issues. I thing there should be a better way to set up notification emails, a single GUI screen devoted to email setup and notifications would be very helpful. It should also check on any other dependencies like if you need to have a DNS configured.

Cheers,
-Mark
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
You must update the email address for root. By default it's empty, you need to go to view users and change email. Enter the address you want the messages to go to. See if that helps, unless you have already done that.

Yeah, I've already done that. I get the nightly emails, and the test emails, just not the UPS email.

@McBrian - How are things going with your UPS since we all sort of hijacked your thread?
 

McBrian

Dabbler
Joined
Oct 4, 2011
Messages
14
Protosd, I had to take a timeout. A client required me to leave home for some time, but I expect to continue with my UPS tomorrow. As far as hijacking is concerned, it is most welcome. I think a working UPS is essential for the success of any NAS. I've read that ZFS is superiour in many ways, but without UPS support I'm afraid it would not be an option. So thank you - all of you - for building a working UPS service into FreeNAS 8.
 

ProtoSD

MVP
Joined
Jul 1, 2011
Messages
3,348
.... if you have any knowledge in shell script you could try tweaking /usr/local/bin/custom-upssched-cmd

Running:
echo "Shutdown" | mail -s "subject" "to@domain.com" from CLI

William,

My shell scripting skills are a little rusty, but I did put some 'echo' statements in the script in different places and here's what I found:


  • The script receives the word "EMAIL" in $1 when I unplug the UPS.
  • The script never seems to enter the while loop while eval read $f; do
  • If I comment out the while loop and put echos inside each case statement, it goes to the 2nd one
  • I have 'email notify' set in the GUI, but the IF statement isn't matching the variable for some reason.
  • If I comment out the IF statement, I get an email which only says "ONBATT"

So, it looks like if the WHILE is fixed and the IF statement is fixed, email will work when the UPS is activated.

Hope that helps narrow down the problem!

Edit: opened ticket #923
 
Status
Not open for further replies.
Top