<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
		xmlns:xhtml="http://www.w3.org/1999/xhtml"
>

<channel>
	<title>clicktx::Tech::Memo &#187; APC</title>
	<atom:link href="http://perl.no-tubo.net/tag/apc/feed/" rel="self" type="application/rss+xml" />
	<link>http://perl.no-tubo.net</link>
	<description>perl、 MySQL、オープンソース系、ウェブ系ネタ。なぜか鯖管メモがほとんどを占めている...</description>
	<lastBuildDate>Mon, 23 Jan 2012 10:51:51 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://perl.no-tubo.net/tag/apc/feed/" />
		<item>
		<title>apcupsdのシャットダウン時のログ</title>
		<link>http://perl.no-tubo.net/2011/03/16/apcupsd%e3%81%ae%e3%82%b7%e3%83%a3%e3%83%83%e3%83%88%e3%83%80%e3%82%a6%e3%83%b3%e6%99%82%e3%81%ae%e3%83%ad%e3%82%b0/</link>
		<comments>http://perl.no-tubo.net/2011/03/16/apcupsd%e3%81%ae%e3%82%b7%e3%83%a3%e3%83%83%e3%83%88%e3%83%80%e3%82%a6%e3%83%b3%e6%99%82%e3%81%ae%e3%83%ad%e3%82%b0/#comments</comments>
		<pubDate>Wed, 16 Mar 2011 00:35:51 +0000</pubDate>
		<dc:creator>clicktx</dc:creator>
				<category><![CDATA[サーバ管理]]></category>
		<category><![CDATA[APC]]></category>
		<category><![CDATA[UPS]]></category>

		<guid isPermaLink="false">http://perl.no-tubo.net/?p=1510</guid>
		<description><![CDATA[震災の影響で停電になった時に残っていたログ。
apcupsdのeventsログ
2011-03-11 14:48:20 +0900  Power failure.
2011-03-11 14:48:26 +0900  R [...]]]></description>
			<content:encoded><![CDATA[<p>震災の影響で停電になった時に残っていたログ。</p>
<p>apcupsdのeventsログ</p>
<pre>2011-03-11 14:48:20 +0900  Power failure.
2011-03-11 14:48:26 +0900  Running on UPS batteries.
2011-03-11 15:41:07 +0900  Battery power exhausted.
2011-03-11 15:41:07 +0900  Initiating system shutdown!
2011-03-11 15:41:07 +0900  User logins prohibited
2011-03-11 15:42:22 +0900  apcupsd exiting, signal 15
2011-03-11 15:42:22 +0900  apcupsd shutdown succeeded</pre>
]]></content:encoded>
			<wfw:commentRss>http://perl.no-tubo.net/2011/03/16/apcupsd%e3%81%ae%e3%82%b7%e3%83%a3%e3%83%83%e3%83%88%e3%83%80%e3%82%a6%e3%83%b3%e6%99%82%e3%81%ae%e3%83%ad%e3%82%b0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://perl.no-tubo.net/2011/03/16/apcupsd%e3%81%ae%e3%82%b7%e3%83%a3%e3%83%83%e3%83%88%e3%83%80%e3%82%a6%e3%83%b3%e6%99%82%e3%81%ae%e3%83%ad%e3%82%b0/" />
	</item>
		<item>
		<title>電源管理 APCUPSDインストール</title>
		<link>http://perl.no-tubo.net/2009/09/18/%e9%9b%bb%e6%ba%90%e7%ae%a1%e7%90%86-apcupsd%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab/</link>
		<comments>http://perl.no-tubo.net/2009/09/18/%e9%9b%bb%e6%ba%90%e7%ae%a1%e7%90%86-apcupsd%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab/#comments</comments>
		<pubDate>Fri, 18 Sep 2009 09:07:28 +0000</pubDate>
		<dc:creator>clicktx</dc:creator>
				<category><![CDATA[サーバ管理]]></category>
		<category><![CDATA[APC]]></category>
		<category><![CDATA[UPS]]></category>

		<guid isPermaLink="false">http://pet.no-tubo.net/?p=169</guid>
		<description><![CDATA[ネット上で検索した文書だとうまく設定出来なかったのでメモ。
LAN経由のコントロールでも NETPORT や MASTER 、 SLAVE などの設定項目は無かった。
バージョンの違い？

１台のUPSで３台のマシンに電 [...]]]></description>
			<content:encoded><![CDATA[<p>ネット上で検索した文書だとうまく設定出来なかったのでメモ。<br />
LAN経由のコントロールでも NETPORT や MASTER 、 SLAVE などの設定項目は無かった。<br />
バージョンの違い？</p>
<ul>
<li>１台のUPSで３台のマシンに電源を供給。</li>
<li>３台のマシンのうち１台をマスターとし、残り２台をスレーブとする。</li>
<li>UPSへの接続はマスターがUSBでスレーブはEthernet(LAN)とする。</li>
</ul>
<p>環境：CentOS 5.3 x1台＋CentOS4.8 x2台<br />
UPS：APC UPS-1500</p>
<h3>apcupsdインストール</h3>
<blockquote><p>yum install apcupsd</p></blockquote>
<p>※rpmforgeの導入が必要<br />
インストールされたバージョンは<br />
apcupsd release 3.14.3 (20 January 2008) &#8211; redhat</p>
<p>2011-01-29更新<br />
UPSCLASS と UPSMODE はオプションのAPC expansion cardを取り付けていて複数のUPSをコントロールする場合に設定するようだ。以前の設定（UPSCLASS sharemaster）同一ネットワーク上に複数のUPSを置いて、USBで接続するとうまくいかない。shareslave にしてもダメ。</p>
<h3>マスター設定（/etc/apcupsd/apcupsd.conf）</h3>
<pre># 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.
 <span style="color: #ff9900;">UPSNAME APC_UPS_1500 ←修正（好きな名前に）</span>
# 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
#
<span style="color: #ff9900;"> UPSCABLE usb ←修正</span>

# 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.
#
<span style="color: #ff9900;"> UPSTYPE usb ←修正</span>
<span style="color: #ff9900;"> DEVICE ←修正</span>

# NETTIME
#   Interval (in seconds) at which the NIS client polls the server.
#   Used only when this apcupsd is a network client (UPSTYPE net).
<span style="color: #ff9900;"> NETTIME 60 ←コメント削除</span>

#
# ========== Configuration statements used if sharing =============
#            a UPS with more than one machine

#
# Remaining items are for ShareUPS (APC expansion card) ONLY
#

# UPSCLASS [ standalone | shareslave | sharemaster ]
#   Normally standalone unless you share an UPS using an APC ShareUPS
#   card.
<del datetime="2011-01-29T00:48:19+00:00"><span style="color: #ff9900;"> UPSCLASS sharemaster ←修正</span></del>
<span style="color: #ff9900;"> UPSCLASS standalone ←修正</span>

# UPSMODE [ disable | share ]
#   Normally disable unless you share an UPS using an APC ShareUPS card.
<del datetime="2011-01-29T00:48:19+00:00"><span style="color: #ff9900;"> UPSMODE share←修正</span></del>
<span style="color: #ff9900;"> UPSMODE disable ←修正</span>
</pre>
<p>起動：<br />
/etc/rc.d/init.d/apcupsd start</p>
<p>ステータス確認：<br />
/sbin/apcaccess status</p>
<p>自動起動設定：<br />
chkconfig apcupsd on</p>
<h3>スレーブ側：</h3>
<pre># 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
#
<span style="color: #ff9900;"> UPSCABLE ether ←修正</span>
# 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.
#
<span style="color: #ff9900;"> UPSTYPE net ←修正</span>
<span style="color: #ff9900;"> DEVICE 192.168.1.xxx ←マスターのIPアドレス</span>

# NETTIME
#   Interval (in seconds) at which the NIS client polls the server.
#   Used only when this apcupsd is a network client (UPSTYPE net).
<span style="color: #ff9900;"> NETTIME 60 ←コメント削除</span>

#
# Remaining items are for ShareUPS (APC expansion card) ONLY
#

#
# ========== Configuration statements used if sharing =============
#            a UPS with more than one machine

#
# Remaining items are for ShareUPS (APC expansion card) ONLY
#

# UPSCLASS [ standalone | shareslave | sharemaster ]
#   Normally standalone unless you share an UPS using an APC ShareUPS
#   card.
<del datetime="2011-01-29T00:48:19+00:00"><span style="color: #ff9900;"> UPSCLASS shareslave ←修正</span></del>
<span style="color: #ff9900;"> UPSCLASS standalone ←修正</span>

# UPSMODE [ disable | share ]
#   Normally disable unless you share an UPS using an APC ShareUPS card.
<del datetime="2011-01-29T00:48:19+00:00"><span style="color: #ff9900;"> UPSMODE share ←修正</span></del>
<span style="color: #ff9900;"> UPSMODE disable ←修正</span>
</pre>
<p>起動：<br />
/etc/rc.d/init.d/apcupsd start</p>
<p>ステータス確認：<br />
/sbin/apcaccess status</p>
<p>ステータスが表示されればOK?</p>
<h3>動作確認</h3>
<p>apcupsdはいずれかの条件が一つでも当てはまればシャットダウンを実行する。</p>
<ol>
<li>BATTERYLEVEL … バッテリー残が設定したパーセント以下になったら</li>
<li>MINUTES … バッテリー残が設定した分以下になったら</li>
<li>TIMEOUT … 商用電源からの供給が切れた時からの経過秒を過ぎたら</li>
</ol>
<p>マスターの設定を TIMEOUT 600（秒）に設定し、動作確認を行う。</p>
<p>マスターの設定はTIMEOUT のみ変更して、他はデフォルトのまま。</p>
<p>結果は５分超後、全てのサーバがシャットダウンされた。</p>
<h4>2010-11-12追記</h4>
<p>/etc/apcupsd/hosts.conf を編集して、http://管理サーバのIPアドレス/cgiのディレクトリ/multimon.cgi でweb上からそれぞれの状態を監視できる。</p>
<pre>vi /etc/apcupsd/hosts.conf</pre>
<pre># Network UPS Tools - hosts.conf
#
# This file does double duty - it lists the systems that multimon will
# monitor, and also specifies the systems that upsstats is allowed to
# watch.  It keeps people from feeding random addresses to upsstats,
# among other things.  upsimage also uses this file to know who it
# may speak to. upsfstats too.
#
# Usage: list systems running upsd that you want to monitor
#
# MONITOR
<address> ""
#
# Please note, MONITOR must start in column 1 (no spaces permitted)
#
# Example:
# MONITOR 10.64.1.1 "Finance department"
# MONITOR 10.78.1.1 "Sierra High School data room #1"
#
<span style="color: #ff6600;">MONITOR 127.0.0.1 "Local Host"
MONITOR 192.168.1.2 "Web server"
MONITOR 192.168.1.3 "DB server"</span>
</address>
</pre>
<p>参考：<a href="http://www.hamabo.org/2010/04/11/apcupsd-network-monitoring/">Apcupsd Network Monitoring –  Hamabo&#8217;s Web</a></p>
<p>インストールにはこちらの記事もよさそう<br />
<a href="http://www.hamabo.org/2010/02/24/apcupsd-3-14-8-install-source/">停電対策としてApcupsd 3.14.8をインストールした時のメモ。 Vine Linux 5.0 Apcupsd 3.14.8 APC</a></p>
<h4>さらに追記</h4>
<p><a href="http://www.itmedia.co.jp/help/howto/linux/ups/index.html">ITmedia エンタープライズ：How-To：特別企画：UPSを利用した電源対策</a><br />
を見てたら、マスターとスレーブの設定が違う気がしてきた。実際に動作したのだからいいかと思うけど、、、。</p>
<blockquote><p># UPSCLASS [ standalone | shareslave | sharemaster ]<br />
# Normally standalone unless you share an UPS using an APC ShareUPS<br />
# card.<br />
UPSCLASS sharemaster ←修正</p>
<p># UPSMODE [ disable | share ]<br />
# Normally disable unless you share an UPS using an APC ShareUPS card.<br />
UPSMODE share ←修正</p></blockquote>
<p>この辺は違う気がする。</p>
<p><a href="http://local.lipwood.com/content/view/68/128/">Lipwood &#8211; Apcupsd 3.14.1～3.14.3のapcupsd.confの日本語訳</a><br />
を読むと合ってる気もする。UPSが複数ある時の設定なのかなぁ？</p>
]]></content:encoded>
			<wfw:commentRss>http://perl.no-tubo.net/2009/09/18/%e9%9b%bb%e6%ba%90%e7%ae%a1%e7%90%86-apcupsd%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	<xhtml:link rel="alternate" media="handheld" type="text/html" href="http://perl.no-tubo.net/2009/09/18/%e9%9b%bb%e6%ba%90%e7%ae%a1%e7%90%86-apcupsd%e3%82%a4%e3%83%b3%e3%82%b9%e3%83%88%e3%83%bc%e3%83%ab/" />
	</item>
	</channel>
</rss>

