APC-UPS を SUSE Enterprise Server で使うには - apcupsd

APC UPS は SLES10 では Not Support in Japan というふざけた形態です。おそらく APC Japan には自社製品に詳しくて日本語がしゃべれるヒトがいないからでしょうか?英語版やドイツ語では動いて、日本語環境ではサポートしてくれないようです。

ということで SLES10 には標準的なパッケージとして apcupsd が付属していますので、こちらを使いましょうということ。

このパッケージは、純正の APC の PCBE Linux Agent より30倍くらい賢いので、上手に使えば、DMZのスタンドアローンの環境や、インターネットへのむき出しの環境でも利用できるのでお勧めです。

apcupsd のインストール

YaST > System > Software Management から Filter > Package Groups を選び、 Hardware + UPS をクリックすると apcupsd パッケージが選択できます。チェックを入れて Accept するとインストールが開始されます。要求されたCDまたはDVDを用意してください。
APC-UPS を SUSE Enterprise Server で使うには - apcupsd_a0056607_19112843.gif


起動

  パッケージのインストールができたら、 YaST > System > Runlevel を開き Expert Mode をチェックします。
 パッケージがインストールされている事を確認したら、 Runlevel 3, 5 でスタートするようにチェックし、Start/Stop/Refresh ボタンから Start させます。Running が Yes になれば起動完了です。


APC-UPS を SUSE Enterprise Server で使うには - apcupsd_a0056607_19115927.gif


Smart ケーブル確認

  apcaccess status コマンドでUPSを確認します。 以下の例は、 Smart ケーブル(通称黒ケーブル)で UPS 本体背面のシリアルポートとサーバを直接接続した例です。

mysles-1:/etc/apcupsd # apcaccess status
APC : 001,051,1207
DATE : Thu Dec 27 17:39:20 JST 2007
HOSTNAME : mysles-1
RELEASE : 3.12.1
VERSION : 3.12.1 (06 January 2006) suse
UPSNAME : UPS_IDEN
CABLE : Custom Cable Smart
MODEL : Smart-UPS 3000 RM
UPSMODE : Stand Alone
STARTTIME: Thu Dec 27 17:04:00 JST 2007
STATUS : ONLINE
LINEV : 100.8 Volts
LOADPCT : 19.5 Percent Load Capacity
BCHARGE : 100.0 Percent
TIMELEFT : 44.0 Minutes
MBATTCHG : 5 Percent
MINTIMEL : 3 Minutes
MAXTIME : 0 Seconds
MAXLINEV : 101.5 Volts
MINLINEV : 100.8 Volts
OUTPUTV : 100.8 Volts
SENSE : High
DWAKE : 000 Seconds
DSHUTD : 090 Seconds
DLOWBATT : 02 Minutes
LOTRANS : 092.0 Volts
HITRANS : 108.0 Volts
RETPCT : 000.0 Percent
ITEMP : 27.4 C Internal
ALARMDEL : 5 seconds
BATTV : 55.1 Volts
LINEFREQ : 50.0 Hz
LASTXFER : Automatic or explicit self test
NUMXFERS : 0
TONBATT : 0 seconds
CUMONBATT: 0 seconds
XOFFBATT : N/A
SELFTEST : NO
STESTI : 336
STATFLAG : 0x07000008 Status Flag
REG1 : 0x00 Register 1
REG2 : 0x00 Register 2
REG3 : 0x00 Register 3
MANDATE : 12/19/06
SERIALNO : JS0652005362
BATTDATE : 12/19/06
NOMOUTV : 100
NOMBATTV : 48.0
EXTBATTS : 0
FIRMWARE : 655.6.A
APCMODEL : FWA
END APC : Thu Dec 27 17:39:50 JST 2007


BackUPSの確認

 BackUPS(通称グレーケーブル)でAPC-UPSの増設拡張ボードとシリアル接続している場合は、 /etc/apcupsd/apcupsd.conf の UPSCABLE にケーブルの型番を追加設定します。

CPU側の D-SUB コネクタに型番が書いてあるので型番を確認してください。

# UPSCABLE
# Defines the type of cable connecting the UPS to your computer.
#
# Possible generic choices for are:
# simple, smart, ether, usb
#
# Or a specific cable model number may be used:
# 940-0119A, 940-0127A, 940-0128A, 940-0020B,
# 940-0020C, 940-0023A, 940-0024B, 940-0024C,
# 940-1524C, 940-0024G, 940-0095A, 940-0095B,
# 940-0095C, M-04-02-2000
#
#UPSCABLE smart <----- コメントアウト
UPSCABLE 940-0020B <----- Add This line

#UPSTYPE smartups <---- コメントアウト
UPSTYPE dumb <---- グレーケーブルでエクスパンダーカードにつないだ場合

BackUPSで動作している場合、 apcaccess status は次のように表示されます。

mysles-2:/etc/apcupsd # apcaccess status
APC : 001,013,0352
DATE : Fri Dec 28 10:55:57 JST 2007
HOSTNAME : mysles-2
RELEASE : 3.12.1
VERSION : 3.12.1 (06 January 2006) suse
UPSNAME : mysles-2
CABLE : APC Cable 940-0020B
MODEL : BackUPS
UPSMODE : Stand Alone
STARTTIME: Fri Dec 28 10:54:46 JST 2007
LINEFAIL : OK
BATTSTAT : OK
STATFLAG : 0x07000008 Status Flag
END APC : Fri Dec 28 10:55:57 JST 2007
mysles-2:/etc/apcupsd #


USB ケーブルでつながっている場合

usb の A コネクタを使って、APC Smart UPS の B コネクタにつなげる場合 apcupsd.conf は以下のように3行を変更します。

UPSCABLE usb
UPSTYPE usb
DEVICE 空欄


イベントの確認
  電源のイベントは /var/log/apcupsd.events に書き込まれます。

GUI
http://localhost/cgi-bin/multimon.cgi
からブラウザで開くことができます。

APC-UPS を SUSE Enterprise Server で使うには - apcupsd_a0056607_1156312.gif


設定の変更などはここからではできません。

apctest

apctest は UPS のステータスをチェックしたりキャリブレーションテストを行うプログラムです。一旦 APCUPSD を停止させて実行します。

mysles-1:~ # /etc/init.d/apcupsd stop <--- 止めてから
Shutting down apcupsd power management done
mysles-1:~ # apctest <-- テストを起動


2014-08-26 13:47:25 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 <-- 1) のUPSのクエリを実行
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: 1

I am going to run through the series of queries of the UPS
that are used in initializing apcupsd.

Simulating UPSlinkCheck ...
Wrote: Y Got: SM
Attempting to use smart_poll() ...
Sent: Y Got: SM Good -- smart_poll() works!.

Going to ask for valid commands...
Protocol version is: 3
Alert characters are: !$%+?=#|
Command characters are: ^A^N^Z+-789>@ABCDEFGKLMNOPQRSUVWXYZ'abcefgjklmnopqrsuxyz~^M

Now running through apcupsd get_UPS capabilities().
NA indicates that the feature is Not Available

UPS Status: 08
Line quality: FF
Reason for last transfer to batteries: S
Self-Test Status: NO
Line Voltage: 100.7
Line Voltage Max: 100.7
Line Voltage Min: 099.4
Output Voltage: 100.7
Batt level percent: 099.0
Batt voltage: 55.05
UPS Load: 034.8
Line freq: 50.00
Runtime left: 0033
UPS Internal temp: 040.5
Dip switch settings: 00
Register 1: 00
Register 2: 00
Register 3: 00
Sensitivity: H
Wakeup delay: 000
Sleep delay: 180
Low transfer voltage: 090
High transfer voltage: 110
Batt charge for return: 00
Alarm status: 0
Low battery shutdown level: 05
UPS Name: UPS_IDEN
UPS Self test interval: 336
UPS manufacture date: 01/25/06
UPS serial number: QS0605110406
Date battery replaced: 01/25/06
Output voltage when on batteries: 100
Nominal battery voltage: 048
Percent humidity: NA
Ambient temperature: NA
Firmware revision: 92.15S.A
Number of external batteries installed: 000
Number of bad batteries installed: NA
UPS model as defined by UPS: OWA
UPS EPROM capabilities string: uD43132135138129uM43229234239224uA43110112114108uI43253264271280lD43103100097106lM43177172168182lA43090092081085lI43196188208204e44200155090oI43230240220225oD13115oJ13100oM13208s441HMLLq44202050710p443020180300600k4410TLNr443000060180300E443336168ON OFF
The EPROM string is 253 characters long!
Hours since last self test: NA

That is all for now.

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 <-- 終了

2014-08-26 13:47:44 End apctest.

mysles-1:~ # /etc/init.d/apcupsd start <-- APCUPSD を再起動

その他
 その他の設定は /etc/apcupsd/apcupsd.conf を書き換えて、変更しますが、多くの場合、デフォルト値で十分と思われます。
マニュアルその他最新版の情報は

http://www.apcupsd.com

より入手できます。


APC純正の Power Chute Bussines Edition(PCBE) は Windows の管理用サーバを必要としますが、 apcupsd は管理用サーバも不要ですし、ネットワークシャットダウンやシリアルケーブルもサポートしているので、 SUSE Linux を APC-UPS で運用するには一番楽な方法でしょう。

追加、補足
SLES11sp3 での apcupsd と UPS の制御パラメータ

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

一部のパッケージで apc-upsd が入っていない場合 opensuse の software.opensuse.org から1クリックインストールできます。
https://software.opensuse.org/package/apcupsd

[検索キーワード]
SLES SUSE apcupsd smart-ups back-ups APC UPS

isLandcenter.jp






by islandcenter | 2008-12-18 13:52 | SUSE | Comments(0)