apcupsd

on

apc_ups

Our housekeeper likes to pull plugs for vacuumcleaning (oh sorry yeah I forgot) especially the one which powers our nasses.  Besides these personal accidents, last year one of the harddisks got damaged through a very short power outage (just a fraction of a second). So to protect my nasses from these power interruptions, I bought a fully linux supported ups, a “APC Power-Saving Back-UPS Pro 900”.

Before pluging the device insert the batteries as mentioned in the manual. After this I plugged in all the cables, including a usb cable to my nas.


Installation

I installed 2 packages: apcupsd and apcups-cgi. The first handles the communication between ups and nas, the latter is for showing statistics in a webinterface.

$sudo apt-get install apcupsd apcupsd-cgi

A test can now be performed:

$sudo apctest

 

Configuartion

Now the device needs to be configured:

$sudo vi /etc/apcupsd/apcupsd.conf

and edit a few lines:

change the line:
UPSCABLE smart
into
UPSCABLE usb

Change the lines:
UPSTYPE apcsmart
DEVICE /dev/ttyS0
into
UPSTYPE usb
#DEVICE /dev/ttyS0

(ie commenting the DEVICE line).

And at last change the line:
NISIP 127.0.0.1
into
NISIP 0.0.0.0
Now the web interface can be shown from outside the machine (the nas itself is headless).

<ESC>:wq

Now the deamon needs to be started at boot time, edit:

$vi /etc/default/apcups

change the line:
ISCONFIGURED=no
into
ISCONFIGURED=yes

<ESC>:wq

Now the daemon can be started by:

$sudo service apcupsd start

 

Webinterface

This webinterface assumes an installation of apache2. With the cgi module enabled:

$sudo a2enmod cgi
$sudo service apache2 restart

The webinterface can be accessed by entering:
http://<nas url>/cgi-bin/apcupsd/multimon.cgi
and selection the nas (only 1 in my case) shows the statistics:

apc_web