jlbhs.gif (6180 バイト) jlb.jp/hsinstall8s/apcupsd3_10

 

TL8S に apcupsd-3.10.11 をインストールする。
 2004/07/03

 

 2004/07/10:upd

 

<凡例>
赤字=入力する文字列
青字=表示される文字列(コンソール画面)
紫字=エディタ等で入力する文字列
緑字=特に強調するコメント等
  使わなくなった古い記述。

 


別ページ( apcupsd  apcupsd2 apcupsd3 apcupsd385 )に apcupsd のインストールを掲載していますが、バッテリィ交換(2004年6月)したのを機会に、最新版を導入してみることにしました。

ほとんど変わりません。 あまり最新版を欲張って少し不具合が出ましたので、その記述が中心となりますが、すぐに解決されることと思います。(私が、英語のマニュアルを読めないからかも知れません)
インストールメモとして掲載しておきます。
対象UPSは、 APC SU 700 です。
また、最新の apcupsd は、 www.apcupsd.com から入手しました。

1.いつもどおりRedHatに化ける。

Turbolinuxでは、RedHat に化ける必要がある(今も必要だと思います)ためにファイルを作ります。


redhat-release というファイルを作ります。
#
touch /etc/redhat-release
vi /etc/redhat-release



ちなみに、今回はカーネル 2.4 ということで、RH8.0用の記述を使いました。

Red Hat Linux release 8.0 (Psyche)      になります。

 

2.以前の apcupsd を削除する。

 

最初は、以前のファイルを削除せず、そのままインストールを実施しましたが、うまくいきません。
そこで、関連するファイルをまず削除しました。

まず最初に apcupsd をストップします。
[root@hs8 cgi-bin]# /etc/rc.d/init.d/apcupsd stop

旧ファイルを削除

[root@hs8 etc]# cd /var/www/cgi-bin/
[root@hs8 cgi-bin]# rm multi*
rm: remove `multimon.cgi'? y
rm: remove `multimoncss.cgi'?
y
[root@hs8 cgi-bin]# rm ups*
rm: remove `upsfstats.cgi'?
y
rm: remove `upsimage.cgi'?
y
rm: remove `upsstats.cgi'?
y
[root@hs8 cgi-bin]# rm apc*
rm: remove `apcupsd.css'? y
[root@hs8 cgi-bin]# rm -rf /etc/apcupsd/
[root@hs8 cgi-bin]#

強制一発削除用に再記述しておきます。

cd /var/www/cgi-bin/
rm -f multi*
rm -f ups*
rm -f apc*
rm -rf /etc/apcupsd/

 

3.最初は apcupsd-3.10.13 をインストールする。(若干の不具合あり)

 


FTPで /usr/local/src/apcupsd31013/ にソースファイルを移す。( apcupsd31013 は任意)
インストールは、 root 権限で以下の作業をしました。

[root@hs8 root]# cd /usr/local/src/apcupsd31013/

[root@hs8 apcupsd31013]# tar zxvf apcupsd-3.10.13.tar.gz

[root@hs8 apcupsd31013]# cd apcupsd-3.10.13


./configure の代わりにいつもの記述( apcupsd3.8.5 まで使用 )を入力すると...


[root@hs8 apcupsd-3.10.13]# CFLAGS="-O2 -Wall" LDFLAGS="-Wall" \
./configure -prefix =/usr -sbindir=/usr/sbin \
--with-cgi-bin=/var/www/cgi-bin --enable-cgi
configure: error: expected an absolute directory name for --prefix: =/usr
[root@hs8 apcupsd-3.10.13]#


どうも --prefix: =/usr でエラーのようです。
そこで、その部分を外して再実行します。

ここで色々な記述を試しました


CFLAGS="-O2 -Wall" LDFLAGS="-Wall" \
  ./configure -sbindir=/usr/sbin \
  --with-cgi-bin=/var/www/cgi-bin --enable-cgi

その他、 /css のディレクトリィ を追加した記述や....

./configure --enable-cgi --with-cgi-bin=/var/www/cgi-bin \
--with-css-dir=/var/www/css 



最終的には、次の記述で正常に働くようです。


./configure --enable-cgi --with-cgi-bin=/var/www/cgi-bin

 


--出力画面--(略)


Configuration on Sat Jul 3 08:24:29 JST 2004:

Host: i686-pc-linux-gnu -- redhat 8.0
Apcupsd version: 3.10.13 (16 April 2004)
Source code location: .
Install binaries: /usr/sbin
Install config files: /etc/apcupsd
Install man files: /usr/man
Nologin file in: /etc
PID directory: /var/run
LOG dir (events, status) /var/log
LOCK dir (for serial port) /var/lock
Power Fail dir /etc/apcupsd
Compiler: gcc 2.96
Compiler flags: -O2 -Wall -Wall
Loader flags: -Wall
Host and version: redhat 8.0
Shutdown Program: /sbin/shutdown
Port/Device: /dev/ttyS0
Network Info Port (CGI): 3551
Master/slave Port: 6666
UPSTYPE smartups
UPSCABLE smart

drivers (no-* are disabled): apcsmart dumb no-net no-usb no-snmp no-test

enable-master-slave:           no
enable-nis:                    yes
with-nisip:                    0.0.0.0
enable-cgi:                    yes
with-cgi-bin:                  /var/www/cgi-bin
with-libwrap:
enable-nls:                    no
enable-libintl:                no
enable-powerflute:             no
enable-pthreads:               yes
enable-dist-install:           yes


[root@hs8 apcupsd-3.10.13]#


make
make install



(省略)
=================================================

apcupsd script installation for RedHat 8.0 complete.

You should now edit /etc/apcupsd/apcupsd.conf to correspond
to your setup then start the apcupsd daemon with:

/etc/rc.d/init.d/apcupsd start

thereafter when you reboot, it will be stopped and started
automatically.

Please check that your halt script in:
/etc/rc.d/init.d/halt
was properly updated (see installation section of manual)

=================================================
make[2]: ここから出ます: ディレクトリ `/usr/local/src/apcupsd31013/apcupsd-3.10.13/platforms/redhat'
Installing apccontrol script...
Found old apccontrol moving it to /etc/apcupsd/apccontrol.orig (cd etc/; /usr/bin/make DESTDIR= install)
make[2]: ここに入ります: ディレクトリ `/usr/local/src/apcupsd31013/apcupsd-3.10.13/platforms/etc'
Installing apcupsd.conf...
Found old apcupsd.conf, installing new file as apcupsd.conf.new
Found old changeme moving it to changeme.orig
Found old commfailure moving it to commfailure.orig
Found old commok moving it to commok.orig
Found old mainsback moving it to mainsback.orig
Found old onbattery moving it to onbattery.orig
make[2]: ここから出ます: ディレクトリ `/usr/local/src/apcupsd31013/apcupsd-3.10.13/platforms/etc'
make[1]: ここから出ます: ディレクトリ `/usr/local/src/apcupsd31013/apcupsd-3.10.13/platforms'
make[1]: ここに入ります: ディレクトリ `/usr/local/src/apcupsd31013/apcupsd-3.10.13/autoconf'
make[1]: `install' に対して行うべき事はありません。
make[1]: ここから出ます: ディレクトリ `/usr/local/src/apcupsd31013/apcupsd-3.10.13/autoconf'
[root@hs8 apcupsd-3.10.13]#

一通り正常に進んで、起動をかけます。

[root@hs8 apcupsd-3.10.13]# apcupsd start

すると、下の画像にありますように、以前はバックカラー(ミドリ色)が付いた画面が、真っ白のバックになっています。
ここで、 css が正常に働いていないようなので、 css スイッチをつけて configure を起動したり、色々やりましたが、解決しません。 

そこで、この apcupsd-3.10.13 はあきらめて、 apcupsd-3.10.11 を使うことにしました。

 

 

 

4. apcupsd-3.10.11 をインストールする。

 

FTPで /usr/local/src/apcupsd31011/ にソースファイルを移す。( apcupsd31011 は任意)
インストールは、 root 権限で以下の作業をしました。

[root@hs8 root]# cd /usr/local/src/apcupsd31011/


 tar ファイルを展開します。
[root@hs8 apcupsd31011]# tar zxvf apcupsd-3.10.11.tar.gz

<<省略>>
apcupsd-3.10.11/src/win32/wintray.h
apcupsd-3.10.11/src/win32/winups.h

[root@hs8 apcupsd31011]#

展開したディレクトリィへ移動して。
[root@hs8 apcupsd31011]# cd apcupsd-3.10.11

コンフィグ
[root@hs8 apcupsd-3.10.11]# ./configure --enable-cgi --with-cgi-bin=/var/www/cgi-bin

<<省略>>

drivers (no-* are disabled): apcsmart dumb no-net no-usb no-snmp no-test

enable-master-slave:         no
enable-nis:                 yes
with-nisip:                 0.0.0.0
enable-cgi:                 yes
with-cgi-bin:               /var/www/cgi-bin
with-css-dir:
with-libwrap:
enable-nls:                 no
enable-libintl:              no
enable-powerflute:           no
enable-pthreads:             yes
enable-dist-install:         yes
[root@hs8 apcupsd-3.10.11]#



次に make そして make install と続けます。

[root@hs8 apcupsd-3.10.11]# make

<<省略>>

[root@hs8 apcupsd-3.10.11]# make install

<<省略>>
# remove old 3.6.2 stuff
# save old halt script
# insert apcupsd script into halt
# link new halt script for startup and shutdown
=================================================

apcupsd script installation for RedHat 8.0 complete.

You should now edit /etc/apcupsd/apcupsd.conf to correspond
to your setup then start the apcupsd daemon with:

/etc/rc.d/init.d/apcupsd start

thereafter when you reboot, it will be stopped and started
automatically.

Please check that your halt script in:
/etc/rc.d/init.d/halt
was properly updated (see installation section of manual)

=================================================
make[2]: ここから出ます: ディレクトリ `/usr/local/src/apcupsd31011/apcupsd-3.10.11/platforms/redhat'
Installing apccontrol script...
(cd etc/; /usr/bin/make DESTDIR= install)
make[2]: ここに入ります: ディレクトリ `/usr/local/src/apcupsd31011/apcupsd-3.10.11/platforms/etc'
Installing apcupsd.conf...
make[2]: ここから出ます: ディレクトリ `/usr/local/src/apcupsd31011/apcupsd-3.10.11/platforms/etc'
make[1]: ここから出ます: ディレクトリ `/usr/local/src/apcupsd31011/apcupsd-3.10.11/platforms'
make[1]: ここに入ります: ディレクトリ `/usr/local/src/apcupsd31011/apcupsd-3.10.11/autoconf'
make[1]: `install' に対して行うべき事はありません。
make[1]: ここから出ます: ディレクトリ `/usr/local/src/apcupsd31011/apcupsd-3.10.11/autoconf'

[root@hs8 apcupsd-3.10.11]#

ここで一気に起動をかけて見ます。

[root@hs8 apcupsd-3.10.11]# apcupsd start
[root@hs8 apcupsd-3.10.11]#

やっといつものトップ画面が出てきました。(ミドリ色のバックカラー)

 

その他、以前の 3.8.5 では、温度記号(度)が文字化けしていましたが、このバージョンからは正常に出るようです。
1台だけ面倒を見るスタンドアロン的使い方ですので、以前のバージョンでも不具合は無かったと思いますが、まったく同じでは変更した意味が無いので良かった??と思います。

以前のステータス画面の温度表示

さらに、 Most recent events: 欄の表示順が逆になり、直近のイベントが上に表示されるようになりました。

 

 

5.apcupsd.conf を設定する。


[root@hs8 apcupsd-3.10.11]#

vi /etc/apcupsd/apcupsd.conf

Smart UPSの場合、下記1箇所の変更をしました。

他は「APC製UPSメモ」サイトを参照するか、初期値のままで OK と思われます。

TIMEOUT 120           (def=0)

6.起動の設定



電源ON時の自動起動の設定ですが、そのままで自動的に起動するようです。

手動での起動は

/etc/rc.d/init.d/apcupsd start  (スタート)
/etc/rc.d/init.d/apcupsd status  ステータス
/etc/rc.d/init.d/apcupsd stop  (ストップ)
です。


上記の記述以外にも  # apcupsd start      でもOKです。 

現在のApcupsd画面見本

 

7.UPSにファンを取り付け冷却する。 (2004/07/10)

      

3.項や4.項に出てくる画像でも出ていますが、 APC SU 700 は相当発熱するようで、以前実験した APC SU 1000 よりも5度C(℃)ぐらい高いように感じていました。


この日は相当暑かった日で、室温は34度ぐらいには上がっていたと思います。
我が家の今の環境では UPS Temp は、室温プラス11度ぐらい上昇するようです。

また、電池の寿命は、20度を基準に10度上がるごとに1/2になるらしいことと、自宅の機器が、不在時に風呂の温度より高くなるのは精神衛生上良くなく、強制冷却を採用することにしました。



いきなり、取り付けた画像ですが、昨年掲載したADSLモデムを冷却する工作と同じ手法で、ファン用の取り付け治具を自作しました。
左右にあるUPSの通気口に合うように、それぞれ送風と排風の方向に2個のファンを取り付けています。
ファンは定格 1,600RPM で、電圧を落として、約 1400rpm ぐらいで使っています。

また、上図のUPSの上部にあるガムテープは、左の温度計の外部センサーを貼り付けるため臨時につけています。



温度表示の上が、室温。


下が、外部センサー温度で、UPSの上部温度を測定しています。


取り付けの効果を見るため、取り付け前と後で、比較してみました。

時間 11:35 12:40 12:45ごろ取り付け=> 13:50 14:20
apcupsdモニタ 43.6 44.1 - 38.2 37.8
室温 31.9 32.3 - 32.7 32.7
UPSの上部温度 37.5 36.5 - 34.3 34.0

 

この治具を取り付ける前は、室温プラス11度ぐらい高い温度でしたが、取り付け後は室温プラス6度程度に収まっています。
夏場でも日中はクーラーを入れることが無い我が家では、場合によっては50度近くなるかも知れません。

特に暑くなる(7月初旬でも十分暑い)大阪の夏を乗り切るために、用意しました。

特に今年は、昨年の冷夏+9月残暑と違って、7月始めごろから大変な暑さが続いています。
以下は、HomeServer内の温度を観測している RRDstats の画像ですが、昨年の同じ時期より3度ほど暑くなっているように見えます。




工作内容は、次の項で簡単に掲載しておきます。

 

8.UPSファンの製作 (2004/07/10)

 

最初に用意したものは、以下の部品です。
特に、ファンはもっと安いもので良かったのですが、電源の配線の手間を考えて、ケース用の2個セットを採用して、数量で冗長性を持たせています。


組み立ては、昨年ADSLモデムの冷却でも採用した、フォーレックスというアクリルの材料と、安価にファンを固定するために加工は手間がかかりますが、1mで105円のL型アングルを使いました。(後で画像あり)
気休めになるかも知れませんが、ファンガードは、吸い込み側にフィルタ状のパーツを採用して、ごみの吸入を防ぎ、吸出し側(反対側)と同じ電圧でまわしています。
一応、電圧コントロールのパーツも買い置きがあったので、使います。
これを、UPSの上から置くだけで固定はしていません。


吸入がわからの画像です。

吸出し側からの画像です。

内側の加工の様子です。

使用したアングルで、11cmの長さに切って使いました。

 

 

一ヶ月も経たないうちに、続編 apcupsd3_10_15 を掲載しました。 (2004/08/08)