Linux UPS

Device: Inform UPS 600AP (600VA) (untested: 400AP, 500AP, 800AP, 1000AP, 1200AP, 1600AP, 2000AP, 2400AP and 3000AP)

Similar devices / clones: Powercom BLACK KNIGHT PRO BNT-600AP (reference model?), Smartpower SPU-600, Sweex UPS 600 VA, Advice Partner Interactive UPS, Amplicon Value Series VS575C, Trust Power Protection

Connection: Bi-directional serial port communitcation. Standard DB9 male-female cable (included in package). No flow control.

Protocol: powercom with KIN1500AP interface

I've always wanted to protect my servers agains power surges and power outages but never had the funds to get the proper equipment. But early spring time 2005 I saw a special weekend only offer on a Inform UPS unit for not more than 400 NOK (roughly 63 USD). I decided to get two units to protect my small server farm.

A quick look at the specifications showed that Inform supported Windows, Linux and Novell Netware. But it seem that the software they provided, upsmon, was out-dated and closed source with no new releases for 2-3 years. Inform wasn't listed on the NUT compatibility list either.

But when I got the units after 3 days I did some testing with Knoppix and the provided upsmon software didn't really work anymore. The basic shutdown function probably worked but it didn't show the battery level, load or input/output voltage.

I decided to try NUT and find a way to make it function properly. I almost gave up when I googled up upsdisp; the upsmon display client, and found another PowerCom UPS user that used the same program package. That indicated that they probably used the same protocol, thus I only needed to find the driver name and parameters to get it working.

Surely, it worked. Using the powercom driver and type KIN1500AP, all the status fields was polled correctly.

Setup

BIOS

Integrated devices:
Serial ports (COM1): 2Fxxx

Pre-testing

Before continuing make sure you have a working connection between the PC and the UPS. A good way to do this is to just install the software that the manufacturer includes along with the UPS, be it Windows, Linux, etc. Inform is using the UPSMon Plus package for Windows, Linux and Novell. Note that the package is way out-dated.

Kernel

The kernel module for serial ports is configured under the CONFIG_SERIAL_8250 section. You choose if you want to compile it into the kernel or as a module. I compiled it into the kernel.

For Debian Linux, recompile using make-kpgk clean; make kernel-image. And install the resulting deb package.

After rebooting with the UPS still connected via the serial port, check if it's detected successfully: setserial -a /dev/ttyS0. It should output the icq number, line speed, along with some other information.

NUT - Network UPS Tools

A quick summary of NUT: Reliable monitoring of UPS hardware and ensure safe shutdowns of the systems which are connected (directly and in-directly over local networking).

The INSTALL file contains pretty much all you need to get started. Also check the README file. Then I poked around I compiled from source, but when implementing the system I used the latest Debian package in Sarge.

If compiled from source, you need to use man -M /usr/local/ups/man gpsd.conf to read the NUT man pages, or add export MANPATH=/usr/local/ups/man to .bashrc.

Server a.k.a. master

Here's an example of the method I used to find the working driver:

  1. gpsd -f - to verify that index.php the client connect and that the server is running
  2. powercom -x type=KIN1500A /dev/ttyS0 - fire up the driver interface daemon
  3. upsc myups - look for Status: OL (On Line) and when plugged OB (On battery)

When the proper driver is probed and working, you need to edit ups.conf with the driver information, upsd.conf with the network access control list and upsd.users to allow upsmon to connect.

View ups.conf

Nothing special about this file, moving on.

View upsd.conf

In this file you need to add the systems that is physically attached to the UPS so that they can read the status of the UPS (online, battery, critical).

View upsd.users

Only three users is really need in this file; an admin for maintenance, a master user for the system that is directly controlling the UPS and a third slave user for all the systems that is powered by the UPS. Running master means that when the battery is critical it's the last system that goes down. After notifying the slaves to shutdown, it waits 15 seconds for them to disconnect and then shuts itself down.

If you're on Debian you also need to enable the upsd and upsmon daemons in /etc/default/nut.

Clients a.k.a. slaves

On the clients you obviously don't need to run the upsd and driver daemons, only the upsmon. Below is a copy of the upsmon.conf file above with a few edits.

View upsmon.conf on localhost
View upsmon.conf on network client

I changed the upsd server address, the login information, upsmon type to slave and disabled the execute notify variable.

Remember to enable upsmon in /etc/default/nut. Use upsc ups@remote.server.com to verify that everything is set up properly.

References