Caauwe Family Website Family Connection
Website Setup, UPS Monitor...
Follow the instructions below to install the software to monitor the Uninterrupted Power Supply (UPS).  There are 2 different packages with Debian (Etch) that I've used.  The 'NUT' package is more versatile and can be used for most power supplies - but is more difficult to understand and configure.  The 'APCUPSD' package is for APC power supplies only, but is more easy to understood and configure.  The information below is one example for each package - your configuration may be different.  The 'NUT' example is followed by the 'APCUPSD' example.
  1. Login the server as root.
  2. Type: apt-get install nut
  3. When requested, enter 'y' to continue the installation.
  4. If needed, install the requested Debian CD and press enter.
  5. If the UPS is connected to a USB port, Type: apt-get install nut-usb
    When requested, enter 'y' to continue the installation.
  6. Type: cp /usr/share/doc/nut/examples/* /etc/nut
  7. Type: cd /etc/nut
  8. Type: gunzip ./upsmon.conf.gz
  9. Type: chown nut ./*
  10. Type: chgrp nut ./*
  11. Both Web & DNS servers share the same UPS supply.  Review the changes to the configuration files listed below.
  12. To query the status of the ups supply from the primary, type: upsc web_servers@localhost
    To query the status of the ups supply from the secondary, type: upsc web_servers@fc2.caauwe.com
Filename: /etc/nut/ups.conf
This file contains the description of the UPS supply connected directly to the USB port.  The example below is for the fc2 server.
[web_servers]
    driver = newhidups
    port = /dev/usb/hiddev0
    desc = "Web Servers"
Filename: /etc/nut/upsd.conf
This file contains the IP addresses that may communicate with the upsd server.  The example below is for the fc2 server.
ACL all 0.0.0.0/0
ACL localhost 127.0.0.1/32
ACL localnet 192.168.0.0/16

ACCEPT localhost
ACCEPT localnet
REJECT all
Filename: /etc/nut/upsd.users
This file contains the user-id and passwords to perform commands.  The example below is for the fc2 server (replacing '<password>' with the password of your choice.
[upsadmin]
    password = <password>
    allowfrom = localhost
    actions = set
    instcmds = all
[upsmaster]
    password = <password>
    allowfrom = localhost
    upsmon master
[upsslave]
    password = <password>
    allowfrom = localnet
    upsmon slave
Filename: /etc/nut/upsmon.conf
This file contains many parameters, but the only command that needs to be added is the 'MONITOR' command.  The passwords are the same as the ones listed in the /etc/nut/upsd.users file.
For server fc1.
MONITOR web_servers@fc2.caauwe.com 1 upsslave <password> slave
For server fc2.
MONITOR web_servers@localhost 1 upsmaster <password> master
Filename: /etc/default/nut
This file indicates what components of nut should be started.  As installed, both 'START_UPSD' and 'START_UPSMON' are set to no.  Depending on the configuration, these values will need to be changed.
For server fc1.
# start upsd
START_UPSD=no

# start upsmon
START_UPSMON=yes

...
For server fc2.
# start upsd
START_UPSD=yes

# start upsmon
START_UPSMON=yes

...
The instructions below are for the 'APCUPSD' package.
  1. Login the server as root.
  2. Type: apt-get install apcupsd
  3. When requested, enter 'y' to continue the installation.
  4. If needed, install the requested Debian CD and press enter.
  5. Modify /etc/apcupsd/apcupsd.conf as needed to match the APC configuration.
  6. Modify /etc/default/apcupsd and change 'ISCONFIGURED" from no to yes.
  7. The configuration can be tested by entering: apcaccess status
  8. The log (located at: /var/log/apcupsd.events) should be reveiwed for any errors.
  9. The manual for this software is located at: apcupsd.org
Filename: /etc/apcupsd/apcupsd.conf
This file contains the configuration of the UPS supply connected directly to the serial or USB port.  Your configuration may be different.
# UPSCABLE <cable>
    ...
UPSCABLE smart

    ...
UPSTYPE usb

    ...
Filename: /etc/default/apcupsd
This file contains 'ISCONFIGURED' parameter and must be changed from 'no' to 'yes' the indicate that the UPS has been configured.
# Apcupsd-devel internal configuration

APCACCESS=/sbin/apcaccess
ISCONFIGURED=yes