个人工具

“UbuntuHelp:Apcupsd/zh”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
 
(未显示同一用户的4个中间版本)
第1行: 第1行:
{{Translation}}
+
{{Copyedit translation}}
 
{{From|https://help.ubuntu.com/community/apcupsd}}
 
{{From|https://help.ubuntu.com/community/apcupsd}}
 
{{Translator|Sareil}}
 
{{Translator|Sareil}}
 
{{Languages|UbuntuHelp:apcupsd}}
 
{{Languages|UbuntuHelp:apcupsd}}
Apcupsd is the daemon which will monitor your UPS to shutdown the system when the UPS' power is going to fail.  The homepage for apcupsd, http://www.apcupsd.com/, has very helpful documentation for doing complicated setups.
+
Appcupsd 是一个可以监视你的 UPS ,使其在电源断开时关闭系统的守护进程。Apcupsd 的主页,http://www.apcupsd.com/, 有非常有用的文档对于编译安装。
=== Prerequsites ===
+
 
* An APC UPS. Apcupsd works with most of APC's Smart-UPS models as well as most simple signalling models such a Back-UPS, and BackUPS-Office.
+
=== 前期准备 ===
=== Installation ===
+
* 一个 APC 的 UPS。Apcupsd 工作在大部分 APC Smart-UPS 型号上当然还有大部分单频信号传输型的比如 Back-UPS BackUPS-Office。
First of all, we have to install apcupsd package. Install the <code><nowiki>apcupsd</nowiki></code> package in the Synaptic Package Manager. See [[UbuntuHelp:SynapticHowto|SynapticHowto]]. If you want to see the stat of the UPS through the browser, you can also install <code><nowiki>apcupsd-cgi</nowiki></code> package.
+
 
Edit the file <code><nowiki>/etc/apcupsd/apcupsd.conf</nowiki></code> which by default includes good comments on usage:
+
=== 安装 ===
* For <code><nowiki>UPSCABLE</nowiki></code> you have to specify the type of cable connecting the UPS to your computer. Read the comments in the file to see which possibilities you have. For example, if the UPS used is the APC Back-UPS ES 700V, you have to write <code><nowiki>usb</nowiki></code>.
+
首先,我们要安装 apcupsd 软件包。在新立得软件包管理器里面安装<code><nowiki>apcupsd</nowiki></code> 软件包。如何安装一个软件包请查看 [[新立得使用指南|新立得使用指南]]。如果你想通过浏览器查看 UPS 的状态,你可以同时安装<code><nowiki>apcupsd-cgi</nowiki></code>软件包。
* You must also look for and modify the <code><nowiki>UPSTYPE</nowiki></code>.  The comments in the file describes the different possibilities available.  You may choose the appropriate one.  Again, from our example of an APC Back-UPS ES 700V, you would write <code><nowiki>usb</nowiki></code>.
+
 
* The final setting you must fix is <code><nowiki>DEVICE</nowiki></code>.  As the comments note, with a <code><nowiki>usb</nowiki></code> type UPS apcupsd can autodetect the device, so you should comment out the <code><nowiki>DEVICE</nowiki></code> setting (by putting a '#' in front of it). Otherwise, you will need to know which <code><nowiki>/dev</nowiki></code> node your device is connected to.  If your UPS cable is a serial type then your device may be something like <code><nowiki>/dev/ttyS0</nowiki></code>.
+
软件包安装完成后编辑文件<code><nowiki>/etc/apcupsd/apcupsd.conf</nowiki></code>,默认的 apcupsd.conf 中包含有一些不错的关于使用的注释:
Then you must edit the file <code><nowiki>/etc/default/apcupsd</nowiki></code> and change the <code><nowiki>no</nowiki></code> of the <code><nowiki>ISCONFIGURED</nowiki></code> with a <code><nowiki>yes</nowiki></code>.
+
*对于<code><nowiki>UPSCABLE</nowiki></code> 选项你应该指明 UPS 接入计算机的线缆类型。阅读文件中的注释来查看你可能是哪一种。举个例子,如果 UPS 使用的是 APC Back-UPS ES 700V,你应该写上<code><nowiki>usb</nowiki></code>
Once you have apcupsd configured, running and the device connected to your computer you will be able to check on the status of the device using the <code><nowiki>apcaccess</nowiki></code> command.  Output from the command will vary based on the type of UPS you have.  Most likely, the better the UPS the more detailed the information you will get.
+
* 你也必须查找和修改<code><nowiki>UPSTYPE</nowiki></code>选项。文件中描述了不同取值的区别。你可以选择最适合的一个。再以 APC Back-UPS ES 700V 为例,你应该写上 usb<code><nowiki>usb</nowiki></code>
Optionally, if you want your computer to reboot after a power fail, you must edit the <code><nowiki>/etc/init.d/halt</nowiki></code> due a bug that it has. You must change the <code><nowiki>poweroff="-p"</nowiki></code> with <code><nowiki>poweroff=""</nowiki></code>
+
* 最后你必须做的设置是<code><nowiki>DEVICE</nowiki></code>。注释上有说明,对于一个<code><nowiki>usb</nowiki></code>类型的 UPS,apcupsd 是能够自动探测到的,所以你应该注释掉 <code><nowiki>DEVICE</nowiki></code> 一项的设置(在 DEVICE 一行前添加一个 ‘#’)。否则,你需要知道你的设备在 <code><nowiki>/dev</nowiki></code> 中的位置,如果你的 UPS 是用串行线的,那么你的设备可能在的位置是 <code><nowiki>/dev/ttyS0</nowiki></code>
The following applies to Drapper Drake (LTS 6.06), but does not apply to most Ubuntu default setups, where /usr is simply part of the root filesystem.  You only need to do this if the /usr filesystem has a separate entry in /etc/fstab:
+
 
* You need to uncomment the line 10 in file "/etc/apcupsd/killpower" which means changing "mount -n -o ro /usr" to "mount -n -o ro /usr"
+
之后你必须编辑文件 <code><nowiki>/etc/default/apcupsd</nowiki></code> ,将 <code><nowiki>ISCONFIGURED</nowiki></code> <code><nowiki>no</nowiki></code> no 选项改为 <code><nowiki>yes</nowiki></code>
* This will ensure that the shared libraries libcrypto.so.0.9.8, libnetsnmp.so.9, libstdc++.so.6 and libz.so.1 are visible to apcupsd after shutdown when it runs "/etc/apcupsd/apccontrol killpower" to shut off the ups power otherwise the UPS will stay on and your system will not automatically reboot when utility power returns.
+
 
 +
你已经做好了 apcupsd 的设置,让设备运行并连上计算机,你就可以使用 <code><nowiki>apcaccess</nowiki></code> 命令查看设备的状态。输出的信息基于你的 UPS 的类型。大部分情况下,你的 UPS 越精良,你就能得到越详细的信息。
 +
 
 +
可选的设置,如果你想要你的计算机在断电后重启,你必须编辑 <code><nowiki>/etc/init.d/halt</nowiki></code> 以修正一个 bug,将 <code><nowiki>poweroff="-p"</nowiki></code> 改为 <code><nowiki>poweroff=""</nowiki></code>
 +
 
 +
接下来的设置应用于 Drapper Drake (LTS 6.06),但不适合大部分 Ubuntu 默认安装的 /usr 只是简单的根目录的一部分的文件系统。  如果 /usr 有一部分是在 /etc/fstab 中挂载上去的那么你只用做下面的设置:
 +
* 你需要在文件 /etc/apcupsd/killpower 中解除第 10 行的注释,也就是将 "#mount -n -o ro /usr" 改为 "mount -n -o ro /usr"
 +
*这样可以确认库文件 libcrypto.so.0.9.8, libnetsnmp.so.9, libstdc++.so.6 and libz.so.1 能够在关机后被 apcupsd 使用,当 它运行 /etc/apcupsd/apccontrol killpower 去关闭 UPS 的电源时,否则 UPS 将一直运行着使得你的计算机不能自动重启当电源供应恢复时。
 +
 
 
=== apcupsd-cgi ===
 
=== apcupsd-cgi ===
The following changes to a Ubuntu system should allow APCUPSD-CGI web interface to be accessible.  Note that for this to work you MUST have Apache2 installed and configured properly for your Ubuntu system. 
+
接下来对 Ubuntu 的改动将允许 APCUPSD-CGI 网络接口能被连接上。这里要注意要使其工作你 '''必须''' 安装了 Apache2 并在你的 Ubantu 系统做好了设置。
Start by installing the apcupsd-cgi package with:
+
 
 +
开始安装 apcupsd-cgi:
 
''sudo apt-get install apcupsd-cgi''
 
''sudo apt-get install apcupsd-cgi''
This will drop several files into /usr/lib/cgi-bin/apcuspd.
+
 
For this to work you MUST have CGI enabled in your Apache configuration and the CGI directory should be pointed at /usr/lib/cgi-bin/
+
这样会在 /usr/lib/cgi-bin/apcuspd 中加入一些文件。
The only thing left is to go to the web address:
+
 
 +
为了使其工作你必须在 Apache 设置中启用 CGI 目录应该指向 /usr/lib/cgi-bin/
 +
 
 +
最后只需要做的就是打开这个网址:
 
http://localhost/cgi-bin/apcupsd/multimon.cgi
 
http://localhost/cgi-bin/apcupsd/multimon.cgi
 
----
 
----
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2009年10月2日 (五) 02:44的最新版本

Appcupsd 是一个可以监视你的 UPS ,使其在电源断开时关闭系统的守护进程。Apcupsd 的主页,http://www.apcupsd.com/, 有非常有用的文档对于编译安装。

前期准备

  • 一个 APC 的 UPS。Apcupsd 工作在大部分 APC 的 Smart-UPS 型号上当然还有大部分单频信号传输型的比如 Back-UPS 和 BackUPS-Office。

安装

首先,我们要安装 apcupsd 软件包。在新立得软件包管理器里面安装apcupsd 软件包。如何安装一个软件包请查看 新立得使用指南。如果你想通过浏览器查看 UPS 的状态,你可以同时安装apcupsd-cgi软件包。

软件包安装完成后编辑文件/etc/apcupsd/apcupsd.conf,默认的 apcupsd.conf 中包含有一些不错的关于使用的注释:

  • 对于UPSCABLE 选项你应该指明 UPS 接入计算机的线缆类型。阅读文件中的注释来查看你可能是哪一种。举个例子,如果 UPS 使用的是 APC Back-UPS ES 700V,你应该写上usb
  • 你也必须查找和修改UPSTYPE选项。文件中描述了不同取值的区别。你可以选择最适合的一个。再以 APC Back-UPS ES 700V 为例,你应该写上 usbusb
  • 最后你必须做的设置是DEVICE。注释上有说明,对于一个usb类型的 UPS,apcupsd 是能够自动探测到的,所以你应该注释掉 DEVICE 一项的设置(在 DEVICE 一行前添加一个 ‘#’)。否则,你需要知道你的设备在 /dev 中的位置,如果你的 UPS 是用串行线的,那么你的设备可能在的位置是 /dev/ttyS0

之后你必须编辑文件 /etc/default/apcupsd ,将 ISCONFIGUREDno no 选项改为 yes

你已经做好了 apcupsd 的设置,让设备运行并连上计算机,你就可以使用 apcaccess 命令查看设备的状态。输出的信息基于你的 UPS 的类型。大部分情况下,你的 UPS 越精良,你就能得到越详细的信息。

可选的设置,如果你想要你的计算机在断电后重启,你必须编辑 /etc/init.d/halt 以修正一个 bug,将 poweroff="-p" 改为 poweroff=""

接下来的设置应用于 Drapper Drake (LTS 6.06),但不适合大部分 Ubuntu 默认安装的 /usr 只是简单的根目录的一部分的文件系统。 如果 /usr 有一部分是在 /etc/fstab 中挂载上去的那么你只用做下面的设置:

  • 你需要在文件 /etc/apcupsd/killpower 中解除第 10 行的注释,也就是将 "#mount -n -o ro /usr" 改为 "mount -n -o ro /usr"
  • 这样可以确认库文件 libcrypto.so.0.9.8, libnetsnmp.so.9, libstdc++.so.6 and libz.so.1 能够在关机后被 apcupsd 使用,当 它运行 /etc/apcupsd/apccontrol killpower 去关闭 UPS 的电源时,否则 UPS 将一直运行着使得你的计算机不能自动重启当电源供应恢复时。

apcupsd-cgi

接下来对 Ubuntu 的改动将允许 APCUPSD-CGI 网络接口能被连接上。这里要注意要使其工作你 必须 安装了 Apache2 并在你的 Ubantu 系统做好了设置。

开始安装 apcupsd-cgi: sudo apt-get install apcupsd-cgi

这样会在 /usr/lib/cgi-bin/apcuspd 中加入一些文件。

为了使其工作你必须在 Apache 设置中启用 CGI 目录应该指向 /usr/lib/cgi-bin/

最后只需要做的就是打开这个网址: http://localhost/cgi-bin/apcupsd/multimon.cgi