LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Hardware (http://www.linuxquestions.org/questions/linux-hardware-18/)
-   -   About making work APC Back UPS - 525 (http://www.linuxquestions.org/questions/linux-hardware-18/about-making-work-apc-back-ups-525-a-752186/)

rulet1 09-02-2009 02:47 PM

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?

neonsignal 09-02-2009 08:29 PM

You would use either apcupsd or nut.

cgtueno 09-03-2009 10:36 AM

Hi

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

Regards

Chris

rulet1 09-03-2009 12:57 PM

Because I have no luck with apcupsd, I have installed nut, what is the next step?

neonsignal 09-03-2009 03:01 PM

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


rulet1 09-04-2009 03:05 AM

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?

neonsignal 09-04-2009 07:03 AM

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"


rulet1 09-05-2009 02:00 AM

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

rulet1 09-05-2009 02:06 AM

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...

neonsignal 09-05-2009 02:26 AM

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.

rulet1 09-05-2009 12:06 PM

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

rulet1 09-05-2009 01:02 PM

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:~$

rulet1 09-05-2009 01:12 PM

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.

rulet1 09-25-2009 10:31 AM

::) Seems like one of the most important thing for saving files doesn't work in Linux...
Nobody uses UPS

michaelk 09-25-2009 11:27 AM

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.


All times are GMT -5. The time now is 08:34 AM.