今回準備した無停電電源

APCUPSDのインストール

  1. [Yast]-[ソフトウェア]-[ソフトウェアのインストール/削除] を選択します
    apcupsd1.png
  2. APCUSPD をインストールします
    apcupsd2.png

APCUPSDの準備

  1. 設定ファイルの準備
    > sudo vi /etc/apcupsd/apcupsd.conf
        …
        22 UPSCABLE usb
        …
        44 UPSTYPE usb
        …
        67 DEVICE /dev/usb/hid/hiddev0
        …
       244 #
       245 # UPS name, max 8 characters
       246 UPSNAME BAT-01
       247 #
       248 # Battery date - 8 characters
       249 BATTDATE 02/09/06
       250 #
        …
    :wq
    BATTDATEは、mm/dd/yy です。
  2. シャットダウンタイム
    apcupsd.confの中で設定されている規定値をそのまま使います
     86 ONBATTERYDELAY 6 … ここで指定した秒数以下の電源途絶は
                            ユーザや配下のマシンに通知しない。
     94 BATTERYLEVEL 5   … バッテリー残量がここで指定した%以下になったら
                            シャットダウンを始める
    100 MINUTES 3        … バッテリー残量がここで指定した分以下になったら
                            シャットダウンを始める
    115 TIMEOUT 0        … 電源途絶からここで指定した秒数経ったら
                            シャットダウンを始める。0は無効値。バッテリー残量
                            がCPU側から分からないUPSの場合に設定。
  3. 監視ソフトがUPSからの情報を受け取るためのデバイスを作成
    > sudo /usr/share/doc/packages/apcupsd/examples/make-hiddev

設定のテスト

  1. apcaccess
    # apcaccess status
    APC      : 001,033,0804
    DATE     : Thu Feb 09 23:36:04 JST 2006
    HOSTNAME : grape
    RELEASE  : 3.10.17a
    VERSION  : 3.10.17a (22 April 2005) suse
    UPSNAME  : BAT-01
    CABLE    : USB Cable
    MODEL    : APC ES 500
    UPSMODE  : Stand Alone
    STARTTIME: Thu Feb 09 23:35:53 JST 2006
    STATUS   : ONLINE
    LINEV    : 103.0 Volts
    LOADPCT  :  21.0 Percent Load Capacity
    BCHARGE  : 100.0 Percent
    TIMELEFT :  36.5 Minutes
    MBATTCHG : 5 Percent
    MINTIMEL : 3 Minutes
    MAXTIME  : 0 Seconds
    LOTRANS  : 090.0 Volts
    HITRANS  : 110.0 Volts
    ALARMDEL : Always
    BATTV    : 13.6 Volts
    NUMXFERS : 0
    TONBATT  : 0 seconds
    CUMONBATT: 0 seconds
    XOFFBATT : N/A
    STATFLAG : 0x02000008 Status Flag
    MANDATE  : 2005-08-20
    SERIALNO : AB0534224438
    BATTDATE : 2000-00-00
    NOMBATTV :  12.0
    FIRMWARE : 03.p5.A USB FW:p5
    APCMODEL : APC ES 500
    END APC  : Thu Feb 09 23:36:06 JST 2006
  2. apcccessが起動しないときには
    • 以下のようなメッセージが出てapctestが起動しないときがあります
      # apcaccess
      FATAL ERROR in apcaccess.c at line 243
      tcp_open: cannot connect to server localhost on port 3551.
      ERR=Connection refused
    • これはapcupsdが起動していないためなので、apcupsdを起動すれば正常に動作するようになります。
      # /etc/init.d/apcupsd start
      Starting apcupsd power management     done
  3. apctest
    # apctest
    
    
    2006-02-09 23:42:58 apctest 3.10.17a (22 April 2005) suse
    Checking configuration ...
    Attached to driver: usb
    sharenet.type = DISABLE
    cable.type = USB_CABLE
    
    You are using a USB cable type, so I'm entering USB test mode
    mode.type = USB_UPS
    Setting up the port ...
    Creating the device lock file ...
    Hello, this is the apcupsd Cable Test program.
    This part of apctest is for testing USB UPSes.
    
    Getting UPS capabilities...SUCCESS 
    
    Please select the function you want to perform.
    
    1) Test kill UPS power
    2) Perform self-test
    3) Read last self-test result
    4) Change battery date
    5) View battery date
    6) View manufacturing date
    7) Quit
    
    Select function number:
  4. apctestが起動しないときには
    • 以下のようなメッセージが出てapctestが起動しないときがあります
      # apctest 
      
      
      2006-02-09 23:39:20 apctest 3.10.17a (22 April 2005) suse
      Checking configuration ...
      Attached to driver: usb
      sharenet.type = DISABLE
      cable.type = USB_CABLE
      
      You are using a USB cable type, so I'm entering USB test mode
      mode.type = USB_UPS
      Setting up the port ...
      apctest FATAL ERROR in apcdevice.c at line 77
      Unable to create UPS lock file.
      apctest FATAL ERROR in apcdevice.c at line 77
      Unable to create UPS lock file.
      apctest error termination completed
    • これはapcupsdが起動しているためなので、apcupsdを終了させれば正常に起動するようになります。
      # /etc/init.d/apcupsd stop
      Shutting down apcupsd power management     done
      # killall apcupsd
      apcupsd: no process killed

APCUPSDの自動起動設定

  1. [Yast]-[システム]-[ランレベル・エディタ]を選択します
    apcupsd3.png
  2. apcupsd を ランレベル3(テキストログイン)/5(グラフィカルログイン)でどうするように設定します。
    apcupsd4.png

GUIコンソール

  1. YastでAPCUPDをインストールしたときに、CGIプログラムが /srv/www/cgi-bin に配置されています
  2. multimon.cgi
    apcupsd5.png
  3. upsstats.cgi
    apcupsd6.png
  4. upsfstatus.cgi
    apcupsd7.png

試しにコンセントを引っこ抜いてみると・・・

  1. 全ての端末(X / Term etc.)に以下のようなメッセージが送付されます
    Broadcast Message from root@grape
            (somewhere) at 23:49 ...
    
    Warning power loss detected on UPS BAT-01
    
    
    Broadcast Message from root@grape
            (somewhere) at 23:49 ...
    
    Power failure on UPS BAT-01. Running on batteries.
    
    
    Broadcast Message from root@grape
            (somewhere) at 23:50 ...
    
    Power has returned on UPS BAT-01...  
  2. ログは以下に出力されます
    > cat /var/log/apcupsd.events   
    …
    Fri Feb 10 23:49:22 JST 2006  Power failure.
    Fri Feb 10 23:49:28 JST 2006  Running on UPS batteries.
    Fri Feb 10 23:50:56 JST 2006  Mains returned. No longer on UPS batteries.
    Fri Feb 10 23:50:56 JST 2006  Power is back. UPS running on mains.

参考文献

  1. Que 16, Nov 2001, Apcupsd 3.8.3 ユーザーズマニュアル, http://homepage1.nifty.com/Que/plamo/apc-ups/manual/index.html
  2. IT Media, UPSを利用した電源対策, http://www.itmedia.co.jp/help/howto/linux/ups/index.html
  3. らぶらぶはぁと:Turbo Linux, APC ES500 の導入, http://www.loveloveheart.com/turbolinux/ups_apc_es500.php
  4. bonner linux user group, Re: [Schan-user] Arktur 4.0 UPS Problem, http://bolug.uni-bonn.de/archive/mailinglisten/SchAN-User/2005-02/msg00259.html

Suse 10 Server


添付ファイル: fileapcupsd3.png 2411件 [詳細] fileapcupsd1.png 2360件 [詳細] fileapcupsd6.png 2362件 [詳細] fileapcupsd7.png 2494件 [詳細] fileapcupsd2.png 2459件 [詳細] fileapcupsd5.png 2490件 [詳細] fileapcupsd4.png 2439件 [詳細]

トップ   編集 凍結 差分 バックアップ 添付 複製 名前変更 リロード   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS   sitemap
Last-modified: 2006-02-12 (日) 17:11:08 (6641d)
Short-URL: https://at-sushi.com:443/pukiwiki/index.php?cmd=s&k=adce6f8e9f
ISBN10
ISBN13
9784061426061