Koozali.org: home of the SME Server

Best UPS

Del

Best UPS
« on: May 02, 2003, 07:39:49 AM »
Hi All,
Can anyone advise on the best UPS to use with SME? Preferably one with software that can be used to shut down the server gracefully after a power failure.
I have seen apcupsd mentioned on the forum, is this only for use with APC ups's?
Has anyone actually got NUT to work yet? Any info or feedback is appreciated.
Regards,
Del

Paul

Re: Best UPS
« Reply #1 on: May 02, 2003, 10:29:13 AM »
I have NUT working on a APC XS 1500 USB UPS.  I like this UPS because it is fairly priced and provides over 1 hour of back-up on my Athlon XP 1800 (monitor off), 2 network hubs and cable modem.  You can also purchase an "extra" battery pack that just plugs in and will provide an additional 2 hours.

This UPS is a "dumb" ups but it has so much standby time it has only had to shut the box down once in several months.  It did a gracefull shutdown and when the power came back on I have my BIOS setup to reboot after a power failure and the server booted right back up.  I was quite pleased.

By default NUT is set up for a USB UPS, this surprised me because the USB implementation of NUT (and the other ups apps) is experimental.  However, it seems to work just as it's supposed to.

The only problem with NUT that has not been worked out is some sort of monitor.  upsmon is included and as I understand, upsmon works with a CGI script to provide real-time information but I haven't been able to figure out how to get that to work.  Shad Lords posted that he was working out some kinks (I don't know what problems he was having, he did not elaborate) with NUT but I haven't seen him post anything new for a couple of months.

I am happily using NUT with a USB UPS.  NUT is disabled when you install it with update 2 or above.  You have to enable it and the command is as follows but don't turn it on until you have a USB UPS connected or it will fill your log files with errors.

/sbin/e-smith/db configuration setprop nut status enabled

I'm pretty sure you have to reboot for this change to take effect.

Good Luck,

Paul

Ray Mitchell

UPS NUT and USB
« Reply #2 on: May 02, 2003, 05:32:01 PM »
> I have NUT working on a APC XS 1500 USB UPS.  

Hey Paul that's intesting to hear.

> By default NUT is set up for a USB UPS, ..........
> However, it seems to work just as it's supposed to.

What is the "supposed to" bit ?

> NUT is disabled when you install it with update 2 or above.
> You have to enable it.....
> /sbin/e-smith/db configuration setprop nut status enabled

Was there any other configuration setup required, did you change any settings in any config files for your UPS ie run time before shutdown etc etc. What and where ?

Thanks & Regards
Ray Mitchell

Paul

Re: UPS NUT and USB
« Reply #3 on: May 02, 2003, 09:16:29 PM »
Ray Mitchell wrote:

> > By default NUT is set up for a USB UPS, ..........
> > However, it seems to work just as it's supposed to.
>
> What is the "supposed to" bit ?

1-It scans the USB port and determines if a UPS is present.
2-If not present it will fill logs with "stale data" errors.
3-If present, it determines if on line power or battery power.
4-If on battery and battery gets low it executes a proper shutdown of the box.

Like I said, my UPS is a "dumb" UPS and thats about all it is capable of doing.  Some UPS's will provide much more info and will even take a powerdown command and turn the UPS off, mine will NOT.  So as far as my UPS is concerned, it works as it's "supposed to".

> > NUT is disabled when you install it with update 2 or above.
> > You have to enable it.....
> > /sbin/e-smith/db configuration setprop nut status enabled
>
> Was there any other configuration setup required, did you
> change any settings in any config files for your UPS ie run
> time before shutdown etc etc. What and where ?

No, I just enabled it as above and the "stock" configuration worked out of the box.  My UPS is able to send a "low battery" signal and there was no need to change any config files.  I looked at all the templates and config files first and determined that the settings (according to the nut website) would be acceptable for my UPS and tested it with a dummy load before I actually plugged the sme box into the UPS.

The only thing that needs to be worked out for me is how to get the monitor page in upsmon (I think it is a CGI script)  working.  I also think Shad is/was working on a server-manager panel to configure everything but he won't email or post back to me so I gave up asking.  I offered up my assistance but I have never heard back from Shad so I just started poking around the templates and config files and determined NUT might just work.  I tested on my test box first and after that worked, I moved the UPS over to my production server.

Just remember, I am using a USB connection and the cable that came with the UPS (APC XS 1500) and that's the only UPS I have tested it on.  The default setup when you install the NUT RPM's is for a USB (hidups) interface, this can be changed with a custom template until Shad finishes what he is doing.  There is only 1 driver for USB, there are many for serial and you can run into major problems with cables on a serial connection and even have to make up your own cable.  This is why I wanted to get a USB UPS working.  NUT seems to have almost as many configuration options as SAMBA, hahaha.  Shad is probably having a hell of a time trying to decide what options are needed/wanted for an sme box.  Go to the web site and read, Hell I even think there is an option for NUT to make your coffee for you in the morning :)

del

Re: UPS NUT and USB
« Reply #4 on: May 03, 2003, 02:08:01 AM »
Hi Paul,
Thanks for the info, where are you located, I am in Florida and a search on the US APC website says that the APC XS 1500 is not available in my region!
Thanks again,
Del

Ray Mitchell

Re: UPS NUT and USB
« Reply #5 on: May 03, 2003, 05:21:04 AM »
Dear Paul
You may recall we had some dialogue about NUT a while ago, and yes I did do a bit of looking at the NUT site also but did not have enough time available to work through it all.

Thanks for the feedback, at least we all know that NUT will work out of the box for sme with USB UPS's, at least for the configuration you mentioned, which fares well for other possible combinations.

Regards
Ray Mitchell

Paul

Re: UPS NUT and USB
« Reply #6 on: May 03, 2003, 05:50:46 AM »
Ray Mitchell wrote:
>
> Dear Paul
> You may recall we had some dialogue about NUT a while ago,
> and yes I did do a bit of looking at the NUT site also but
> did not have enough time available to work through it all.

Yes, I do remember and I thank you for heading me in the right direction with the proper "enable" command.  I actually printed out the entire thread for future reference.  It's friends (if I am allowed to call you that) like you that have made my e-smith experience so positive.

> Thanks for the feedback, at least we all know that NUT will
> work out of the box for sme with USB UPS's, at least for the
> configuration you mentioned, which fares well for other
> possible combinations.

Like I have been saying, I don't know too much being a total noobee but I want to contribute in any way I am able.  e-smith and this forum have saved me a lot of time, money and my sanity, the least I can do is try to help.  I am going to toy around with a belkin serial UPS on my test server to see if I can get it working that way as well.

I wish I could find out where Shad is on this, I understand how some of NUT works and I think I can help him out with it but I don't want to start working on it if he is almost done and I don't want him to think I am "stepping on his toes" so to speak.  I don't really know open source etiquette.

Thanks, Paul

Paul

Re: UPS NUT and USB
« Reply #7 on: May 03, 2003, 06:12:45 AM »
del wrote:
>
> Hi Paul,
> Thanks for the info, where are you located, I am in Florida
> and a search on the US APC website says that the APC XS 1500
> is not available in my region!
> Thanks again,
> Del

It seems to be some sort of item only availabe at CompUSA and a few other stores, you won't find it on tha APC website as I was told by an APC support person that this product belongs in their "retail line" whatever that is supposed to mean.  Try this link at compusa and put in your zip and it will tell you the closest location that has it.

http://www.compusa.com/products/product_info.asp?product_code=298348&pfp=BROWSE

Also available is the XS 1000 at $129 (after rebate)

http://www.compusa.com/products/product_info.asp?product_code=298345&pfp=BROWSE

It doesn't seem the extra external battery is available yet.

Paul

Re: UPS NUT and USB
« Reply #8 on: May 03, 2003, 06:22:11 AM »
One other thing, the mfg. part number on this unit is BX1500 (on the serial number label) and on the front of the unit it says XS1500 so I really think the correct model number is BX1500, maybe???

Just thought I would let you know that.

Paul

del

Re: UPS NUT and USB
« Reply #9 on: May 06, 2003, 07:06:11 PM »
Hi Paul,
I have plugged in the ups (usb) and logged on as root, then I typed:
/sbin/e-smith/db configuration setprop nut status enabled
then pressed enter and the server says:
bash: /sbin/e-smith/db/: Not a directory  

Have I missed something here? I am a relative noobie, so please forgive me if I am being stupid here!

Regards,
Del

del

Re: Best UPS
« Reply #10 on: May 06, 2003, 07:10:27 PM »
Sorry, I am using sme 5.6u4
Del

Ray Mitchell

Re: UPS NUT and USB
« Reply #11 on: May 06, 2003, 08:05:36 PM »
del
> /sbin/e-smith/db configuration setprop nut status enabled
> then pressed enter and the server says:
> bash: /sbin/e-smith/db/: Not a directory  

That command appears to be correct, try it again and be careful about typos.

the /sbin/e-smith/db part has no spaces and there is a space between all the other parts.

You will know if it has worked by checking the services that start up after a reboot
NUT [enabled]
is what you are looking for.

further info about NUT see
http://forums.contribs.org/index.php?topic=7145.msg25986#msg25986

Ray

Paul

Re: UPS NUT and USB
« Reply #12 on: May 06, 2003, 09:44:04 PM »
Del,

db is not a directory, it is an executable (I think) file and should be in /sbin/e-smith

It appears that you put an extra slash in your command after db (/sbin/e-smith/db/ configuration setprop nut status enabled WILL NOT WORK).  If you use putty or another SSL client to connect to your server, try cut and paste.

/sbin/e-smith/db configuration setprop nut status enabled

if you type the following, it should come back with a small "usage help" menu.

/sbin/e-smith/db

Good Luck,

Paul

del

Re: Best UPS
« Reply #13 on: May 07, 2003, 05:28:04 AM »
Hi Paul, Hi Ray,
OK I found the problem,  was in the /root directory not the / directory! DUH!
Anyhow I have used the command, I got no errors and I restarted the server and watched all the services start and it said that nut started OK.
 
Paul said "No, I just enabled it as above and the "stock" configuration worked out of the box. My UPS is able to send a "low battery" signal and there was no need to change any config files. I looked at all the templates and config files first and determined that the settings (according to the nut website) would be acceptable for my UPS and tested it with a dummy load before I actually plugged the sme box into the UPS."

Without being to stupid how can I test it with a dummy load?
I have had a look at the nut web site and it doesn't appear to give you instructions on how to test the shut down part.
Thanks again for all the help.
Del

Paul

Re: Best UPS
« Reply #14 on: May 07, 2003, 05:55:22 AM »
Del,

1-Hook the POWER cable from the computer to a "live" outlet (not to the UPS).

2-Connect the USB cable from the computer to the UPS.

3-Hook a monitor and a 60 watt lamp to the battery powered outlets on the back of the UPS.

4-Turn everything on and then after boot, unplug the UPS from the wall power so it goes into battery mode.  You log files should indicate "UPS on battery" or something like that.

5-Wait, Wait, Wait (aprox 1 hr) until the UPS sends a low battery signal to the computer and executes a shutdown.  The computer should shut down BEFORE the battery goes dead.

6-Wait to see how much longer the ups stays on, it should run out of battery and the UPS should then shut down in a few minutes.

This will let you know if the kill command works and shuts off the box before the battery goes dead.  If it fails, your box will still have power and won't do a hard (loss of power) shutdown.

7-If all goes well, plug everything back as normal and boot up.

8-Look at log files and you should see line simular to:

UPS on line power
UPS on battery power
UPS battery low signal
UPS shutting down computer

If you can set the bios in you box to "power back on after power loss" the server will start up by itself once the line power is resumed and the UPS powers back on.  This feature is fairly new (maybe a couple of years old) so if you have an older motherboard bios, you may not have this feature.

Good Luck,  Paul

del

Re: Best UPS
« Reply #15 on: May 07, 2003, 06:36:18 AM »
Hi Paul,
Thanks again, I have followed your instructions to the letter and I am now waiting and waiting ........ as you said I would. I have looked on the NUT site and I can't seem to find any of the directories they say should exist, is this because I am using SME and not another Linux distribution? So one last (I hope) question where will I find the log files? Thanks for your patience.
Del

del

Hey Presto!
« Reply #16 on: May 07, 2003, 08:11:22 AM »
Hi Paul,
I still haven't found the log files but the server shutdown gracefully OK.
The good news is that the ups is a Belkin F6C800-UNV 800va 450 watts, connected via USB, so that's another make model we know works with NUT "out of the box" as it is suppose to! Once again thanks for all the help in this setup. Now if only we could get upsmon working.
Regards,
Del

del

Re: Best UPS
« Reply #17 on: May 07, 2003, 08:22:07 AM »
Hi Paul,
Just a thought, are you running any sort of raid on your server? If someone was would they have to do anything different? I have a server running software raid that I would like to try this UPS and NUT on.
Del

Ray Mitchell

Re: Best UPS
« Reply #18 on: May 07, 2003, 09:03:53 AM »
Whether RAID1 or not, the UPS & NUT should still behave the same.

I would try the automatic power on procedure to see if it works correctlty for your combination though, don't just expect that it will.

My P133 BIOS does not have a power on after AC loss setting, but a P233 from 1998 does have the setting, so that BIOS feature has been around for over 5 years.
Ray

Paul

Re: Best UPS
« Reply #19 on: May 07, 2003, 09:07:54 AM »
del said:

I have looked on the NUT site and I can't seem to find any of the directories they say should exist, is this because I am using SME and not another Linux distribution?

The layout of sme is different in some ways.  The config files are controlled by the templates located in:

/etc/e-smith/templates/etc/ups

To make adjustments to these templates (which will in turn change the proper config files) you will need to create a directory and put custom templates in:

/etc/e-smith/templates-custom/etc/ups

If you don't understand the template and custom-template system that SME uses you need to read:

http://www.e-smith.org/custom/

del also wrote:

I still haven't found the log files but the server shutdown gracefully OK.

 Go to your web based server-manager and under "Administration" you will find "View log files".  Look at the bottom of the "messages" log and you should see things logged concerning your UPS (and a lot of other things).

And then del posted:

Just a thought, are you running any sort of raid on your server? If someone was would they have to do anything different? I have a server running software raid that I would like to try this UPS and NUT on.

Del, my SME system runs on a software raid1 that was installed during setup.  The upsmon signals a standard SME hault command after a battery low signal is received (see /etc/e-smith/templates/etc/ups/upsmon.conf/SHUTDOWNCMD).  This will shut down the SME box (including all running processes including software raid) as if you went to the server-console and did it yourself.

NUTups set up as a USB SHOULD work on any USB UPS (in theory anyway).

Paul

Re: Best UPS
« Reply #20 on: May 07, 2003, 09:15:13 AM »
Ray,

I stand corrected,  I have about a 5 year old machine that has power on after AC loss.  I also have a 2 1/2 year old that does not.  I guess it just depends on the MB and bios combo.

My mistake, sorry.

Paul

Dave Liquorice

Re: Best UPS
« Reply #21 on: May 07, 2003, 12:04:15 PM »
> ...the server will start up by itself once the line power is resumed and
> the UPS powers back on.  

Always assuming that the power outage has lasted longer than the batteries and the UPS has shut down. You need to check what happens if the power is restored before :

1) the shutdown has completed, can you cancel the shutdown and  restart the server?

2) the UPS has powered itself off. The UPS *has* to power cycle its output for the server to restart., even if the utility power is good.

Cheers
Dave.

Scott

Re: Best UPS
« Reply #22 on: September 24, 2003, 03:49:12 PM »
>> ...the server will start up by itself once the line power is resumed and
>> the UPS powers back on.

>Always assuming that the power outage has lasted longer than the batteries and
>the UPS has shut down. You need to check what happens if the power is
>restored before :

>1) the shutdown has completed, can you cancel the shutdown and restart the
>server?

>2) the UPS has powered itself off. The UPS *has* to power cycle its output for
>the server to restart., even if the utility power is good.

I have had this happen. The server shutdown, but the power came back on before the UPS had totally shut down.  Because of this the server doesn't turn back on...

I am worried this will happen again & if I am away from home I cant turn the server back on.

I think I might disable nut and risk the problems I might have if the server doesnt shutdown.  At least then I know the PC will totally drain the UPS battery and *should* cause the PC to turn back on when power is back on.

Of course if there is a better way to get around this problem let me know!

Paul

Re: Best UPS
« Reply #23 on: September 24, 2003, 10:10:43 PM »
I, Myself would NOT risk the possible problems associated with a hard shutdown.  If you are running a raid, then the raid might fail and it will take more time to fix that then to go home and re-start the server.  In either case, your server will be down for a while but going home and pressing the power button seems more logical than spending hours getting the server working properly again.

It also depends on your UPS.  Some are "smart" and some are "dumb".  if you can locate a smart one that is USB and your machine can re-start after power failure, then this would be the way to go.  You can configure the machine to send a delayed UPS power down when the machine shuts down and this will solve your problem.

There are other UPS's that have 2-way communications with the computer and can be configured to do many different power loss, shut down, power up combinations.  These UPS's are quite expensive and are generally in the "server" category.  Also, configuring these type of UPS's is way beyond me but I'm sure it can be done.

I have been running my UPS for 6 months and have only had to turn on the computer once due to the power outage being long enough to shut down the machine but not long enough to drain the batteries and shut down the UPS.  It has gone on battery power countless times for a few minutes or even seconds (this is where a UPS saves your machine).  It has gone full power down and restart 2 or 3 times.  One time the power was down for 6 hours.

Like I said, I have only had the machine not power up 1 time in 6 months.  I would much rather risk my server down for a couple of hours than doing a hard shutdown.

On a side note:  I am a strong believer in putting a UPS on every machine in my office.  I also sell and repair comps and advise my clients to do the same.  Since I have done this (about 5 years now) problems on my machines and the ones I service with UPS's have gone down dramatically.  My clients that don't/won't use UPS's need my services 4 time as often.  Computers need a good, clean and steady power source, your power company can't provide this.  

Power where I live is HORRIBLE.  My UPS on my desktop turns to battery power several time a day but I don't notice any dimming in the lights or anything that would show me the power is less that par.  I think power "brown outs" occur more than we realize and this is where a UPS really helps prevent problems.  Just my opinion.