SUSE Linux: apcupsd のキャリブレーションチェック

apcupsd の apctest にはバッテリーの Calibration 機能があります。キャリブレーションとは、"補正"の事です。

バッテリーは長期間使用していると性能が劣化します。そこで初期状態から数か月、数年経つ毎に劣化状態をテストしなければ、バッテリー運転の稼働可能な時間が変化します。また、システムに追加があると、当然負荷状態も変化します。

まぁ、スマートフォンも時々、完全放電させないと、正常なバッテリー残量が出てこないのと同じですね。

ということで、機器の追加、変更があった場合や定期的にスケジュールを決めてバッテリーをテストして、稼働可能な時間を補正するのが、キャリブレーション機能です。キャリブレーションチェックをして、実際にバッテリーの負荷と、稼働時間を修正する機能です。

SLES11sp3 での apcupsd と UPS の制御パラメータ


重要なポイントは二つ

1) 100 % 充電状態から実施すること

さもないと、正確な時間が判りません。

2) 年に1、2度は行う事。

やりすぎはバッテリーの寿命に影響します。かと言ってバッテリーそのものの劣化の判断をするには、ある程度キャリブレーションをしなければならないという事です。

個人的に他にキャリブレーションテストで指摘しておきたいのは

1) 放電するのでピーピー鳴ります。

あまり気持ちのいいものではないので、人が居ない時間帯に行うのがいいでしょう。私の様に、外部の業者が黙ってやってしまうとお客様に怒られます。

2) その他の商用電源に負荷が掛かっていない時間帯を選ぶ事。

キャリブレーション中は、当たり前ですが、UPSが作動するような、ブランクアウトやサージなどが起こらない時間帯を選ぶのがコツです。例えば古いビルで冬の早朝の出勤時間帯(みんなで電気ヒーターを使い始める)や、工場などで、ビジナスアワーのフル操業状態と深夜、休日では商用電源の状態が著しく変化します。工場などは下手をすると休日中に電圧が上がりすぎる場合があります。そうなるとUPS運転に切り替わる可能性があるので、そんな時間帯は避けることです。

という事で一番いいのは、ビジネスアワーを避けて、バッチ処理も終わる夜明け頃がベストですが、残念ながら apctest ではパラメータを指定して cron 実行という事はできない様です。結局、

「今日は大きなシステムイベントの予定がないな」

という日を選んで実行する事になります。特に、バッテリーに機器を追加したり変更したら、キャリブレーションテストを一度はすることをお勧めします。

キャリブレーションテストが終わったら、イベントのログを確認して、何分間バッテリー運転していたかを確認する事です。これで大体のUPSの稼働時間、負荷状態の余裕が見えてきます。

SUSE Linux の場合、apcupsd のデーモンを停止して行います。 apcupsd stop ではapctest は有効に動作しないので、プロセスを確認して、kill してから実行します。


sles11:~ # ps ax | grep apcups
13962 ? Ss 0:00 apcupsd start
13965 pts/11 S+ 0:00 grep apcups
sles11:~ # kill 13962 <--- apcupsd のプロセスを止める


sles11:~ # apctest


2015-05-08 11:19:10 apctest 3.14.4 (18 May 2008) suse
Checking configuration ...
Attached to driver: apcsmart
sharenet.type = DISABLE
cable.type = CUSTOM_SMART

You are using a SMART cable type, so I'm entering SMART test mode
mode.type = APCSMART_UPS
Setting up the port ...
Hello, this is the apcupsd Cable Test program.
This part of apctest is for testing Smart UPSes.
Please select the function you want to perform.

1) Query the UPS for all known values
2) Perform a Battery Runtime Calibration
3) Abort Battery Calibration
4) Monitor Battery Calibration progress
5) Program EEPROM
6) Enter TTY mode communicating with UPS
7) Quit

Select function number: 2 <---- キャリブレーションの開始

First ensure that we have a good link and
that the UPS is functionning normally.
Simulating UPSlinkCheck ...
Wrote: Y Got: SM
Attempting to use smart_poll() ...
Sent: Y Got: SM Good -- smart_poll() works!.

Checking estimated runtime ...
Current runtime is 35 minutes
Checking for battery level ...
Battery level is 100.0 -- OK

The battery calibration should automatically end
when the battery level drops below about 25, depending
on your UPS.

I can also optionally monitor the progress
and stop the calibration if it goes below 10. However,
in the case of a new battery this may prematurely end the
calibration loosing the effect.

Do you want me to stop the calibration
if the battery level goes too low? (y/n): y
 <--- バッテリー運転に切り替えるため確認


Sending Battery Calibration command. ...
UPS has initiated battery calibration.
Monitoring the calibration progress ...
To stop the calibration, enter a return.

Battery charge 100 <--- 現在 100%
Remaining runtime is 34 minutes
<--- とりあえず34分間の予定の模様
<-- この間UPSはピーピー鳴り始めます --

User input. Terminating calibration ...

Attempting to abort calibration ...
Response to abort request: OK
On battery 20 sec or 0m20s.

1) Query the UPS for all known values
2) Perform a Battery Runtime Calibration
3) Abort Battery Calibration
4) Monitor Battery Calibration progress
5) Program EEPROM
6) Enter TTY mode communicating with UPS
7) Quit

Select function number: 4 <--- モニターをしてみる

Monitoring the calibration progress ...
To stop the calibration, enter a return.

Battery Runtime Calibration terminated by UPS.
Checking estimated runtime ...
Remaining runtime is 35 minutes <--- ここでは 35 分間の予定

1) Query the UPS for all known values
2) Perform a Battery Runtime Calibration
3) Abort Battery Calibration
4) Monitor Battery Calibration progress
5) Program EEPROM
6) Enter TTY mode communicating with UPS
7) Quit

Select function number: 3
<-- やっぱりお客さんに怒られた。キャンセルしてみる


CAUTION! Don't use this command unless the UPS
is already doing a calibration.
Are you sure? (yes/no): yes <--- キャンセルの確認


Attempting to abort calibration ...
Response to abort request: OK

1) Query the UPS for all known values
2) Perform a Battery Runtime Calibration
3) Abort Battery Calibration
4) Monitor Battery Calibration progress
5) Program EEPROM
6) Enter TTY mode communicating with UPS
7) Quit

Select function number: 7 <--- 終了

2015-05-08 11:20:27 End apctest.

ログを見てみる

sles11:~ # tail /var/log/apcupsd.events
Fri May 08 11:18:36 JST 2015 apcupsd error shutdown completed
Fri May 08 11:18:52 JST 2015 apcupsd exiting, signal 15
Fri May 08 11:18:52 JST 2015 apcupsd shutdown succeeded
Fri May 08 11:19:07 JST 2015 apcupsd exiting, signal 15
Fri May 08 11:19:07 JST 2015 apcupsd shutdown succeeded
sles11:~ #


※とても重要 - apctest をする際は apcupsd を止めます。終わったら忘れずにデーモンを起動しましょう。

--
NetWare 版の PowerChute では、キャリブレーションを月に一度実行できるようなパラメータが
ありました。土日はシステムに何等かの変更をかけるようなイベントが予測されるので、火曜とか水曜の朝5時ごろに月イチに、まだ担当者が出勤してこない時間帯に、キャリブレーションを実行するように設定していました。

UPSは正常に動いている様に見えていても、キャリブレーションをかけると放電しますから、その後、普段負荷が掛かっていないバッテリーが見事に御臨終されている事もよくあります。

UPSは基本的に「壊れる」事で大事な機器を守る機能があるので、故障は嬉しい事ではなくても、壊れるものだと割り切る事も必要です。。

キャリブレーションで「バッテリーを壊してしまった」というより、もう寿命が来ているバッテリーが「壊れている」事を確認する作業でもあります。この後、赤ランプが付いて、バッテリーの交換だね、という事になりますから、キャリブレーションテストは数か月に一度はやっておくべき作業です。




by islandcenter | 2015-05-08 20:34 | SUSE | Comments(0)