Setting up UPS on Ubuntu

NWI

Active Member
Joined
Oct 27, 2008
Messages
94
Relatively new with Ubuntu but have managed to set up a HTPC (HP Proliant) using Ubuntu 12.04. I have now bought a Tescom UPS which will secure power to the HP. The UPS came with View Power software which I have installed. The comms to UPS is over a USB cable. When I run View Power the dashboard opens but it shows no UPS being monitored. The whole point of me wanting this was to have the UPS initiate an automatic shutdown after 15 minutes being on battery power.

Can anyone assist her?
I have tried installing Nut - but again here cannot get it to work. Tried to follow step by step instructions but kept getting different error messages

would appreciate any assistance to sort this out
 

Tinuva

The Magician
Joined
Feb 10, 2005
Messages
8,659
The UPS's software actually installed on Ubuntu?

That said, NUT is usually my go to tool for UPS on Linux. The trick is to figure which of the NUT drivers to use for your specific UPS. It may be that you are just using the wrong driver, and should try a few others.

I assume you are orsome1 on the ubuntu forums.
 

NWI

Active Member
Joined
Oct 27, 2008
Messages
94
thanks for response

yes View Power software has a Linux 12.04 version and installed no problem. Can open and view dashboard but does not show monitored UPS. Checking on the manual it should show a USB connection to the UPS in the dashboard with all details from the UPS and then allow management so timed shutdown etc.

I found a walk through from someone online using Nut with a UPS using exact same semiconductor as my Tescom - so thought it should work no problem - used Blazer USB drivers. But I hit a new problem which he did not - something about drivers stopping as could not bind. Used one other driver (HID) and still would not work. Went back to Blazer and found suggestion to specify product ID in a udev file. Now already I am in over my head with Linux - but followed instructions and then tried to restart Drivers - got a completely new error message - if memory serves saying could not find exact UPS in conf and I should try using product ID and sub driver. Now I am totally lost as I have set up the ups.conf file in Nut correctly.

100% yes I am orsome1 on forums - need to try solve this and most definitely need help doing as I am a new convert to Linux. Have also gone back to company where I bought UPS to try see if they can help with the supplied software - still waiting.
 

Tinuva

The Magician
Joined
Feb 10, 2005
Messages
8,659
When trying to set up UPS, using the blazer driver, were you running it as your normal ubuntu user with or without sudo infront of the commands?
 

NWI

Active Member
Joined
Oct 27, 2008
Messages
94
you hit the nail on the head, ran driver startup with sudo and worked - awesome thanks.

Started Nut service and got full comms. However may I ask a few things:
ups.delay.shutdown: 30
ups.delay.start: 180
ups.load: 4
ups.productid: 5161
ups.status: OL

above is what I see with a UPSC command

Will NUT now automatically shut down my server and all open applications? or do I need to set this up separately?
The delay shutdown value of 30 above, is that 30 seconds, 30 minutes or 30% of remaining UPS battery power?
How do I change this delay shutdown value to say 60 seconds.
 

Tinuva

The Magician
Joined
Feb 10, 2005
Messages
8,659
I think it is seconds.

The correct way to start it up, is making sure the service is set to start on levels 3 4 5 inside upstart.

That said, I think maybe you should link us the guide you used to set up NUT, just so that we have an idea where you are at.

For example, something like this: http://zackreed.me/articles/77-installing-nut-on-ubuntu-12-04

That starts up the service, but it wasn't enabled in the guide, unless it is enabled by default on install.

One way to test is, reboot, and check you you can see the status of the UPS without starting the driver manually.


I believe that is seconds, so UPS will wait 30 seconds to turn off the power after the turn off signal was sent by NUT to the ups. This is, to give the pc time to shutdown, and hopefully by the time the UPS turns off the output power, the pc finished the shutdown process. Then when the input power from the wall is back, the UPS will wait 180 seconds or 5 minutes to just be sure power really is back and stable, then it will turn on the output power to the pc. Have your pc set to automatically turn on when power is back on in the bios.

Ps. that 30 seconds is not how long the ups wait to shutdown after the power went out. That trigger is rather something like when battery level is low, then pc will shutdown and send a shutdown command to the ups at which time the ups will wait 30 seconds.
 

NWI

Active Member
Joined
Oct 27, 2008
Messages
94
ok there you have lost me with " set to start on levels 3 4 5 inside upstart"

I used that exact link you mentioned as well as - http://ubuntuforums.org/showthread.php?t=2047925
I rebooted the server without restarting anything then ran a upsc and all my ups details were displayed. I therefore assume everything runs auto on startup including drivers.

I understand that the shutdown signal is sent from low battery warning and you confirm that it is 30 seconds from this point. This is what I want to change as I want it something like 60 seconds from on battery time. I dont need the UPS to hold the server up as I have a back up generator. I require the UPS to hold power up when power drops and then immediately to initiate server shut down

I ran a upsmon -c fsd and it initiated an immediate shut down - again then assume that the settings are all correct just need to change the flag that starts the shutdown.
 
Last edited:

Tinuva

The Magician
Joined
Feb 10, 2005
Messages
8,659
Ok it sounds like it works from boot as it should, don't worry about the run levels.

As for having it shutdown 60 seconds as soon as it is on battery, this should work:
post #6 at http://forums.contribs.org/index.php?topic=44443.0

I believe some paths may be different to what you have, but it sounds like this is what you want:
AT ONBATT * START-TIMER shutdownnow 60
 

NWI

Active Member
Joined
Oct 27, 2008
Messages
94
I did find that post and tried to follow, however I could not follow some of the instructions based on my starter knowledge of linux.
I created the template and CD into that directory, but how do you create a file and what sort of file does it need to be?
This would be for both the NOTIFYCMD and 01CONFIG sections.
But what I dont understand is they instruct to CD to the cd /etc/e-smith/templates-custom/etc/ups/upssched.conf file and then create this new file - surely you have to create file in a directory whereas above CD is to the upssched.conf file?

then they say create a script file - which I also could not work out how to do

as you can notice I have no programming background so this really is a new language
 

ponder

Honorary Master
Joined
Jan 22, 2005
Messages
76,592
Just open your text editor with sudo or 'open as root' whatever and paste the contents they post in the code window to it then save it to the folder with the file name they specify.
ie. /etc/e-smith/templates/etc/ups/upsmon.conf/ is the folder and NOTIFYCMD is the file name.
Do this for each file.
 

Speedster

Executive Member
Joined
May 2, 2006
Messages
7,670
I have recently acquired a Tescom 1200VA UPS and am trying to get nut set up on it so that I can initiate shutdown when the power cuts. So far I've managed to install nut (sudo apt-get install nut), set the mode to standalone in /etc/nut/nut.conf and edited /etc/nut/ups.conf by adding

[myups]
driver = blazer_usb
port = auto
productid = 0000
desc = "Tescom 1200VA"

Output from sudo upsdrvctl start:
Network UPS Tools - UPS driver controller 2.7.4
Network UPS Tools - Megatec/Q1 protocol USB driver 0.12 (2.7.4)
Supported UPS detected with megatec protocol
Vendor information unavailable
No values provided for battery high/low voltages in ups.conf
Using 'guestimation' (low: 20.800000, high: 26.000000)!
Battery runtime will not be calculated (runtimecal not set)

Ouput from sudo upsc myups:
Init SSL without certificate database
Error: Driver not connected

Anyone know what I'm doing wrong?
 
Top