<?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/"
	>

<channel>
	<title>perlとMysqlでCGI &#38; サーバ管理 漏れ的メモ &#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でCGIプログラミング。ウェブ運営の小技。鯖管メモもちょっとだけ。</description>
	<lastBuildDate>Fri, 10 Sep 2010 00:38:05 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>ja</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<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>admin</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>インストールされたバージョンは<br />
apcupsd release 3.14.3 (20 January 2008) &#8211; redhat</p>
<h3>マスター設定（/etc/apcupsd/apcupsd.conf）</h3>
<blockquote><p># UPSNAME xxx<br />
#   Use this to give your UPS a name in log files and such. This<br />
#   is particulary useful if you have multiple UPSes. This does not<br />
#   set the EEPROM. It should be 8 characters or less.<br />
<span style="color: #ff0000;"> UPSNAME APC_UPS_1500 ←修正（好きな名前に）</span><br />
# UPSCABLE<br />
#   Defines the type of cable connecting the UPS to your computer.<br />
#<br />
#   Possible generic choices for  are:<br />
#     simple, smart, ether, usb<br />
#<br />
#   Or a specific cable model number may be used:<br />
#     940-0119A, 940-0127A, 940-0128A, 940-0020B,<br />
#     940-0020C, 940-0023A, 940-0024B, 940-0024C,<br />
#     940-1524C, 940-0024G, 940-0095A, 940-0095B,<br />
#     940-0095C, M-04-02-2000<br />
#<br />
<span style="color: #ff0000;"> UPSCABLE usb ←修正</span></p>
<p># To get apcupsd to work, in addition to defining the cable<br />
# above, you must also define a UPSTYPE, which corresponds to<br />
# the type of UPS you have (see the Description for more details).<br />
# You must also specify a DEVICE, sometimes referred to as a port.<br />
# For USB UPSes, please leave the DEVICE directive blank. For<br />
# other UPS types, you must specify an appropriate port or address.<br />
#<br />
# UPSTYPE   DEVICE           Description<br />
# apcsmart  /dev/tty**       Newer serial character device,<br />
#                            appropriate for SmartUPS models using<br />
#                            a serial cable (not USB).<br />
#<br />
# usb                 Most new UPSes are USB. A blank DEVICE<br />
#                            setting enables autodetection, which is<br />
#                            the best choice for most installations.<br />
#<br />
# net       hostname:port    Network link to a master apcupsd<br />
#                            through apcupsd&#8217;s Network Information<br />
#                            Server. This is used if you don&#8217;t have<br />
#                            a UPS directly connected to your computer.<br />
#<br />
# snmp      hostname:port:vendor:community<br />
#                            SNMP Network link to an SNMP-enabled<br />
#                            UPS device. Vendor is the MIB used by<br />
#                            the UPS device: can be &#8220;APC&#8221;, &#8220;APC_NOTRAP&#8221;<br />
#                            or &#8220;RFC&#8221; where APC is the powernet MIB,<br />
#                            &#8220;APC_NOTRAP&#8221; is powernet with SNMP trap<br />
#                            catching disabled, and RFC is the IETF&#8217;s<br />
#                            rfc1628 UPS-MIB. You usually want &#8220;APC&#8221;.<br />
#                            Port is usually 161. Community is usually<br />
#                            &#8220;private&#8221;.<br />
#<br />
# dumb      /dev/tty**       Old serial character device for use<br />
#                            with simple-signaling UPSes.<br />
#<br />
# pcnet    ipaddr:username:passphrase<br />
#                            PowerChute Network Shutdown protocol<br />
#                            which can be used as an alternative to SNMP<br />
#                            with AP9617 family of smart slot cards.<br />
#                            ipaddr is the IP address of the UPS mgmt<br />
#                            card. username and passphrase are the<br />
#                            credentials for which the card has been<br />
#                            configured.<br />
#<br />
<span style="color: #ff0000;"> UPSTYPE usb ←修正</span><br />
<span style="color: #ff0000;"> DEVICE ←修正</span></p>
<p># NETTIME<br />
#   Interval (in seconds) at which the NIS client polls the server.<br />
#   Used only when this apcupsd is a network client (UPSTYPE net).<br />
<span style="color: #ff0000;"> NETTIME 60 ←コメント削除</span></p>
<p># UPSCLASS [ standalone | shareslave | sharemaster ]<br />
#   Normally standalone unless you share an UPS using an APC ShareUPS<br />
#   card.<br />
<span style="color: #ff0000;"> UPSCLASS sharemaster ←修正</span></p>
<p># UPSMODE [ disable | share ]<br />
#   Normally disable unless you share an UPS using an APC ShareUPS card.<br />
<span style="color: #ff0000;"> UPSMODE share ←修正</span></p></blockquote>
<p>起動：<br />
/etc/rc.d/init.d/apcupsd start</p>
<p>ステータス確認：<br />
/sbin/apcaccess status</p>
<p>自動起動設定：<br />
chkconfig apcupsd on</p>
<h3>スレーブ側：</h3>
<blockquote><p># UPSCABLE<br />
#   Defines the type of cable connecting the UPS to your computer.<br />
#<br />
#   Possible generic choices for  are:<br />
#     simple, smart, ether, usb<br />
#<br />
#   Or a specific cable model number may be used:<br />
#     940-0119A, 940-0127A, 940-0128A, 940-0020B,<br />
#     940-0020C, 940-0023A, 940-0024B, 940-0024C,<br />
#     940-1524C, 940-0024G, 940-0095A, 940-0095B,<br />
#     940-0095C, M-04-02-2000<br />
#<br />
<span style="color: #ff0000;"> UPSCABLE ether ←修正</span><br />
# To get apcupsd to work, in addition to defining the cable<br />
# above, you must also define a UPSTYPE, which corresponds to<br />
# the type of UPS you have (see the Description for more details).<br />
# You must also specify a DEVICE, sometimes referred to as a port.<br />
# For USB UPSes, please leave the DEVICE directive blank. For<br />
# other UPS types, you must specify an appropriate port or address.<br />
#<br />
# UPSTYPE   DEVICE           Description<br />
# apcsmart  /dev/tty**       Newer serial character device,<br />
#                            appropriate for SmartUPS models using<br />
#                            a serial cable (not USB).<br />
#<br />
# usb                 Most new UPSes are USB. A blank DEVICE<br />
#                            setting enables autodetection, which is<br />
#                            the best choice for most installations.<br />
#<br />
# net       hostname:port    Network link to a master apcupsd<br />
#                            through apcupsd&#8217;s Network Information<br />
#                            Server. This is used if you don&#8217;t have<br />
#                            a UPS directly connected to your computer.<br />
#<br />
# snmp      hostname:port:vendor:community<br />
#                            SNMP Network link to an SNMP-enabled<br />
#                            UPS device. Vendor is the MIB used by<br />
#                            the UPS device: can be &#8220;APC&#8221;, &#8220;APC_NOTRAP&#8221;<br />
#                            or &#8220;RFC&#8221; where APC is the powernet MIB,<br />
#                            &#8220;APC_NOTRAP&#8221; is powernet with SNMP trap<br />
#                            catching disabled, and RFC is the IETF&#8217;s<br />
#                            rfc1628 UPS-MIB. You usually want &#8220;APC&#8221;.<br />
#                            Port is usually 161. Community is usually<br />
#                            &#8220;private&#8221;.<br />
#<br />
# dumb      /dev/tty**       Old serial character device for use<br />
#                            with simple-signaling UPSes.<br />
#<br />
# pcnet    ipaddr:username:passphrase<br />
#                            PowerChute Network Shutdown protocol<br />
#                            which can be used as an alternative to SNMP<br />
#                            with AP9617 family of smart slot cards.<br />
#                            ipaddr is the IP address of the UPS mgmt<br />
#                            card. username and passphrase are the<br />
#                            credentials for which the card has been<br />
#                            configured.<br />
#<br />
<span style="color: #ff0000;"> UPSTYPE net ←修正</span><br />
<span style="color: #ff0000;"> DEVICE 192.168.1.xxx ←マスターのIPアドレス</span></p>
<p># NETTIME<br />
#   Interval (in seconds) at which the NIS client polls the server.<br />
#   Used only when this apcupsd is a network client (UPSTYPE net).<br />
<span style="color: #ff0000;"> NETTIME 60 ←コメント削除</span></p>
<p>#<br />
# Remaining items are for ShareUPS (APC expansion card) ONLY<br />
#</p>
<p># UPSCLASS [ standalone | shareslave | sharemaster ]<br />
#   Normally standalone unless you share an UPS using an APC ShareUPS<br />
#   card.<br />
<span style="color: #ff0000;"> UPSCLASS shareslave ←修正</span></p>
<p># UPSMODE [ disable | share ]<br />
#   Normally disable unless you share an UPS using an APC ShareUPS card.<br />
<span style="color: #ff0000;"> UPSMODE share ←修正</span></p></blockquote>
<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>
]]></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>0</slash:comments>
		</item>
	</channel>
</rss>
