APC CS 500の設定

環境:CentOS 5.2 x86_64


1, 次のサイトからapcupsdをDL
http://www.apcupsd.com/


2, 適当なディレクトリへ展開
$ tar zxf apcupsd-3.14.4.tar.gz


3, configure
$ cd apcupsd-3.14.4
$ ./configure --enable-usb --enable-gapcmon 2>&1 | tee c.txt

RHEL5だとgtk+のバージョンでエラーに。。gapcmonキャンセルでパス。


4, make
$ make 2>&1 | tee m.txt


5, su - してmake install
# make install 2>&1 | tee mi.txt


6, 次のエラーが。。

# tail -7 mi.txt
RedHat distribution installation
------------------------------------------------------------
error reading information on service apcupsd: Invalid argument
make[3]: *** [install-redhat] Error 1
make[2]: *** [install] Error 2
make[1]: *** [redhat_DIR] Error 2
make: *** [platforms_DIR] Error 2


7, とりあえず、platforms/redhat/Makefileの次の行をコメントアウト

# $(if $(DESTDIR),,$(V)/sbin/chkconfig --del apcupsd)


8, 再度 make install

# make install 2>&1 | tee mi2.txt


9, 正常終了

# tail -3 mi2.txt
COPY 80-apcupsd-ups-policy.fdi => /usr/share/hal/fdi/policy/20thirdparty
doc
COPY apcupsd.man => /usr/share/man/man8/apcupsd.8


10, /etc/apcupsd/apcupsd.confを適宜変更

# egrep ^[a-Z] apcupsd.conf
UPSCABLE usb 
UPSTYPE usb 
DEVICE 
LOCKFILE /var/lock
SCRIPTDIR /etc/apcupsd
PWRFAILDIR /etc/apcupsd
NOLOGINDIR /etc
ONBATTERYDELAY 6
BATTERYLEVEL 5
MINUTES 3
TIMEOUT 60
ANNOY 30
ANNOYDELAY 30
NOLOGON disable
KILLDELAY 0
NETSERVER on
NISIP 0.0.0.0
NISPORT 3551
EVENTSFILE /var/log/apcupsd.events
EVENTSFILEMAX 10
UPSCLASS standalone
UPSMODE disable
STATTIME 0
STATFILE /var/log/apcupsd.status
LOGSTATS off
DATATIME 0


11, モニタリングあれこれ

apcupsdデーモン未動作時は、/sbin/apctest
動作時は、/sbin/apcaccess status
GUIは、/usr/bin/gapcmon