メインメニュー

連続稼働時間

本サーバは
39日間と3時間18分
連続稼動しています

広告

トップ  >  CentOS・Fedora  >  その他  >  APC製UPSの設置と設定[centOS5.5]
サーバ運営していると停電などによる電源断でデータが壊れたり、落雷のサージ電流でサーバ故障には対策をしておかなければと思います。もちろん個人端末でも同じように対策しておくに越したことはないでしょうが・・・

さて、今回はAPC製UPS ES725を利用します。他にもSmartUPS500でも動作確認しています。恐らく他のAPC製品でも応用がきくと思います。
さて、物理的にはUPSのバックアップコンセントにサーバを接続し、UPSとサーバを接続します。今回はUSB接続です。

# yum install apcupsd -y


と入力しapcupsdをインストールします。
次にapcupsdの設定を行います。

# vi /etc/apcupsd/apcupsd.conf

# UPSNAME xxx
#   Use this to give your UPS a name in log files and such. This
#   is particulary useful if you have multiple UPSes. This does not
#   set the EEPROM. It should be 8 characters or less.
#UPSNAME
UPSNAME ES 725      #UPS機器名

 

# 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 usb     #UPSと接続したケーブル(シリアルの場合はsmart)

# To get apcupsd to work, in addition to defining the cable
# above, you must also define a UPSTYPE, which corresponds to
# the type of UPS you have (see the Description for more details).
# You must also specify a DEVICE, sometimes referred to as a port.
# For USB UPSes, please leave the DEVICE directive blank. For
# other UPS types, you must specify an appropriate port or address.
#
# UPSTYPE   DEVICE           Description
# apcsmart  /dev/tty**       Newer serial character device,
#                            appropriate for SmartUPS models using
#                            a serial cable (not USB).
#
# usb                 Most new UPSes are USB. A blank DEVICE
#                            setting enables autodetection, which is
#                            the best choice for most installations.
#
# net       hostname:port    Network link to a master apcupsd
#                            through apcupsd's Network Information
#                            Server. This is used if you don't have
#                            a UPS directly connected to your computer.
#
# snmp      hostname:port:vendor:community
#                            SNMP Network link to an SNMP-enabled
#                            UPS device. Vendor is the MIB used by
#                            the UPS device: can be "APC", "APC_NOTRAP"
#                            or "RFC" where APC is the powernet MIB,
#                            "APC_NOTRAP" is powernet with SNMP trap
#                            catching disabled, and RFC is the IETF's
#                            rfc1628 UPS-MIB. You usually want "APC".
#                            Port is usually 161. Community is usually
#                            "private".
#
# dumb      /dev/tty**       Old serial character device for use
#                            with simple-signaling UPSes.
#
# pcnet    ipaddr:username:passphrase
#                            PowerChute Network Shutdown protocol
#                            which can be used as an alternative to SNMP
#                            with AP9617 family of smart slot cards.
#                            ipaddr is the IP address of the UPS mgmt
#                            card. username and passphrase are the
#                            credentials for which the card has been
#                            configured.
#

#UPSTYPE apcsmart    #シリアル接続の場合は変更しない
#DEVICE /dev/ttyS0    #シリアル接続の場合は変更しない
UPSTYPE usb    #シリアル接続の場合は追記しない

 

 
以上で最低限の設定は終了です。デフォルトではバッテリ容量が5%を切った時点で再起動を始めます。
他に下記項目を用途に応じて変更します。
BATTERYLEVEL バッテリの残量が指定したパーセンテージを下回った場合にシャットダウンを行う
MINUTES バッテリ稼働可能予想時間が指定の時間(分)を切った場合にシャットダウンを行う
TIMEOUT バッテリに動作が切り替わってから何秒後にシャットダウンするかを設定
次にapcupsdの起動をしてみます。
# service apcupsd start
正常に接続されていれば特にエラーもなくプロンプトが帰ってくるはずです。
次にサーバの再起動時にも自動で起動するように設定します。
# chkconfig apcupsd on

ここでupsとサーバが正常にやりとりできているか調べます。
# service apcupsd status

これでupsの各情報を拾ってきます。
またブラウザでupsの情報を見ることもできます。一度httpdを再起動します。
# service httpd restart

初期設定ではローカルホストからのみしかみることはできません。リモート端末等で見る場合は/etc/httpd/conf.d/apcupsd.confを編集し、リモート端末からのアクセスも許可してください。
http://サーバのIPアドレス/apcupsd/multimon.cgi
上記アドレスでupsの状態を見ることができるようになっているはずです。
これで落雷や急な停電でもサーバを壊すことなく運営ができるようになります。

 

プリンタ用画面
投票数:244 平均点:5.41
前
Intel D945GCLF2 にCentOSをインストールするとNICの動作が不安定になる[CentOS5.5]
カテゴリートップ
その他