コンフィグレーションディレクティブ

訳者:Que 30 Aug 2000 (http://homepage1.nifty.com/Que/)


It may be necessary to change the configuration information in the file /etc/apcupsd/apcupsd.conf to meet your needs and to correspond to your configuration. This file is a plain ASCII file and you can use your favorite editor to change it.

Configuration directives in /etc/apcupsd/apcupsd.conf are:

General Configuration Directives

UPSCABLE    <type of cable you are using>>
[ simple | 940-0020B | 940-0023A (broken) ]
[ smart | 940-0024B | 940-0024C ]
[ 940-1524C | 940-0024G | 940-0095A | 940-0095B | 940-0095C]
[ ether ]
UPSTYPE   <type of APC UPS you have>

Keyword

APC Model

Signaling

Status

backupsBackUPSSimpleSupported
sharebasicShareUPS Basic PortSimpleSupported
backupsproBackUPS ProSubSmartSupported
smartvsupsSmartUPS VSSubSmartSupported
newbackupsproSmarter BackUPS ProSubSmartSupported
backupspropnpSmarter BackUPS ProSubSmartSupported
smartupsSmartUPSSmartSupported
matrixupsMatrixUPSSmartSupported
sharesmartShareUPS Advanced PortSmartBeing tested
DEVICE   <name of serial port>
Please specify which serial port device is used for UPS communication. The default is /dev/ttyS[0|1|2|3].
LOCKFILE    <path to lockfile>
By supplying this argument, "apcupsd" tries to create a lockfile for the serial port in the specified directory. This is important to keep two programs from reading or writing the serial port at the same time.

Configuration Directives Used by the Network Information Server

NETSERVER [on | off]
This configuration directive turns the network information server on or off. If it is on, apcupsd will spawn a child process that serves STATUS and EVENTS information over the network. This information is currently used by the Web based CGI programs. The default is on. In some cases, for added security, you may want to invoke a separate information server daemon from the inetd daemon. In that case, NETSERVER should be off.
SERVERPORT <port>
This configuration directive specifies the port to be used by the apcupsd Network Information Server. The default is 7000. If you change this port, you must manually change the #define SERV_TCP_PORT in cgi/upsfetch.c and rebuild the CGI programs.
EVENTSFILE <filename>
If you want the apcupsd network information server to provide the last 10 events via the network, you must specify a file where apcupsd will save these events. The default is: /etc/apcupsd/apcupsd.events. Currently, apcupsd will save at most the last 50 events. Periodically (once an hour by default), apcupsd will check the size of this file. When more than 50 events are recorded, apcupsd will truncate the file to the most recent 10 events. Consequently this file will not grow indefinitely. Although we do not recommend it, you may change these values by editing apcevents.c and changing the appropriate defines. Be aware that if you set these values to very large numbers, apcupsd may make excessive memory demands on the system during the data access and file truncation operations.

Configuration Directives used to Control System Logging

STATTIME  <time>
This directive supplies the time interval between writes to the STATUS file. If set to zero, the STATUS file will not be written. Please note that in a future version of apcupsd the STATUS file code will disappear since its functionality has been replaced by the Network Information Server and by apcaccess status.
STATFILE   <file>
This directive specifies the file to be used when writing the STATUS information. The default is /etc/apcupsd/apcupsd.status
DATATIME<time>
This directives supplies the time interval between writes of PowerChute&tm; like data information to the log file. See the DATA format specification section of this manual for additional details.
FACILITY  <log-facility>
The facility directive can be used to change the system logging class or facility. The default is DAEMON. This parameter can be useful if you wish to direct the apcupsd system logging information to other than your system default files. See the logging section of this manual for additional details.

Configuration Directives used during Power Failures

ANNOY    <time in seconds>
Specify the time in seconds between messages requesting logged in users to get off the system during a power failure. This timer starts only when the UPS is running on batteries. The default is 300 seconds (5 minutes).
DELAY   <time in seconds>
Specify delay time in seconds before apcupsd begins requesting logged in users to get off the system during a power failure. This timer starts only after the UPS is running on batteries. This timer is reset when the power returns. The default is 60 seconds. Thus, the first warning to log off the system occurs after 60 seconds on batteries.
NOLOGON   <specifies when apcupsd should create the nologon file>
[ disable | timeout | percent | minutes | always ] are valid types.
Based on Ten (10) percent of a setting. This allows one to define the point when the /etc/nologin file is created. Once the /etc/nologin file is created, normal users are prevented from logging in. Control of when this file is created is important for allowing systems with BIG UPSes to run as normally until the system administrator determines the need for preventing user logins. The feature also allows the system administrator to hold the "ANNOY" factor until the /etc/nologin file is created. The default is disable.
disable
prevents apcupsd from creating the nologin file. Consequently, any user can login during a power failure condition.
timeout
specifies a specific wait time before creating the nologin file.
percent
specifies the percent battery charge remaining before creating the nologin file.
minutes
specifies the battery runtime remaining before creating the nologin file.
always
causes the nologin file to be immediately created on a power failure.
BATTERYLEVEL    <percent of battery>
If BATTERYLEVEL is specified, during a power failure, apcupsd will halt the system when the remaining battery charge falls below the specified percentage. The default is 5 percent.
MINUTES    <battery runtime in minutes>
If MINUTES is specified, during a power failure, apcupsd will shutdown the system when the remaining remaining runtime on batteries as internally calculated by the UPS falls below the time specified. The default is 3.
TIMEOUT    <time in seconds>
After a power failure, apcupsd will halt the system when TIMEOUT seconds have expired. A value of zero disables this timer. Normally for SMARTUPSes, this should be zero so that the shutdown time will be determined by the battery level and/or remaining runtime (see above). This command is useful for dumb UPSes that do not report battery level or the remaining runtime. It is also useful for testing apcupsd because you can force a rapid shutdown by setting a small value (e.g. 60) and pulling the plug to the UPS.
The timeout for the master is always 30 seconds longer than slaves.
TIMEOUT, BATTERYLEVEL, and MINUTES can be set together without problems. apcupsd will react to the first case or test that is valid. Normally SmartUPS users will set TIMEOUT to zero so that the system is shutdown depending on the percentage battery charge remaining (BATTERYLEVEL) or the remaining battery runtime (MINUTES).

Configuration Directives Used to Set the UPS EPROM

The values specified with the following directives are only used if the --configure option is specified on the apcupsd command line, and the UPS is capable of internal EPROM programming. In that case, apcupsd attempts to set the values into the UPSes EPROM.

Under normal operations, the values for these parameters specified in the configuration file are not used. Instead, they are read from the UPS EPROM by apcupsd. See the EEPROM programming section of this manual for further details.

SENSITIVITY    <sets sensitivity level>
(H)igh, (M)edium, (L)ow
This value determine how sensitive the UPS is to the mains quality and voltage fluctuations. The more sensitive it is, the quicker the UPS will switch to battery power when the mains line quality is bad. Normally, this should be set to H, but if you find your UPS switching to batteries frequently, you might want to try a less sensitive setting, providing that your computer equipment tolerates the poor quality mains. This value is written to the UPS EPROM when the   configure option is specified.
Under normal apcupsd operations (no   configure option), apcupsd will read the value store in the UPS and display it in the STATUS output.
WAKEUP   <set wakeup delay>
The UPS power restart delay value in [0,60,180,300] in seconds after the UPS has shut down during a power failure. This is to prevent the power from coming back on too quickly after a power down, and is important for those who have high rpm drives that need to spindown before powering them up again. Some older SCSI models are very sensitive to this problem. Default is zero. This value is written to the UPS EPROM when the --configure option is specified. Under normal apcupsd operations (no --configure option), apcupsd will read the value store in the UPS and display it in the STATUS output.
SLEEP   <set sleep delay>
The UPS delay or grace period in [20,180,300,600] seconds before the UPS cuts the power to your equipment. The default is 20 seconds. This value is written to the UPS EPROM when the   configure option is specified. Under normal apcupsd operations (no   configure option), apcupsd will read the value store in the UPS and display it in the STATUS output.
LOTRANSFER   <lower limit of ups batt. transfer>
This sets the low line voltage point at which to switch over to batteries. Different values are permitted based on the UPS model, classification, and manufacture date. Use apcaccess eeprom to show you which values are permited. This value is written to the UPS EPROM when the --configure option is specified.
Under normal apcupsd operations (no --configure option), apcupsd will read the value store in the UPS and display it in the STATUS output.
HITRANSFER    <upper limit of ups batt. transfer>
This sets the high line voltage point to switch over to batteries.
Different values are permitted based on the UPS model, classification, and manufacture date. Use apcaccess eeprom to show you which values are permited. This value is written to the UPS EPROM when the --configure option is specified.
Under normal apcupsd operations (no --configure option), apcupsd will read the value store in the UPS and display it in the STATUS output.
RETURNCHARGE    <min. batt. charge level>
This parameter specifies what battery percentage charge is necessary before the UPS will supply power to your equipment after a power down. Different values are permitted based on the UPS model, classification, and manufacture date. Use apcaccess eeprom to show you which values are permitted. This value is written to the UPS EPROM when the --configure option is specified.
Under normal apcupsd operations (no --configure option), apcupsd will read the value store in the UPS and display it in the STATUS output.
BEEPSTATE   <alarm beep state>
This parameter tells the UPS when it can sound its audio alarm. These settings are based on discrete events related to the remaining capacity of the UPS.
0
immediately upon power failure
T
power failure + 30 seconds
L
low battery power
N
never
UPSNAME    <string>
This is an eight character string.This is the UPS name that will be stored in the UPS EPROM.
This value is written to the UPS EPROM when the --rename-ups option is specified. Under normal apcupsd operations (no --configure option), apcupsd will read the value store in the UPS and display it in the STATUS output.
BATTDATE    <string>
This is an eight character string that is the last date the batteries were changed.
This value is written to the UPS EPROM when the --update-battery-date option is specified. Under normal apcupsd operations (no --configure option), apcupsd will read the value store in the UPS and display it in the STATUS output.

UPS共有のためのコンフィグレーションディレクティブ

以下のディレクティブは、1台のUPSで複数のマシンへ電源を供給できるapcupsdのマスター/スレーブネットワーキングモードの場合に当てはまります。マスターである1台のマシンはUPSへのシリアルポート接続を持ち、スレーブである他のマシンは、それらの情報をマスタからネットワークを通して得ます。
UPSCLASS   <class of operation>
[ standalone | shareslave | sharemaster ] および
[ netslave | netmaster ] が有効なタイプです。
[ standalone | netslave | netmaster ] はテスト済みクラスです。
[ shareslave | sharemaster ] は現在テスト中です。

デフォルトは standalone で、UPSから電源供給を受け、UPSとのシリアルポート接続を持つ全てのマシンで使われるはずです。同じ電源から供給を受ける依存性のあるコンピュータが他にないならです。これは通常の場合です。

同じUPSから電源を供給しているほかのマシンがあって、UPSへのシリアルポート接続があるなら、netmaster を使ってください。

もし、UPSへのシリアルポート接続がなくて、そのUPSから電源を供給されているなら、netslave を使ってください。

もしShareUPSを使っていて、BASICポートへシンプルシグナルで接続されているなら、shareslave を使ってください。このコードは充分テストされていません。

もしShareUPSを使っていて、ADVANCEDポートスマートシグナルコントロールへ接続されているなら、sharemaster を使ってください。このコードは充分テストされていません。

UPSMODE    [ disable | share | net | sharenet ] が有効なタイプです。
[ disable | net ] だけがわかっているテストされたクラスです。

[ share | sharenet ] は現在テスト中です。

通常スタンドアローンオペレーションでは、マスター/スレーブネットワーキングを無効化していることを示すため、UPSMODEdisable を設定します。

しかし、もし1台のUPSから数台のコンピュータへ電源を供給していてマスター/スレーブコンピュータと設定しているなら、この値を net と設定します。

shareは、SmartUPS用のSmartアクセサリ上の2もしくは7追加シンプルシグナルポートを使う場合に使ってください。share および sharenet は充分にテストされていません。

NETTIME    <time in seconds>
マスタが使うスレーブマシンへのブロードキャストのインターバル(秒)です。このレートは、UPSがon batteryになったり、電源ラインが戻ったときのリセット時には、自動的に1秒に設定されます。通常は、60秒毎に1度ブロードキャストされます。

NETPORT    <IP port number>
このポート番号は、マスター/スレーブネットワーキングでのみ利用されます。マスタとそれぞれのスレーブは、コンフィグレーションファイル中の NETPORT ディレクティブにて同じポート番号が定義されていなくてはなりません。

ネットワークインフォメーションサーバのための異なるポート番号は、SERVERPORT ディレクティブによって定義されます。

MASTER   <name of master> for Slave machine.
スレーブコンフィグレーションファイル中で使われ、このスレーブに命令を送ることを許すマスターのネットワーク名です。私の考え得る全てのケースで、MASTER ディレクティブを定義するときは、UPSについての情報がマスタからネットワーク経由でくるので、UPSCABLE ether も設定します。

スレーブマシンは、マスタからのシャットダウンのリクエスト、或いは設定された TIMEOUT、BATTERYLEVEL、MINUTES 経過(これらは動作するはずだが充分テストされていない)に達したときのいずれか早いほうでシャットダウンします。従って、スレーブにマスターより先にシャットダウンし始めて欲しいならば、コンフィギュレーション・ファイルの値を調節することによってそうすることができます。スレーブに、マスターがシャットダウンするまで残っていて欲しいなら、TIMEOUT、BATTERYLEVELおよびMINUTESに全てゼロを設定するべきです。

スレーブが正しく動作するためには、スレーブコンフィグレーションファイル中のUPSTYPEをマスターコンフィグレーションファイルのそれと同じにしなくてはなりません。

It should be noted that the master and slaves continue to communicate over the network even after the master has issued a shutdown command to the slaves. This is because the master apcupsd continues to run until it receives the shutdown signal from the system. This is important to ensure that all the slaves have been properly notified of the shutdown.

We recommend that the machine names used on the MASTER and SLAVE directives be put in your /etc/hosts file so that apcupsd will be able to resolve the machine name during startup and shutdown even if DNS is not running.

SLAVE   <name of slave(s)> for Master machine.
マスターコンフィグレーションファイルで使われ、このマスターに依存するスレーブ・マシンの名前です。1台のマスタに最大20台のスレーブをアタッチすることが出来ます。ですから、マスターコンフィグレーションファイル中に複数のSLAVEディレクティブを指定することが出来ます。

上で示したとおり、マスタとスレーブはマスタがシャットダウン指令をスレーブへ発行したあともネットワーク上で通信を続けなくてはなりません。これは、マスターがシステムからシャットダウン信号を受け取るまで、マスターの apcupsd が動きつづけるからです。これは、全てのスレーブが正しくシャットダウンを知らされるために重要です。

MASTER および SLAVE で使われるマシン名は、/etc/hosts へ記述しておくことをお勧めします。これにより、起動時やシャットダウン時にDNSが動いていなくても、apcupsd がマシン名の解決を出来ます。

USERMAGIC   < user defined magic> for Slave machine.
USERMAGIC ディレクティブはスレーブコンフィグレーションファイルのセキュリティ証明の2番目のレベルを定義します。17文字までの文字列です。それぞれのスレーブでユニークであるべきです。スレーブがはじめにマスタとコンタクトするとき、この文字列はマスタへ渡されます。それから、マスタからスレーブへのそれぞれの送信において、この文字列はスレーブへ戻され、マスタの情報が受諾した文字列が正しいかチェックします。
この文字列はネットワーク上のそれぞれのスレーブで異なる必要があります。