Well, I decided I might as well have to do a complete reset now rather than after there is lots of data on the NAS if the experiment to install apcupsd through ipkg fails. So following Don's lead, I decided to give it a try, and it didn't fail. As I still haven't found a step-by-step guide to this, here's what I did.
1 ) Log onto NAS web interface as admin and navigate to APPLICATIONS > QPKG plugins, click [GET QPKG]
on installation tab.
2 ) new window opens, click on 'Optware IPKG (Itsy Package Management System)'
3 ) at bottom of package, select correct link for your architecture (for me: Intel x86 [TS-x39 series/ x59 Series/ 509/ 809/ 809U-RP/ SS-439/ 839]) and save the file to some location on your PC.
4 ) unzip the downloaded file on your PC.
5 ) in web admin APPLICATIONS > QPKG plugins click on INSTALLATION tab
6 ) as instructed there, browse to the location where the unzipped file is, and then click [INSTALL]
7 ) after installation is complete, time to shift to console mode...
8 ) PuTTY into the NAS as admin; you'll find that ipkg is in the path and has been installed in [/opt/bin/ipkg]. Also, /opt is a symbolic link to the NAS volume: '# ls -alF /opt' gives:
lrwxrwxrwx 1 admin administ 29 Jan 19 19:39 /opt -> /share/MD0_DATA/.qpkg/Optware/
9 ) type 'ipkg help' to see what you can do with ipkg
10 ) type 'ipkg update' to download a current list of what is currently available:
Code: Select all
[/opt] # ipkg update
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ts509/cross/unstable/Packages.gz
Inflating http://ipkg.nslu2-linux.org/feeds/optware/ts509/cross/unstable/Packages.gz
Updated list of available packages in /opt/lib/ipkg/lists/ts509
Successfully terminated.
11 ) you can type 'ipkg list' to see what is available
12 ) here goes (take deep breath and do the apcupsd ipkg install) ...
Code: Select all
[/sbin] # ipkg install apcupsd
Installing apcupsd (3.14.5-2) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ts509/cross/unstable/apcupsd_3.14.5-2_i686.ipk
Configuring apcupsd
Successfully terminated.
[/] # find . | fgrep apcupsd
./etc/apcupsd
./etc/apcupsd/apcupsd.conf
./etc/apcupsd/apccontrol
./sbin/apcupsd
./share/MD0_DATA/.qpkg/Optware/etc/apcupsd
./share/MD0_DATA/.qpkg/Optware/etc/apcupsd/onbattery
./share/MD0_DATA/.qpkg/Optware/etc/apcupsd/multimon.conf
./share/MD0_DATA/.qpkg/Optware/etc/apcupsd/apccontrol
./share/MD0_DATA/.qpkg/Optware/etc/apcupsd/commfailure
./share/MD0_DATA/.qpkg/Optware/etc/apcupsd/changeme
./share/MD0_DATA/.qpkg/Optware/etc/apcupsd/apcupsd.conf
./share/MD0_DATA/.qpkg/Optware/etc/apcupsd/commok
./share/MD0_DATA/.qpkg/Optware/etc/apcupsd/offbattery
./share/MD0_DATA/.qpkg/Optware/etc/apcupsd/hosts.conf
./share/MD0_DATA/.qpkg/Optware/lib/ipkg/info/apcupsd.control
./share/MD0_DATA/.qpkg/Optware/lib/ipkg/info/apcupsd.conffiles
./share/MD0_DATA/.qpkg/Optware/lib/ipkg/info/apcupsd.list
./share/MD0_DATA/.qpkg/Optware/share/man/man8/apcupsd.8
./share/MD0_DATA/.qpkg/Optware/share/hal/fdi/policy/20thirdparty/80-apcupsd-ups-policy.fdi
./share/MD0_DATA/.qpkg/Optware/sbin/apcupsd
./tmp/apcupsd.pid
- note 1: The original (2004) apcupsd was in /sbin. The ipkg installed apcupsd is in /opt/sbin. So, it looks like one of my fears - that this process will overwrite old apcupsd - was unwarranted [ED: confirmed by Don in a subsequent PM].
- note 2: the apcupsd.ipkg downloaded for me is from
http://ipkg.nslu2-linux.org/feeds/optwa ... 2_i686.ipk ... I closed my eyes as I saw the 'unstable' in that path name and just pressed forward because Don said it would work
)
13 ) copy the /opt/etc/apcupsd/apcupsd.conf file to apcupsd.conf.org so it is retained in case you goof up later and need to start modifying it from scratch.
14 ) edit this apcupsd file (I used vi; it is amazing that 12 years later, I could remember i(insert to type), [ESC] get back to cursor control, dd(delete line), w(write file), q(quit), but I did what was needed. Key changes I made to the file to work with attached USB APC Backup-XS 1300 LCD:
Code: Select all
#UPSCABLE smart
UPSCABLE usb
#UPSTYPE apcsmart
#DEVICE /dev/ttyS0
UPSTYPE usb
I also changed some of the timing parameters, but that's just a matter of choice.
15 ) the first time I tried starting the apcupsd daemon, it immediately failed. I went to look at the log in the director (per above) only to find the directory did not exist. I went through the apcupsd.conf file again to see where the various directories should be and made the ones it referenced that didn't currently exist (from within /opt directory):
Code: Select all
[/opt] # mkdir var
[/opt] # mkdir var/lock
[/opt] # mkdir var/log
16 ) start the apcupsd daemon: [/opt] # /opt/sbin/apcupsd &
This time it didn't immediately exit (yeah!) as it did when those directories didn't exist.
17 ) verify that it is still running (paranoid?)
[/opt/var/log] # ps -aux | fgrep apcupsd
19820 admin 748 S /opt/sbin/apcupsd
20088 admin 448 R fgrep apcupsd
18 ) see if it will talk to us:
Code: Select all
/opt/var/log] # apcaccess status
APC : 001,038,0974
DATE : Tue Jan 19 21:50:49 EST 2010
HOSTNAME : 219NAS
RELEASE : 3.14.5
VERSION : 3.14.5 (10 January 2009) unknown
UPSNAME : 219NAS_APCBackup-XS1300LCD
CABLE : USB Cable
MODEL : Back-UPS XS 1300 LCD
UPSMODE : Stand Alone
STARTTIME: Tue Jan 19 21:48:38 EST 2010
STATUS : ONLINE
LINEV : 119.0 Volts
LOADPCT : 29.0 Percent Load Capacity
BCHARGE : 100.0 Percent
TIMELEFT : 20.3 Minutes
MBATTCHG : 50 Percent
MINTIMEL : 5 Minutes
MAXTIME : 120 Seconds
SENSE : High
LOTRANS : 088.0 Volts
HITRANS : 136.0 Volts
ALARMDEL : Always
BATTV : 26.9 Volts
LASTXFER : Unacceptable line voltage changes
NUMXFERS : 0
TONBATT : 0 seconds
CUMONBATT: 0 seconds
XOFFBATT : N/A
SELFTEST : NO
STATFLAG : 0x07000008 Status Flag
MANDATE : XXXX-XX-XX
SERIALNO : XXXXXXXXXXXX
And it is 3.14.5 (THANK YOU Don)
19 ) The only thing left to do on the NAS side is figure out how to start this daemon after restart without having to PuTTY in each time, and possibly dodge some problems with the disks not being ready when the script tries to run (my config keeps disks AES locked until I manually unlock them, so /opt won't be available on boot). Will dig into Don's reference guide tomorrow on this.
20 ) To install the client that will listen on the PC side, obtain it here:
http://www.apcupsd.com/. Lots of good stuff there, including a manual. Basic changes that need to be made to the PC apcupsd.config file are:
Code: Select all
#UPSCABLE usb
UPSCABLE ether
#UPSTYPE usb
#DEVICE
UPSTYPE net
DEVICE xxx.xxx.xxx.xxx:3551 (xxx.xxx.xxx.xxx = IP of your NAS)
You'll find nice links for starting/stopping and editing the apcupsd.config file installed in the Start > Programs > Apcupsd section under WinXP.
At the moment, all seems to be working. I don't have time to run the 'pull the plug' test at the moment, but I'll do that in the next day or two and let you know of any unexpected surprises.
Thanks to Don for giving me the confidence to give this a try with an end product that was what I was looking for.