By Paulie-Oracle on Jul 28, 2008
One of the best consumer UPS manufacturer on the market is APC. They make great products that can interface nicely with any UNIX-based system, whether it be Linux, BSD, or Solaris. Using their daemon (apcupsd), you can download the source and create a nice link-up with your UPS so you can be notified anytime your power goes out (or if you accidentally unplug it)
My home model is the APC ES550 which is USB-based and has a weird USB->RJ45 cable to link a computer with the UPS. Let me explain how to get this running with OpenSolaris with at least this model.
First you will need the latest apcupsd tarball located on Source Forge. Then, follow some standard compiling directions:
$ tar zxvf apcupsd-3.14.4.tar.gz && cd apcupsd-3.14.4 $ ./configure --enable-usb $ make # make installIf your model is USB-based, you need the enable-usb flag with the configure script. Now when you make, however, it will most likely fail with the following error.
libusb.h:9:34: /usr/sfw/include/usb.h: No such file or directory ... lots of errors ...
'make' fails on OpenSolaris because by default it is missing a usb.h header file located in /usr/sfw/include. This can be retrieved by running this command inside that directory as root.
# wget http://src.opensolaris.org/source/raw/sfw/usr/src/lib/libusb/inc/usb.hBinaries are stored inside /etc/opt/apcupsd/sbin.
The file apcupsd.conf is needed to configure this USB device. Two lines that say the following must be included in this file.
UPSCABLE usb UPSTYPE usbDelete any other UPSCABLE/UPSTYPE lines. The apcupsd.conf file documents other types of APC UPS devices as well, usually those that rely on serial as opposed to usb.
Now, you should be able to run the daemon and you can verify that it will notify you by simply pulling the plug on the UPS. If you modify your root alias in /etc/mail/aliases the UPS will send you an e-mail when the power goes out. This sounds handy if I'm campus and I lose the electricity in my apartment, so I'll have plenty of time to power off my machine remotely.