Wednesday, July 3, 2013

APCUPSD


I have an APC Back-UPS XS 1500. I bought a new battery for it anticipating using it for my router, cable modem, and microserver. All these devices are pretty low power, and given that its got 1500W, it should provide quite a bit of run-time. While it would be possible to just let the peripherals run the UPS dry and then crash themselves out, I wanted the microserver to be able to exit gracefully into a power-off state. So, I need to install either NUT, or APCUPSD. I decided on the latter. 

I found a great tutorial here:

There were a couple niggles, first I had to get a copy of sunlibusb and sunlibusbgen (off an outdated ISO file that was hosted in the UK and was 3.6GB in size). Once I had said packages installing them was trivial.

Second I had to get my UPS to use the generic USB driver, instead of the HID driver. That required some googling.

One user here found the solution, but I actually found this more in-depth explanation first.

First up I had to change the driver [OmniOS] allocated to this device from a HID driver to a UGEN
1. Run #prtconf -v and look for your usb device – I dumped this into a text file and searched for [“Back-UPS” or "1500" since I have a model XS-1500]
2. Remove the ugen driver from memory #rem_drv ugen
3. Force the device to load with the ugen driver (find the address of the usb device from step 1)
#add_drv -i ‘”usb51d,2.106″‘ -m ‘* 0666 root sys’ ugen
4. Done – check the device is a ugen device either through #prtconf -D or #dmesg | grep ugen
Second, I had to configure /etc/apcupsd/apcupsd.conf, and then start the service.
1) After you make install, you need to first configure a couple settings in /etc/apcupsd/apcupsd.conf … there are plenty of examples on the web.
2) you need to start the daemon before you can test its status (last step of this tutorial).
# /etc/init.d/apcupsd start
# /etc/init.d/apcupsd status
I am running apcupsd-3.4.10 on OmniOS stable with an APC Back-UPS XS-1500
Of note, you can run #/etc/init.d/apcupsd status to make sure the service is up, but if you want to run 
#/usr/local/sbin/apctest
you need to STOP the service first.

Lets hope that apcupsd auto-starts on restart

No comments:

Post a Comment