Several months ago I posted some information on the cable to connect a Compaq T2400h to a standard serial port. This weekend I finally got around to trying out the information that I found. I now have the 2.4KVA UPS at the bottom of my rack cabinet talking to my Ubuntu-based fileserver, boron.
The first step was to create the cable. This requires a 9 pin female ‘D’ connector and a matching male connector. For the cable I used an offcut of CAT5, though normally serial cables do not use twisted pair (usually just parallel wires).
The software part is done using NUT, for which there is a package included in the Ubuntu distribution. This software talks to the UPS, monitors it’s status and allows other computers to check the status. The monitoring applications are then responsible for shutting down the computers attached to the UPS should power fail and the battery become critical. So far this is just boron and my Windows machine, aluminium. The latter uses WinNUT to shut down Windows when needed.
There were a few problems getting NUT to work with Ubuntu. First off, the package doesnt put any configuration files in the /etc/nut path, so I had to go hunt for the examples and copy then modify them. The next problem was with permissions for the serial port. For testing purposes I tried running the protocol module as root, but this introduced different permissions problems. The solution was to add the ‘nut’ user to the ‘dialout’ group, which is one group that has access to the serial ports. To my relief this got everything working.
These are the parameters that I can access over the serial connection:
simon@boron:~$ upsc compaq@boron
ups.model: UPS 2400 VA FW -0023
ups.status: OL TRIM
These are the resources that I used to get the UPS/NUT combo working: