LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 09-02-2009, 02:47 PM   #1
rulet1
LQ Newbie
 
Registered: Jun 2009
Posts: 29

Rep: Reputation: 15
About making work APC Back UPS - 525


Anybody have this device working under Ubuntu 9.04?
I meen correct shutdown when power is disappeared.
I had no luck with configuration of this UPS, anybody knows how to configure that when power is loss computer was correctly shutdown?
 
Old 09-02-2009, 08:29 PM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Wheezy (Fluxbox WM)
Posts: 1,363
Blog Entries: 52

Rep: Reputation: 353Reputation: 353Reputation: 353Reputation: 353
You would use either apcupsd or nut.
 
Old 09-03-2009, 10:36 AM   #3
cgtueno
Member
 
Registered: Jul 2003
Posts: 356
Blog Entries: 1

Rep: Reputation: 49
Hi

I suggest that you take a look at:
www.networkupstools.org

Regards

Chris
 
Old 09-03-2009, 12:57 PM   #4
rulet1
LQ Newbie
 
Registered: Jun 2009
Posts: 29

Original Poster
Rep: Reputation: 15
Because I have no luck with apcupsd, I have installed nut, what is the next step?
 
Old 09-03-2009, 03:01 PM   #5
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Wheezy (Fluxbox WM)
Posts: 1,363
Blog Entries: 52

Rep: Reputation: 353Reputation: 353Reputation: 353Reputation: 353
There are quite a few documents on the nut website, including a comprehensive readme. Because the setup is not trivial, it is worth understanding how the system works before attempting this.

Here is one setup example (for a PowerWare 3105 connected to a Debian box). With the newer version of nut, much of this is automated.

1. Install the nut package.

Code:
apt-get install nut
2. Edit the file /etc/nut/ups.conf and put in a section for your UPS (note that your driver setup is likely to be different to this):

Code:
[pw3105]
   driver = bcmxcp_usb
   port = auto
3. Start the UPS driver:

Code:
upsdrvctl start
4. Edit the file /etc/nut/upsd.conf and specify which machines will be able to access the ups information server (in this example, only the localhost):

Code:
ACL all 0.0.0.0/0
ACL localhost 127.0.0.1/32
ACCEPT localhost
REJECT all
5. Edit the file /etc/nut/upsd.users and specify that this is the master machine, and the password:

Code:
[nut]
   password = abc123
   allowfrom = localhost
   upsmon master
6. Edit the file /etc/nut/upsmon.conf, and specify the power actions:

Code:
POWERDOWNFLAG /etc/killpower
MONITOR pw3105@localhost 1 nut abc123 master
SHUTDOWNCMD "/sbin/shutdown -h +0"
7. Make sure the permissions are set for the nut files (particular those with passwords):

Code:
chown nut:nut /etc/nut/*
chmod 640 /etc/nut/upsd.users /etc/nut/upsmon.conf
8. Start the UPS information server and monitor

Code:
upsd
upsmon
9. Check the UPS status:

Code:
upsc pw3105@localhost ups.status
10. Edit the file /etc/default/nut and make sure that the UPS information server and monitor will be started by default on power up:

Code:
START_UPSD=yes
START_UPSMON=yes
11. There are many client applications to monitor the UPS status via nut. For example, there is the windowmaker panel 'wmnut' (probably not appropriate for an Ubuntu install):

Code:
apt-get install wmnut
wmnut -w

Last edited by neonsignal; 09-05-2009 at 02:21 AM.
 
Old 09-04-2009, 03:05 AM   #6
rulet1
LQ Newbie
 
Registered: Jun 2009
Posts: 29

Original Poster
Rep: Reputation: 15
Thank you.

[nut]
password = abc123
allowfrom = localhost
upsmon master

The password is the root password or any password?
And how to known which driver is to put in the /etc/nut/ups.conf?

Last edited by rulet1; 09-04-2009 at 03:07 AM.
 
Old 09-04-2009, 07:03 AM   #7
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Wheezy (Fluxbox WM)
Posts: 1,363
Blog Entries: 52

Rep: Reputation: 353Reputation: 353Reputation: 353Reputation: 353
Quote:
The password is the root password or any password?
The password is any password. It is used by the upsmon to be able to access the upsd (so the password in the two config files must match).

Quote:
And how to known which driver is to put in the /etc/nut/ups.conf?
The nut website has a list of drivers and the UPS systems to which they correspond.

It is a little hard for the APC power supplies, because APC seem to rebrand a variety of underlying hardware. Also, different drivers take different parameters.

My best guess is that yours is the ES series, and will take the usbhid-ups driver, but it is only a guess. If you can get more information from the compliance label, it may help you to search for comparable systems. If it is the usbhid-ups driver, the driver file will be something like this:

Code:
[apc]
   driver = usbhid-ups
   port = auto
   desc = "APC525"
 
Old 09-05-2009, 02:00 AM   #8
rulet1
LQ Newbie
 
Registered: Jun 2009
Posts: 29

Original Poster
Rep: Reputation: 15
After editing file /etc/nut/ups.conf and giving a command updrvctl start I've got this:

r@NGF:~$ sudo updrvctl start
sudo: updrvctl: command not found
r@NGF:~$

So what that could mean, the UPS is Back-UPS ES 525, and I puted this

[apc]
driver = usbhid-ups
port = auto
desc = "APC525"

in the file /etc/nut/ups.conf

Last edited by rulet1; 09-05-2009 at 02:01 AM.
 
Old 09-05-2009, 02:06 AM   #9
rulet1
LQ Newbie
 
Registered: Jun 2009
Posts: 29

Original Poster
Rep: Reputation: 15
I gess this was your mistake it should be command:

upsdrvctl start

but after that command I'got this:
Quote:
r@NGF:~$ sudo upsdrvctl start
Network UPS Tools - UPS driver controller 2.4.1
Network UPS Tools - Generic HID driver 0.34 (2.4.1)
USB communication driver 0.31
Can't chdir to /var/run/nut: No such file or directory
Driver failed to start (exit status=1)
I guess this because of permission rules... May be the steps should be in a different way. I'll try later...

Last edited by rulet1; 09-05-2009 at 02:07 AM.
 
Old 09-05-2009, 02:26 AM   #10
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Wheezy (Fluxbox WM)
Posts: 1,363
Blog Entries: 52

Rep: Reputation: 353Reputation: 353Reputation: 353Reputation: 353
Sorry about the typo, I have fixed it up in the instructions above.

Not sure why the permissions on /var/run/nut are not working. Perhaps try:

Code:
sudo chmod 770 /var/run/nut
The owner should be root, and the group should be nut.

Last edited by neonsignal; 09-05-2009 at 02:27 AM.
 
Old 09-05-2009, 12:06 PM   #11
rulet1
LQ Newbie
 
Registered: Jun 2009
Posts: 29

Original Poster
Rep: Reputation: 15
The thing is that /var/run/nut directory doesn't exist...
But there is /var/lib/nut for example, what is your advise?

Last edited by rulet1; 09-05-2009 at 12:10 PM.
 
Old 09-05-2009, 01:02 PM   #12
rulet1
LQ Newbie
 
Registered: Jun 2009
Posts: 29

Original Poster
Rep: Reputation: 15
The strange thing -- when after all this I have again installed and removed apcupsd, and then again installed nut it gives me:

r@NGF:~$ sudo upsdrvctl start
Network UPS Tools - UPS driver controller 2.4.1
Network UPS Tools - Generic HID driver 0.34 (2.4.1)
USB communication driver 0.31
Can't claim USB device [051d:0002]: could not detach kernel driver from interface 0: Operation not permitted
Driver failed to start (exit status=1)
r@NGF:~$

Last edited by rulet1; 09-05-2009 at 01:12 PM.
 
Old 09-05-2009, 01:12 PM   #13
rulet1
LQ Newbie
 
Registered: Jun 2009
Posts: 29

Original Poster
Rep: Reputation: 15
I see! ) It was just needed to reboot a computer after editing /etc/nut/ups.conf and then:
Quote:
r@NGF:~$ sudo upsdrvctl start
[sudo] password for r:
Network UPS Tools - UPS driver controller 2.4.1
Network UPS Tools - Generic HID driver 0.34 (2.4.1)
USB communication driver 0.31
Using subdriver: APC HID 0.93
r@NGF:~$
Then all steps until 8:

Quote:
r@NGF:~$ sudo upsd
Network UPS Tools upsd 2.4.1
/etc/nut/upsd.conf is world readable
ACL in upsd.conf is no longer supported - switch to LISTEN
ACL in upsd.conf is no longer supported - switch to LISTEN
ACCEPT in upsd.conf is no longer supported - switch to LISTEN
REJECT in upsd.conf is no longer supported - switch to LISTEN
not listening on 127.0.0.1 port 3493
r@NGF:~$ upsmon
Network UPS Tools upsmon 2.4.1
Can't open /etc/nut/upsmon.conf: Permission denied
r@NGF:~$ sudo upsmon
Network UPS Tools upsmon 2.4.1
Using power down flag file /etc/killpower

UPS: apc@localhost (master) (power value 1)
r@NGF:~$
And:

Quote:
r@NGF:~$ sudo upsc apc@localhost ups.status
OL
And:

Quote:
r@NGF:~$ sudo apt-get install wmnut
Чтение списков пакетов... Готово
Построение дерева зависимостей
Чтение информации о состоянии... Готово
Следующие пакеты устанавливались автоматически и больше не требуются:
insserv librecode0 apcupsd-doc
Для их удаления используйте 'apt-get autoremove'.
НОВЫЕ пакеты, которые будут установлены:
wmnut
обновлено 0, установлено 1 новых пакетов, для удаления отмечено 0 пакетов, и 0 пакетов не обновлено.
Необходимо скачать 24,2kБ архивов.
После данной операции, объём занятого дискового пространства возрастёт на 119kB.
Получено:1 http://ua.archive.ubuntu.com jaunty/universe wmnut 0.62-4 [24,2kB]
Получено 24,2kБ за 0s (50,8kБ/c)
Выбор ранее не выбранного пакета wmnut.
(Чтение базы данных... на данный момент установлено 128418 файлов и каталогов.)
Распаковывается пакет wmnut (из файла .../archives/wmnut_0.62-4_i386.deb)...
Обрабатываются триггеры для man-db ...
Настраивается пакет wmnut (0.62-4) ...
r@NGF:~$ sudo wmnut -w
localhost: apc
Actually a did all steps but after reboot UPS in not connected:
Quote:
r@NGF:~$ sudo upsd
[sudo] password for r:
Network UPS Tools upsd 2.4.1
/etc/nut/upsd.conf is world readable
ACL in upsd.conf is no longer supported - switch to LISTEN
ACL in upsd.conf is no longer supported - switch to LISTEN
ACCEPT in upsd.conf is no longer supported - switch to LISTEN
REJECT in upsd.conf is no longer supported - switch to LISTEN
listening on 127.0.0.1 port 3493
listening on ::1 port 3493
Can't connect to UPS [apc] (usbhid-ups-apc): No such file or directory
allowfrom in upsd.users is no longer used
r@NGF:~$ sudo upsmon
Network UPS Tools upsmon 2.4.1
Using power down flag file /etc/killpower

UPS: apc@localhost (master) (power value 1)

Широковещательное сообщение от nut@NGF
(somewhere) at 22:01 ...

Communications with UPS apc@localhost lost


Широковещательное сообщение от nut@NGF
(somewhere) at 22:01 ...

UPS apc@localhost is unavailable
As I understood I have to add driver of UPS when loading of Ubuntu...
I have to find how to do that.

BUT even when I started driver and monitor manually and... turned off the computer from wall outlet the UPS haven't respond and computer turned off immediately, so APC still doesn't respond, that's bad.

Last edited by rulet1; 09-05-2009 at 02:26 PM.
 
Old 09-25-2009, 10:31 AM   #14
rulet1
LQ Newbie
 
Registered: Jun 2009
Posts: 29

Original Poster
Rep: Reputation: 15
: Seems like one of the most important thing for saving files doesn't work in Linux...
Nobody uses UPS
 
Old 09-25-2009, 11:27 AM   #15
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,826

Rep: Reputation: 727Reputation: 727Reputation: 727Reputation: 727Reputation: 727Reputation: 727Reputation: 727
If the computer powers off immediately when you pull the UPS plug then either there is something wrong with the UPS or the computer is plugged into a surge protected outlet only. I have never played with NUT so I can not answer if you have a configuration problem.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
APC UPS w/ USB signal cable - work in Linux? sirpimpsalot Linux - Hardware 5 06-21-2010 08:24 AM
apc Back-ups 650 a10392 Linux - Software 1 12-03-2004 10:51 AM
apc Back-ups a10392 Debian 1 12-03-2004 10:24 AM
USB Support for APC Battery back up UPS gway600 Linux - Hardware 2 08-06-2004 08:59 PM
Wierd problem with APC Back-UPS ES500 jtshaw Linux - Hardware 0 01-10-2004 09:39 AM


All times are GMT -5. The time now is 09:55 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration