apcupsd
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
]
開始行:
*&aname(apcupsd){APCUPSD}; [#p4c6f7e2]
>
>APC製UPSの制御・監視ソフトウェアの設定の備忘録です。
<
**ソフトウェア概要 [#t9ec99b1]
>
>apcupsdはLinux以外のOS(Windows等)に対応し、さらにネッ...
>以前のパッケージは、WebベースのGUIツールも同梱されていま...
|パッケージ|概要|記事|h
|apcupsd|apcupsd本体です。デーモンとapctestツールがインス...
|apcupsd-cgi|Webベースの監視が可能なツールです。Apacheの/...
|apcupsd-gui|GnomeのWidgetです。ノートPCの電源管理のよう...
<
**デーモンの設定 [#g184c60b]
***UPSが接続されているMaster(サーバ)の設定 [#z2802466]
>
>ネットワークを経由してUPSを共有するサーバ間の連携を行う...
>以下がUPSとUSB接続をしているマスターの設定。NETSERVER on...
-/etc/apcupsd/apcupsd.conf
## apcupsd.conf v1.1 ##
#
# for apcupsd release 3.14.10 (13 September 2011) - red...
#
# "apcupsd" POSIX config file
#
# ========= General configuration parameters ============
#
# UPSNAME xxx
# Use this to give your UPS a name in log files and su...
# is particulary useful if you have multiple UPSes. Th...
# set the EEPROM. It should be 8 characters or less.
UPSNAME Smart-UPS 1000
# UPSCABLE <cable>
# Defines the type of cable connecting the UPS to your...
#
# Possible generic choices for <cable> 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 usb
# To get apcupsd to work, in addition to defining the ca...
# above, you must also define a UPSTYPE, which correspon...
# the type of UPS you have (see the Description for more...
# You must also specify a DEVICE, sometimes referred to ...
# For USB UPSes, please leave the DEVICE directive blank...
# other UPS types, you must specify an appropriate port ...
#
# UPSTYPE DEVICE Description
# apcsmart /dev/tty** Newer serial character devi...
# SmartUPS models using a ser...
#
# usb <BLANK> Most new UPSes are USB. A b...
# setting enables autodetecti...
# the best choice for most in...
#
# net hostname:port Network link to a master ap...
# Network Information Server....
# UPS powering your computer ...
# different computer for moni...
#
# snmp hostname:port:vendor:community
# SNMP network link to an SNM...
# Hostname is the ip address ...
# on the network. Vendor can ...
# "APC_NOTRAP". "APC_NOTRAP" ...
# catching; you usually want ...
# 161. Community is usually "...
#
# netsnmp hostname:port:vendor:community
# OBSOLETE
# Same as SNMP above but requ...
# net-snmp library. Unless yo...
# for this old driver, you sh...
#
# dumb /dev/tty** Old serial character device...
# simple-signaling UPSes.
#
# pcnet ipaddr:username:passphrase:port
# PowerChute Network Shutdown...
# used as an alternative to S...
# family of smart slot cards....
# address of the UPS manageme...
# passphrase are the credenti...
# has been configured. port i...
# which to listen for message...
# 3052. If this parameter is ...
# default of 3052 will be used.
#
#UPSTYPE apcsmart
#DEVICE /dev/ttyUSB0
UPSTYPE usb
# POLLTIME <int>
# Interval (in seconds) at which apcupsd polls the UPS...
# setting applies both to directly-attached UPSes (UPS...
# dumb) and networked UPSes (UPSTYPE net, snmp). Lower...
# will improve apcupsd's responsiveness to certain eve...
# higher CPU utilization. The default of 60 is appropr...
# situations.
#POLLTIME 60
# LOCKFILE <path to lockfile>
# Path for device lock file. Not used on Win32.
LOCKFILE /var/lock
# SCRIPTDIR <path to script directory>
# Directory in which apccontrol and event scripts are ...
SCRIPTDIR /etc/apcupsd
# PWRFAILDIR <path to powerfail directory>
# Directory in which to write the powerfail flag file....
# is created when apcupsd initiates a system shutdown ...
# checked in the OS halt scripts to determine if a kil...
# (turning off UPS output power) is required.
PWRFAILDIR /etc/apcupsd
# NOLOGINDIR <path to nologin directory>
# Directory in which to write the nologin file. The ex...
# of this flag file tells the OS to disallow new logins.
NOLOGINDIR /etc
#
# ======== Configuration parameters used during power fa...
#
# The ONBATTERYDELAY is the time in seconds from when a ...
# is detected until we react to it with an onbattery e...
#
# This means that, apccontrol will be called with the ...
# immediately when a power failure is detected. Howev...
# onbattery argument is passed to apccontrol only afte...
# ONBATTERYDELAY time. If you don't want to be annoye...
# powerfailures, make sure that apccontrol powerout do...
# i.e. comment out the wall.
ONBATTERYDELAY 6
#
# Note: BATTERYLEVEL, MINUTES, and TIMEOUT work in conju...
# the first that occurs will cause the initation of a sh...
#
# If during a power failure, the remaining battery perce...
# (as reported by the UPS) is below or equal to BATTERYL...
# apcupsd will initiate a system shutdown.
BATTERYLEVEL 5
# If during a power failure, the remaining runtime in mi...
# (as calculated internally by the UPS) is below or equa...
# apcupsd, will initiate a system shutdown.
MINUTES 3
# If during a power failure, the UPS has run on batterie...
# many seconds or longer, apcupsd will initiate a system...
# A value of 0 disables this timer.
#
# Note, if you have a Smart UPS, you will most likely w...
# this timer by setting it to zero. That way, you UPS...
# on batteries until either the % charge remaing drop...
# or the remaining battery runtime drops to or below ...
# if you are testing, setting this to 60 causes a qui...
# if you pull the power plug.
# If you have an older dumb UPS, you will want to set t...
# the time you know you can run on batteries.
TIMEOUT 0
# Time in seconds between annoying users to signoff pri...
# system shutdown. 0 disables.
ANNOY 300
# Initial delay after power failure before warning users...
# off the system.
ANNOYDELAY 60
# The condition which determines when users are prevente...
# logging in during a power failure.
# NOLOGON <string> [ disable | timeout | percent | minut...
NOLOGON disable
# If KILLDELAY is non-zero, apcupsd will continue runnin...
# shutdown has been requested, and after the specified t...
# seconds attempt to kill the power. This is for use on ...
# where apcupsd cannot regain control after a shutdown.
# KILLDELAY <seconds> 0 disables
KILLDELAY 0
#
# ==== Configuration statements for Network Information ...
#
# NETSERVER [ on | off ] on enables, off disables the ne...
# information server. If netstatus is on, a network inf...
# server process will be started for serving the STATUS...
# EVENT data over the network (used by CGI programs).
NETSERVER on
# NISIP <dotted notation ip address>
# IP address on which NIS server will listen for incomi...
# This is useful if your server is multi-homed (has mor...
# network interface and IP address). Default value is 0...
# means any incoming request will be serviced. Alternat...
# configure this setting to any specific IP address of ...
# NIS will listen for connections only on that interfac...
# loopback address (127.0.0.1) to accept connections on...
# local machine.
NISIP 0.0.0.0
# NISPORT <port> default is 3551 as registered with the ...
# port to use for sending STATUS and EVENTS data over t...
# It is not used unless NETSERVER is on. If you change ...
# you will need to change the corresponding value in th...
# and rebuild the cgi programs.
NISPORT 3551
# If you want the last few EVENTS to be available over t...
# by the network information server, you must define an ...
EVENTSFILE /var/log/apcupsd.events
# EVENTSFILEMAX <kilobytes>
# By default, the size of the EVENTSFILE will be not be...
# 10 kilobytes. When the file grows beyond this limit,...
# be removed from the beginning of the file (first in f...
# parameter EVENTSFILEMAX can be set to a different kil...
# to zero to allow the EVENTSFILE to grow without limit.
EVENTSFILEMAX 10
#
# ========== Configuration statements used if sharing ==...
# a UPS with more than one machine
#
# Remaining items are for ShareUPS (APC expansion card) ...
#
# UPSCLASS [ standalone | shareslave | sharemaster ]
# Normally standalone unless you share an UPS using an...
# card.
UPSCLASS standalone
# UPSMODE [ disable | share ]
# Normally disable unless you share an UPS using an AP...
UPSMODE disable
#
# ===== Configuration statements to control apcupsd syst...
#
# Time interval in seconds between writing the STATUS fi...
STATTIME 0
# Location of STATUS file (written to only if STATTIME i...
STATFILE /var/log/apcupsd.status
# LOGSTATS [ on | off ] on enables, off disables
# Note! This generates a lot of output, so if
# you turn this on, be sure that the
# file defined in syslog.conf for LOG_NOTICE is a ...
# You probably do not want this on.
LOGSTATS off
# Time interval in seconds between writing the DATA reco...
# the log file. 0 disables.
DATATIME 0
# FACILITY defines the logging facility (class) for logg...
# If not specified, it defaults to "daemon". Th...
# if you want to separate the data logged by ap...
# programs.
#FACILITY DAEMON
#
# ========== Configuration statements used in updating t...
#
#
# These statements are used only by apctest when choosin...
# file values" from the EEPROM menu. THESE STATEMENTS HA...
#
# UPS name, max 8 characters
UPSNAME UPS-1000
# Battery date - 8 characters
#BATTDATE mm/dd/yy
BATTDATE 14/05/09
# Sensitivity to line voltage quality (H cause faster tr...
# SENSITIVITY H M L (default = H)
SENSITIVITY H
# UPS delay after power return (seconds)
# WAKEUP 000 060 180 300 (default = 0)
#WAKEUP 60
# UPS Grace period after request to power off (seconds)
# SLEEP 020 180 300 600 (default = 20)
#SLEEP 180
# Low line voltage causing transfer to batteries
# The permitted values depend on your model as defined b...
# of FIRMWARE or APCMODEL. Some representative values a...
# D 106 103 100 097
# M 177 172 168 182
# A 092 090 088 086
# I 208 204 200 196 (default = 0 => not valid)
#LOTRANSFER 208
# High line voltage causing transfer to batteries
# The permitted values depend on your model as defined b...
# of FIRMWARE or APCMODEL. Some representative values a...
# D 127 130 133 136
# M 229 234 239 224
# A 108 110 112 114
# I 253 257 261 265 (default = 0 => not valid)
#HITRANSFER 253
# Battery charge needed to restore power
# RETURNCHARGE 00 15 50 90 (default = 15)
#RETURNCHARGE 15
# Alarm delay
# 0 = zero delay after pwr fail, T = power fail + 30 sec...
# BEEPSTATE 0 T L N (default = 0)
#BEEPSTATE T
# Low battery warning delay in minutes
# LOWBATT 02 05 07 10 (default = 02)
#LOWBATT 2
# UPS Output voltage when running on batteries
# The permitted values depend on your model as defined b...
# of FIRMWARE or APCMODEL. Some representative values a...
# D 115
# M 208
# A 100
# I 230 240 220 225 (default = 0 => not valid)
#OUTPUTVOLTS 230
# Self test interval in hours 336=2 weeks, 168=1 week, O...
# SELFTEST 336 168 ON OFF (default = 336)
#SELFTEST 336
<
***ネットワークで接続されているSlaveの設定 [#kf12d05c]
>
>Slave側はMasterのIPアドレスを設定する(ポート番号も一緒)
-/etc/apcupsd/apcupsd.conf
## apcupsd.conf v1.1 ##
#
# for apcupsd release 3.14.12 (29 March 2014) - redhat
#
# "apcupsd" POSIX config file
#
# ========= General configuration parameters ============
#
# UPSNAME xxx
# Use this to give your UPS a name in log files and su...
# is particulary useful if you have multiple UPSes. Th...
# set the EEPROM. It should be 8 characters or less.
#UPSNAME
UPSNAME Smart-UPS 1000
# UPSCABLE <cable>
# Defines the type of cable connecting the UPS to your...
#
# Possible generic choices for <cable> 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, 940-0625A, M-04-02-2000
#
#UPSCABLE usb
UPSCABLE ether
# To get apcupsd to work, in addition to defining the ca...
# above, you must also define a UPSTYPE, which correspon...
# the type of UPS you have (see the Description for more...
# You must also specify a DEVICE, sometimes referred to ...
# For USB UPSes, please leave the DEVICE directive blank...
# other UPS types, you must specify an appropriate port ...
#
# UPSTYPE DEVICE Description
# apcsmart /dev/tty** Newer serial character devi...
# SmartUPS models using a ser...
#
# usb <BLANK> Most new UPSes are USB. A b...
# setting enables autodetecti...
# the best choice for most in...
#
# net hostname:port Network link to a master ap...
# Network Information Server....
# UPS powering your computer ...
# different computer for moni...
#
# snmp hostname:port:vendor:community
# SNMP network link to an SNM...
# Hostname is the ip address ...
# on the network. Vendor can ...
# "APC_NOTRAP". "APC_NOTRAP" ...
# catching; you usually want ...
# 161. Community is usually "...
#
# netsnmp hostname:port:vendor:community
# OBSOLETE
# Same as SNMP above but requ...
# net-snmp library. Unless yo...
# for this old driver, you sh...
#
# dumb /dev/tty** Old serial character device...
# simple-signaling UPSes.
#
# pcnet ipaddr:username:passphrase:port
# PowerChute Network Shutdown...
# used as an alternative to S...
# family of smart slot cards....
# address of the UPS manageme...
# passphrase are the credenti...
# has been configured. port i...
# which to listen for message...
# 3052. If this parameter is ...
# default of 3052 will be used.
#
# modbus /dev/tty** Serial device for use with ...
# supporting the MODBUS proto...
#
#UPSTYPE usb
#DEVICE
UPSTYPE net
DEVICE 192.168.0.220:3551
# POLLTIME <int>
# Interval (in seconds) at which apcupsd polls the UPS...
# setting applies both to directly-attached UPSes (UPS...
# dumb) and networked UPSes (UPSTYPE net, snmp). Lower...
# will improve apcupsd's responsiveness to certain eve...
# higher CPU utilization. The default of 60 is appropr...
# situations.
#POLLTIME 60
# LOCKFILE <path to lockfile>
# Path for device lock file. Not used on Win32.
LOCKFILE /var/lock
# SCRIPTDIR <path to script directory>
# Directory in which apccontrol and event scripts are ...
SCRIPTDIR /etc/apcupsd
# PWRFAILDIR <path to powerfail directory>
# Directory in which to write the powerfail flag file....
# is created when apcupsd initiates a system shutdown ...
# checked in the OS halt scripts to determine if a kil...
# (turning off UPS output power) is required.
PWRFAILDIR /etc/apcupsd
# NOLOGINDIR <path to nologin directory>
# Directory in which to write the nologin file. The ex...
# of this flag file tells the OS to disallow new logins.
NOLOGINDIR /etc
#
# ======== Configuration parameters used during power fa...
#
# The ONBATTERYDELAY is the time in seconds from when a ...
# is detected until we react to it with an onbattery e...
#
# This means that, apccontrol will be called with the ...
# immediately when a power failure is detected. Howev...
# onbattery argument is passed to apccontrol only afte...
# ONBATTERYDELAY time. If you don't want to be annoye...
# powerfailures, make sure that apccontrol powerout do...
# i.e. comment out the wall.
ONBATTERYDELAY 6
#
# Note: BATTERYLEVEL, MINUTES, and TIMEOUT work in conju...
# the first that occurs will cause the initation of a sh...
#
# If during a power failure, the remaining battery perce...
# (as reported by the UPS) is below or equal to BATTERYL...
# apcupsd will initiate a system shutdown.
BATTERYLEVEL 5
# If during a power failure, the remaining runtime in mi...
# (as calculated internally by the UPS) is below or equa...
# apcupsd, will initiate a system shutdown.
MINUTES 3
# If during a power failure, the UPS has run on batterie...
# many seconds or longer, apcupsd will initiate a system...
# A value of 0 disables this timer.
#
# Note, if you have a Smart UPS, you will most likely w...
# this timer by setting it to zero. That way, you UPS...
# on batteries until either the % charge remaing drop...
# or the remaining battery runtime drops to or below ...
# if you are testing, setting this to 60 causes a qui...
# if you pull the power plug.
# If you have an older dumb UPS, you will want to set t...
# the time you know you can run on batteries.
TIMEOUT 0
# Time in seconds between annoying users to signoff pri...
# system shutdown. 0 disables.
ANNOY 300
# Initial delay after power failure before warning users...
# off the system.
ANNOYDELAY 60
# The condition which determines when users are prevente...
# logging in during a power failure.
# NOLOGON <string> [ disable | timeout | percent | minut...
NOLOGON disable
# If KILLDELAY is non-zero, apcupsd will continue runnin...
# shutdown has been requested, and after the specified t...
# seconds attempt to kill the power. This is for use on ...
# where apcupsd cannot regain control after a shutdown.
# KILLDELAY <seconds> 0 disables
KILLDELAY 0
#
# ==== Configuration statements for Network Information ...
#
# NETSERVER [ on | off ] on enables, off disables the ne...
# information server. If netstatus is on, a network inf...
# server process will be started for serving the STATUS...
# EVENT data over the network (used by CGI programs).
NETSERVER on
# NISIP <dotted notation ip address>
# IP address on which NIS server will listen for incomi...
# This is useful if your server is multi-homed (has mor...
# network interface and IP address). Default value is 0...
# means any incoming request will be serviced. Alternat...
# configure this setting to any specific IP address of ...
# NIS will listen for connections only on that interfac...
# loopback address (127.0.0.1) to accept connections on...
# local machine.
NISIP 0.0.0.0
# NISPORT <port> default is 3551 as registered with the ...
# port to use for sending STATUS and EVENTS data over t...
# It is not used unless NETSERVER is on. If you change ...
# you will need to change the corresponding value in th...
# and rebuild the cgi programs.
NISPORT 3551
# If you want the last few EVENTS to be available over t...
# by the network information server, you must define an ...
EVENTSFILE /var/log/apcupsd.events
# EVENTSFILEMAX <kilobytes>
# By default, the size of the EVENTSFILE will be not be...
# 10 kilobytes. When the file grows beyond this limit,...
# be removed from the beginning of the file (first in f...
# parameter EVENTSFILEMAX can be set to a different kil...
# to zero to allow the EVENTSFILE to grow without limit.
EVENTSFILEMAX 10
#
# ========== Configuration statements used if sharing ==...
# a UPS with more than one machine
#
# Remaining items are for ShareUPS (APC expansion card) ...
#
# UPSCLASS [ standalone | shareslave | sharemaster ]
# Normally standalone unless you share an UPS using an...
# card.
UPSCLASS standalone
# UPSMODE [ disable | share ]
# Normally disable unless you share an UPS using an AP...
UPSMODE disable
#
# ===== Configuration statements to control apcupsd syst...
#
# Time interval in seconds between writing the STATUS fi...
STATTIME 0
# Location of STATUS file (written to only if STATTIME i...
STATFILE /var/log/apcupsd.status
# LOGSTATS [ on | off ] on enables, off disables
# Note! This generates a lot of output, so if
# you turn this on, be sure that the
# file defined in syslog.conf for LOG_NOTICE is a ...
# You probably do not want this on.
LOGSTATS off
# Time interval in seconds between writing the DATA reco...
# the log file. 0 disables.
DATATIME 0
# FACILITY defines the logging facility (class) for logg...
# If not specified, it defaults to "daemon". Th...
# if you want to separate the data logged by ap...
# programs.
#FACILITY DAEMON
#
# ========== Configuration statements used in updating t...
#
#
# These statements are used only by apctest when choosin...
# file values" from the EEPROM menu. THESE STATEMENTS HA...
#
# UPS name, max 8 characters
#UPSNAME UPS_IDEN
# Battery date - 8 characters
#BATTDATE mm/dd/yy
# Sensitivity to line voltage quality (H cause faster tr...
# SENSITIVITY H M L (default = H)
#SENSITIVITY H
# UPS delay after power return (seconds)
# WAKEUP 000 060 180 300 (default = 0)
#WAKEUP 60
# UPS Grace period after request to power off (seconds)
# SLEEP 020 180 300 600 (default = 20)
#SLEEP 180
# Low line voltage causing transfer to batteries
# The permitted values depend on your model as defined b...
# of FIRMWARE or APCMODEL. Some representative values a...
# D 106 103 100 097
# M 177 172 168 182
# A 092 090 088 086
# I 208 204 200 196 (default = 0 => not valid)
#LOTRANSFER 208
# High line voltage causing transfer to batteries
# The permitted values depend on your model as defined b...
# of FIRMWARE or APCMODEL. Some representative values a...
# D 127 130 133 136
# M 229 234 239 224
# A 108 110 112 114
# I 253 257 261 265 (default = 0 => not valid)
#HITRANSFER 253
# Battery charge needed to restore power
# RETURNCHARGE 00 15 50 90 (default = 15)
#RETURNCHARGE 15
# Alarm delay
# 0 = zero delay after pwr fail, T = power fail + 30 sec...
# BEEPSTATE 0 T L N (default = 0)
#BEEPSTATE T
# Low battery warning delay in minutes
# LOWBATT 02 05 07 10 (default = 02)
#LOWBATT 2
# UPS Output voltage when running on batteries
# The permitted values depend on your model as defined b...
# of FIRMWARE or APCMODEL. Some representative values a...
# D 115
# M 208
# A 100
# I 230 240 220 225 (default = 0 => not valid)
#OUTPUTVOLTS 230
# Self test interval in hours 336=2 weeks, 168=1 week, O...
# SELFTEST 336 168 ON OFF (default = 336)
#SELFTEST 336
<
**CGI [#gb61fed1]
>
<
***CGIの設定 [#s6f3a188]
>
>監視対象のホストを設定します。
-/etc/apcupsd/hosts.conf
# Network UPS Tools - hosts.conf
#
# This file does double duty - it lists the systems that...
# monitor, and also specifies the systems that upsstats ...
# watch. It keeps people from feeding random addresses ...
# among other things. upsimage also uses this file to k...
# may speak to. upsfstats too.
#
# Usage: list systems running upsd that you want to moni...
#
# MONITOR <address> "<host description>"
#
# Please note, MONITOR must start in column 1 (no spaces...
#
# Example:
# MONITOR 10.64.1.1 "Finance department"
# MONITOR 10.78.1.1 "Sierra High School data room #1"
#
#MONITOR 127.0.0.1 "Local Host"
MONITOR 192.168.0.220 "Sakura"
<
***CGIの改造 [#oddea7a3]
>
>インストールされたCGIは一々、multimon.cgiを指定する必要...
-/etc/http/conf.d/apcupsd.conf
ScriptAliasMatch ^/apcupsd/(index.html)$ /var/www/apcups...
ScriptAliasMatch ^/apcupsd/(.*).cgi$ /var/www/apcupsd/cg...
Alias /apcupsd/ /var/www/apcupsd/
<Directory /var/www/apcupsd/>
DirectoryIndex index.html
order deny,allow
deny from all
allow from all
AuthType Digest
AuthName "ProtectedZone"
AuthUserFile /etc/httpd/.htdigest
Require valid-user
</Directory>
<Directory /var/www/apcupsd/cgi-bin/>
DirectoryIndex multimon.cgi upsstats.cgi
Options +ExecCGI +FollowSymLinks
AddHandler cgi-script .cgi .pl
</Directory>
<
終了行:
*&aname(apcupsd){APCUPSD}; [#p4c6f7e2]
>
>APC製UPSの制御・監視ソフトウェアの設定の備忘録です。
<
**ソフトウェア概要 [#t9ec99b1]
>
>apcupsdはLinux以外のOS(Windows等)に対応し、さらにネッ...
>以前のパッケージは、WebベースのGUIツールも同梱されていま...
|パッケージ|概要|記事|h
|apcupsd|apcupsd本体です。デーモンとapctestツールがインス...
|apcupsd-cgi|Webベースの監視が可能なツールです。Apacheの/...
|apcupsd-gui|GnomeのWidgetです。ノートPCの電源管理のよう...
<
**デーモンの設定 [#g184c60b]
***UPSが接続されているMaster(サーバ)の設定 [#z2802466]
>
>ネットワークを経由してUPSを共有するサーバ間の連携を行う...
>以下がUPSとUSB接続をしているマスターの設定。NETSERVER on...
-/etc/apcupsd/apcupsd.conf
## apcupsd.conf v1.1 ##
#
# for apcupsd release 3.14.10 (13 September 2011) - red...
#
# "apcupsd" POSIX config file
#
# ========= General configuration parameters ============
#
# UPSNAME xxx
# Use this to give your UPS a name in log files and su...
# is particulary useful if you have multiple UPSes. Th...
# set the EEPROM. It should be 8 characters or less.
UPSNAME Smart-UPS 1000
# UPSCABLE <cable>
# Defines the type of cable connecting the UPS to your...
#
# Possible generic choices for <cable> 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 usb
# To get apcupsd to work, in addition to defining the ca...
# above, you must also define a UPSTYPE, which correspon...
# the type of UPS you have (see the Description for more...
# You must also specify a DEVICE, sometimes referred to ...
# For USB UPSes, please leave the DEVICE directive blank...
# other UPS types, you must specify an appropriate port ...
#
# UPSTYPE DEVICE Description
# apcsmart /dev/tty** Newer serial character devi...
# SmartUPS models using a ser...
#
# usb <BLANK> Most new UPSes are USB. A b...
# setting enables autodetecti...
# the best choice for most in...
#
# net hostname:port Network link to a master ap...
# Network Information Server....
# UPS powering your computer ...
# different computer for moni...
#
# snmp hostname:port:vendor:community
# SNMP network link to an SNM...
# Hostname is the ip address ...
# on the network. Vendor can ...
# "APC_NOTRAP". "APC_NOTRAP" ...
# catching; you usually want ...
# 161. Community is usually "...
#
# netsnmp hostname:port:vendor:community
# OBSOLETE
# Same as SNMP above but requ...
# net-snmp library. Unless yo...
# for this old driver, you sh...
#
# dumb /dev/tty** Old serial character device...
# simple-signaling UPSes.
#
# pcnet ipaddr:username:passphrase:port
# PowerChute Network Shutdown...
# used as an alternative to S...
# family of smart slot cards....
# address of the UPS manageme...
# passphrase are the credenti...
# has been configured. port i...
# which to listen for message...
# 3052. If this parameter is ...
# default of 3052 will be used.
#
#UPSTYPE apcsmart
#DEVICE /dev/ttyUSB0
UPSTYPE usb
# POLLTIME <int>
# Interval (in seconds) at which apcupsd polls the UPS...
# setting applies both to directly-attached UPSes (UPS...
# dumb) and networked UPSes (UPSTYPE net, snmp). Lower...
# will improve apcupsd's responsiveness to certain eve...
# higher CPU utilization. The default of 60 is appropr...
# situations.
#POLLTIME 60
# LOCKFILE <path to lockfile>
# Path for device lock file. Not used on Win32.
LOCKFILE /var/lock
# SCRIPTDIR <path to script directory>
# Directory in which apccontrol and event scripts are ...
SCRIPTDIR /etc/apcupsd
# PWRFAILDIR <path to powerfail directory>
# Directory in which to write the powerfail flag file....
# is created when apcupsd initiates a system shutdown ...
# checked in the OS halt scripts to determine if a kil...
# (turning off UPS output power) is required.
PWRFAILDIR /etc/apcupsd
# NOLOGINDIR <path to nologin directory>
# Directory in which to write the nologin file. The ex...
# of this flag file tells the OS to disallow new logins.
NOLOGINDIR /etc
#
# ======== Configuration parameters used during power fa...
#
# The ONBATTERYDELAY is the time in seconds from when a ...
# is detected until we react to it with an onbattery e...
#
# This means that, apccontrol will be called with the ...
# immediately when a power failure is detected. Howev...
# onbattery argument is passed to apccontrol only afte...
# ONBATTERYDELAY time. If you don't want to be annoye...
# powerfailures, make sure that apccontrol powerout do...
# i.e. comment out the wall.
ONBATTERYDELAY 6
#
# Note: BATTERYLEVEL, MINUTES, and TIMEOUT work in conju...
# the first that occurs will cause the initation of a sh...
#
# If during a power failure, the remaining battery perce...
# (as reported by the UPS) is below or equal to BATTERYL...
# apcupsd will initiate a system shutdown.
BATTERYLEVEL 5
# If during a power failure, the remaining runtime in mi...
# (as calculated internally by the UPS) is below or equa...
# apcupsd, will initiate a system shutdown.
MINUTES 3
# If during a power failure, the UPS has run on batterie...
# many seconds or longer, apcupsd will initiate a system...
# A value of 0 disables this timer.
#
# Note, if you have a Smart UPS, you will most likely w...
# this timer by setting it to zero. That way, you UPS...
# on batteries until either the % charge remaing drop...
# or the remaining battery runtime drops to or below ...
# if you are testing, setting this to 60 causes a qui...
# if you pull the power plug.
# If you have an older dumb UPS, you will want to set t...
# the time you know you can run on batteries.
TIMEOUT 0
# Time in seconds between annoying users to signoff pri...
# system shutdown. 0 disables.
ANNOY 300
# Initial delay after power failure before warning users...
# off the system.
ANNOYDELAY 60
# The condition which determines when users are prevente...
# logging in during a power failure.
# NOLOGON <string> [ disable | timeout | percent | minut...
NOLOGON disable
# If KILLDELAY is non-zero, apcupsd will continue runnin...
# shutdown has been requested, and after the specified t...
# seconds attempt to kill the power. This is for use on ...
# where apcupsd cannot regain control after a shutdown.
# KILLDELAY <seconds> 0 disables
KILLDELAY 0
#
# ==== Configuration statements for Network Information ...
#
# NETSERVER [ on | off ] on enables, off disables the ne...
# information server. If netstatus is on, a network inf...
# server process will be started for serving the STATUS...
# EVENT data over the network (used by CGI programs).
NETSERVER on
# NISIP <dotted notation ip address>
# IP address on which NIS server will listen for incomi...
# This is useful if your server is multi-homed (has mor...
# network interface and IP address). Default value is 0...
# means any incoming request will be serviced. Alternat...
# configure this setting to any specific IP address of ...
# NIS will listen for connections only on that interfac...
# loopback address (127.0.0.1) to accept connections on...
# local machine.
NISIP 0.0.0.0
# NISPORT <port> default is 3551 as registered with the ...
# port to use for sending STATUS and EVENTS data over t...
# It is not used unless NETSERVER is on. If you change ...
# you will need to change the corresponding value in th...
# and rebuild the cgi programs.
NISPORT 3551
# If you want the last few EVENTS to be available over t...
# by the network information server, you must define an ...
EVENTSFILE /var/log/apcupsd.events
# EVENTSFILEMAX <kilobytes>
# By default, the size of the EVENTSFILE will be not be...
# 10 kilobytes. When the file grows beyond this limit,...
# be removed from the beginning of the file (first in f...
# parameter EVENTSFILEMAX can be set to a different kil...
# to zero to allow the EVENTSFILE to grow without limit.
EVENTSFILEMAX 10
#
# ========== Configuration statements used if sharing ==...
# a UPS with more than one machine
#
# Remaining items are for ShareUPS (APC expansion card) ...
#
# UPSCLASS [ standalone | shareslave | sharemaster ]
# Normally standalone unless you share an UPS using an...
# card.
UPSCLASS standalone
# UPSMODE [ disable | share ]
# Normally disable unless you share an UPS using an AP...
UPSMODE disable
#
# ===== Configuration statements to control apcupsd syst...
#
# Time interval in seconds between writing the STATUS fi...
STATTIME 0
# Location of STATUS file (written to only if STATTIME i...
STATFILE /var/log/apcupsd.status
# LOGSTATS [ on | off ] on enables, off disables
# Note! This generates a lot of output, so if
# you turn this on, be sure that the
# file defined in syslog.conf for LOG_NOTICE is a ...
# You probably do not want this on.
LOGSTATS off
# Time interval in seconds between writing the DATA reco...
# the log file. 0 disables.
DATATIME 0
# FACILITY defines the logging facility (class) for logg...
# If not specified, it defaults to "daemon". Th...
# if you want to separate the data logged by ap...
# programs.
#FACILITY DAEMON
#
# ========== Configuration statements used in updating t...
#
#
# These statements are used only by apctest when choosin...
# file values" from the EEPROM menu. THESE STATEMENTS HA...
#
# UPS name, max 8 characters
UPSNAME UPS-1000
# Battery date - 8 characters
#BATTDATE mm/dd/yy
BATTDATE 14/05/09
# Sensitivity to line voltage quality (H cause faster tr...
# SENSITIVITY H M L (default = H)
SENSITIVITY H
# UPS delay after power return (seconds)
# WAKEUP 000 060 180 300 (default = 0)
#WAKEUP 60
# UPS Grace period after request to power off (seconds)
# SLEEP 020 180 300 600 (default = 20)
#SLEEP 180
# Low line voltage causing transfer to batteries
# The permitted values depend on your model as defined b...
# of FIRMWARE or APCMODEL. Some representative values a...
# D 106 103 100 097
# M 177 172 168 182
# A 092 090 088 086
# I 208 204 200 196 (default = 0 => not valid)
#LOTRANSFER 208
# High line voltage causing transfer to batteries
# The permitted values depend on your model as defined b...
# of FIRMWARE or APCMODEL. Some representative values a...
# D 127 130 133 136
# M 229 234 239 224
# A 108 110 112 114
# I 253 257 261 265 (default = 0 => not valid)
#HITRANSFER 253
# Battery charge needed to restore power
# RETURNCHARGE 00 15 50 90 (default = 15)
#RETURNCHARGE 15
# Alarm delay
# 0 = zero delay after pwr fail, T = power fail + 30 sec...
# BEEPSTATE 0 T L N (default = 0)
#BEEPSTATE T
# Low battery warning delay in minutes
# LOWBATT 02 05 07 10 (default = 02)
#LOWBATT 2
# UPS Output voltage when running on batteries
# The permitted values depend on your model as defined b...
# of FIRMWARE or APCMODEL. Some representative values a...
# D 115
# M 208
# A 100
# I 230 240 220 225 (default = 0 => not valid)
#OUTPUTVOLTS 230
# Self test interval in hours 336=2 weeks, 168=1 week, O...
# SELFTEST 336 168 ON OFF (default = 336)
#SELFTEST 336
<
***ネットワークで接続されているSlaveの設定 [#kf12d05c]
>
>Slave側はMasterのIPアドレスを設定する(ポート番号も一緒)
-/etc/apcupsd/apcupsd.conf
## apcupsd.conf v1.1 ##
#
# for apcupsd release 3.14.12 (29 March 2014) - redhat
#
# "apcupsd" POSIX config file
#
# ========= General configuration parameters ============
#
# UPSNAME xxx
# Use this to give your UPS a name in log files and su...
# is particulary useful if you have multiple UPSes. Th...
# set the EEPROM. It should be 8 characters or less.
#UPSNAME
UPSNAME Smart-UPS 1000
# UPSCABLE <cable>
# Defines the type of cable connecting the UPS to your...
#
# Possible generic choices for <cable> 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, 940-0625A, M-04-02-2000
#
#UPSCABLE usb
UPSCABLE ether
# To get apcupsd to work, in addition to defining the ca...
# above, you must also define a UPSTYPE, which correspon...
# the type of UPS you have (see the Description for more...
# You must also specify a DEVICE, sometimes referred to ...
# For USB UPSes, please leave the DEVICE directive blank...
# other UPS types, you must specify an appropriate port ...
#
# UPSTYPE DEVICE Description
# apcsmart /dev/tty** Newer serial character devi...
# SmartUPS models using a ser...
#
# usb <BLANK> Most new UPSes are USB. A b...
# setting enables autodetecti...
# the best choice for most in...
#
# net hostname:port Network link to a master ap...
# Network Information Server....
# UPS powering your computer ...
# different computer for moni...
#
# snmp hostname:port:vendor:community
# SNMP network link to an SNM...
# Hostname is the ip address ...
# on the network. Vendor can ...
# "APC_NOTRAP". "APC_NOTRAP" ...
# catching; you usually want ...
# 161. Community is usually "...
#
# netsnmp hostname:port:vendor:community
# OBSOLETE
# Same as SNMP above but requ...
# net-snmp library. Unless yo...
# for this old driver, you sh...
#
# dumb /dev/tty** Old serial character device...
# simple-signaling UPSes.
#
# pcnet ipaddr:username:passphrase:port
# PowerChute Network Shutdown...
# used as an alternative to S...
# family of smart slot cards....
# address of the UPS manageme...
# passphrase are the credenti...
# has been configured. port i...
# which to listen for message...
# 3052. If this parameter is ...
# default of 3052 will be used.
#
# modbus /dev/tty** Serial device for use with ...
# supporting the MODBUS proto...
#
#UPSTYPE usb
#DEVICE
UPSTYPE net
DEVICE 192.168.0.220:3551
# POLLTIME <int>
# Interval (in seconds) at which apcupsd polls the UPS...
# setting applies both to directly-attached UPSes (UPS...
# dumb) and networked UPSes (UPSTYPE net, snmp). Lower...
# will improve apcupsd's responsiveness to certain eve...
# higher CPU utilization. The default of 60 is appropr...
# situations.
#POLLTIME 60
# LOCKFILE <path to lockfile>
# Path for device lock file. Not used on Win32.
LOCKFILE /var/lock
# SCRIPTDIR <path to script directory>
# Directory in which apccontrol and event scripts are ...
SCRIPTDIR /etc/apcupsd
# PWRFAILDIR <path to powerfail directory>
# Directory in which to write the powerfail flag file....
# is created when apcupsd initiates a system shutdown ...
# checked in the OS halt scripts to determine if a kil...
# (turning off UPS output power) is required.
PWRFAILDIR /etc/apcupsd
# NOLOGINDIR <path to nologin directory>
# Directory in which to write the nologin file. The ex...
# of this flag file tells the OS to disallow new logins.
NOLOGINDIR /etc
#
# ======== Configuration parameters used during power fa...
#
# The ONBATTERYDELAY is the time in seconds from when a ...
# is detected until we react to it with an onbattery e...
#
# This means that, apccontrol will be called with the ...
# immediately when a power failure is detected. Howev...
# onbattery argument is passed to apccontrol only afte...
# ONBATTERYDELAY time. If you don't want to be annoye...
# powerfailures, make sure that apccontrol powerout do...
# i.e. comment out the wall.
ONBATTERYDELAY 6
#
# Note: BATTERYLEVEL, MINUTES, and TIMEOUT work in conju...
# the first that occurs will cause the initation of a sh...
#
# If during a power failure, the remaining battery perce...
# (as reported by the UPS) is below or equal to BATTERYL...
# apcupsd will initiate a system shutdown.
BATTERYLEVEL 5
# If during a power failure, the remaining runtime in mi...
# (as calculated internally by the UPS) is below or equa...
# apcupsd, will initiate a system shutdown.
MINUTES 3
# If during a power failure, the UPS has run on batterie...
# many seconds or longer, apcupsd will initiate a system...
# A value of 0 disables this timer.
#
# Note, if you have a Smart UPS, you will most likely w...
# this timer by setting it to zero. That way, you UPS...
# on batteries until either the % charge remaing drop...
# or the remaining battery runtime drops to or below ...
# if you are testing, setting this to 60 causes a qui...
# if you pull the power plug.
# If you have an older dumb UPS, you will want to set t...
# the time you know you can run on batteries.
TIMEOUT 0
# Time in seconds between annoying users to signoff pri...
# system shutdown. 0 disables.
ANNOY 300
# Initial delay after power failure before warning users...
# off the system.
ANNOYDELAY 60
# The condition which determines when users are prevente...
# logging in during a power failure.
# NOLOGON <string> [ disable | timeout | percent | minut...
NOLOGON disable
# If KILLDELAY is non-zero, apcupsd will continue runnin...
# shutdown has been requested, and after the specified t...
# seconds attempt to kill the power. This is for use on ...
# where apcupsd cannot regain control after a shutdown.
# KILLDELAY <seconds> 0 disables
KILLDELAY 0
#
# ==== Configuration statements for Network Information ...
#
# NETSERVER [ on | off ] on enables, off disables the ne...
# information server. If netstatus is on, a network inf...
# server process will be started for serving the STATUS...
# EVENT data over the network (used by CGI programs).
NETSERVER on
# NISIP <dotted notation ip address>
# IP address on which NIS server will listen for incomi...
# This is useful if your server is multi-homed (has mor...
# network interface and IP address). Default value is 0...
# means any incoming request will be serviced. Alternat...
# configure this setting to any specific IP address of ...
# NIS will listen for connections only on that interfac...
# loopback address (127.0.0.1) to accept connections on...
# local machine.
NISIP 0.0.0.0
# NISPORT <port> default is 3551 as registered with the ...
# port to use for sending STATUS and EVENTS data over t...
# It is not used unless NETSERVER is on. If you change ...
# you will need to change the corresponding value in th...
# and rebuild the cgi programs.
NISPORT 3551
# If you want the last few EVENTS to be available over t...
# by the network information server, you must define an ...
EVENTSFILE /var/log/apcupsd.events
# EVENTSFILEMAX <kilobytes>
# By default, the size of the EVENTSFILE will be not be...
# 10 kilobytes. When the file grows beyond this limit,...
# be removed from the beginning of the file (first in f...
# parameter EVENTSFILEMAX can be set to a different kil...
# to zero to allow the EVENTSFILE to grow without limit.
EVENTSFILEMAX 10
#
# ========== Configuration statements used if sharing ==...
# a UPS with more than one machine
#
# Remaining items are for ShareUPS (APC expansion card) ...
#
# UPSCLASS [ standalone | shareslave | sharemaster ]
# Normally standalone unless you share an UPS using an...
# card.
UPSCLASS standalone
# UPSMODE [ disable | share ]
# Normally disable unless you share an UPS using an AP...
UPSMODE disable
#
# ===== Configuration statements to control apcupsd syst...
#
# Time interval in seconds between writing the STATUS fi...
STATTIME 0
# Location of STATUS file (written to only if STATTIME i...
STATFILE /var/log/apcupsd.status
# LOGSTATS [ on | off ] on enables, off disables
# Note! This generates a lot of output, so if
# you turn this on, be sure that the
# file defined in syslog.conf for LOG_NOTICE is a ...
# You probably do not want this on.
LOGSTATS off
# Time interval in seconds between writing the DATA reco...
# the log file. 0 disables.
DATATIME 0
# FACILITY defines the logging facility (class) for logg...
# If not specified, it defaults to "daemon". Th...
# if you want to separate the data logged by ap...
# programs.
#FACILITY DAEMON
#
# ========== Configuration statements used in updating t...
#
#
# These statements are used only by apctest when choosin...
# file values" from the EEPROM menu. THESE STATEMENTS HA...
#
# UPS name, max 8 characters
#UPSNAME UPS_IDEN
# Battery date - 8 characters
#BATTDATE mm/dd/yy
# Sensitivity to line voltage quality (H cause faster tr...
# SENSITIVITY H M L (default = H)
#SENSITIVITY H
# UPS delay after power return (seconds)
# WAKEUP 000 060 180 300 (default = 0)
#WAKEUP 60
# UPS Grace period after request to power off (seconds)
# SLEEP 020 180 300 600 (default = 20)
#SLEEP 180
# Low line voltage causing transfer to batteries
# The permitted values depend on your model as defined b...
# of FIRMWARE or APCMODEL. Some representative values a...
# D 106 103 100 097
# M 177 172 168 182
# A 092 090 088 086
# I 208 204 200 196 (default = 0 => not valid)
#LOTRANSFER 208
# High line voltage causing transfer to batteries
# The permitted values depend on your model as defined b...
# of FIRMWARE or APCMODEL. Some representative values a...
# D 127 130 133 136
# M 229 234 239 224
# A 108 110 112 114
# I 253 257 261 265 (default = 0 => not valid)
#HITRANSFER 253
# Battery charge needed to restore power
# RETURNCHARGE 00 15 50 90 (default = 15)
#RETURNCHARGE 15
# Alarm delay
# 0 = zero delay after pwr fail, T = power fail + 30 sec...
# BEEPSTATE 0 T L N (default = 0)
#BEEPSTATE T
# Low battery warning delay in minutes
# LOWBATT 02 05 07 10 (default = 02)
#LOWBATT 2
# UPS Output voltage when running on batteries
# The permitted values depend on your model as defined b...
# of FIRMWARE or APCMODEL. Some representative values a...
# D 115
# M 208
# A 100
# I 230 240 220 225 (default = 0 => not valid)
#OUTPUTVOLTS 230
# Self test interval in hours 336=2 weeks, 168=1 week, O...
# SELFTEST 336 168 ON OFF (default = 336)
#SELFTEST 336
<
**CGI [#gb61fed1]
>
<
***CGIの設定 [#s6f3a188]
>
>監視対象のホストを設定します。
-/etc/apcupsd/hosts.conf
# Network UPS Tools - hosts.conf
#
# This file does double duty - it lists the systems that...
# monitor, and also specifies the systems that upsstats ...
# watch. It keeps people from feeding random addresses ...
# among other things. upsimage also uses this file to k...
# may speak to. upsfstats too.
#
# Usage: list systems running upsd that you want to moni...
#
# MONITOR <address> "<host description>"
#
# Please note, MONITOR must start in column 1 (no spaces...
#
# Example:
# MONITOR 10.64.1.1 "Finance department"
# MONITOR 10.78.1.1 "Sierra High School data room #1"
#
#MONITOR 127.0.0.1 "Local Host"
MONITOR 192.168.0.220 "Sakura"
<
***CGIの改造 [#oddea7a3]
>
>インストールされたCGIは一々、multimon.cgiを指定する必要...
-/etc/http/conf.d/apcupsd.conf
ScriptAliasMatch ^/apcupsd/(index.html)$ /var/www/apcups...
ScriptAliasMatch ^/apcupsd/(.*).cgi$ /var/www/apcupsd/cg...
Alias /apcupsd/ /var/www/apcupsd/
<Directory /var/www/apcupsd/>
DirectoryIndex index.html
order deny,allow
deny from all
allow from all
AuthType Digest
AuthName "ProtectedZone"
AuthUserFile /etc/httpd/.htdigest
Require valid-user
</Directory>
<Directory /var/www/apcupsd/cgi-bin/>
DirectoryIndex multimon.cgi upsstats.cgi
Options +ExecCGI +FollowSymLinks
AddHandler cgi-script .cgi .pl
</Directory>
<
ページ名: