特殊:Badtitle/NS100:Apcupsd:修订间差异
小无编辑摘要 |
小无编辑摘要 |
||
第16行: | 第16行: | ||
* 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" | * 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" | ||
* 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. | * 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-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. | |||
Start by installing the apcupsd-cgi package with: | |||
''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/ | |||
The only thing left is to go to the web address: | |||
http://localhost/cgi-bin/apcupsd/multimon.cgi | |||
---- | ---- | ||
[[category:UbuntuHelp]] | [[category:UbuntuHelp]] |
2009年5月14日 (四) 14:34的版本
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/apcupsd }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:apcupsd | UbuntuHelp:apcupsd | {{#if: | :}}Apcupsd}}/af | • {{#if: UbuntuHelp:apcupsd|Afrikaans| [[::Apcupsd/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:apcupsd | UbuntuHelp:apcupsd | {{#if: | :}}Apcupsd}}/ar | • {{#if: UbuntuHelp:apcupsd|العربية| [[::Apcupsd/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:apcupsd | UbuntuHelp:apcupsd | {{#if: | :}}Apcupsd}}/az | • {{#if: UbuntuHelp:apcupsd|azərbaycanca| [[::Apcupsd/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:apcupsd | UbuntuHelp:apcupsd | {{#if: | :}}Apcupsd}}/bcc | • {{#if: UbuntuHelp:apcupsd|جهلسری بلوچی| [[::Apcupsd/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:apcupsd | UbuntuHelp:apcupsd | {{#if: | :}}Apcupsd}}/bg | • {{#if: UbuntuHelp:apcupsd|български| [[::Apcupsd/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:apcupsd | UbuntuHelp:apcupsd | {{#if: | :}}Apcupsd}}/br | • {{#if: UbuntuHelp:apcupsd|brezhoneg| [[::Apcupsd/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:apcupsd | UbuntuHelp:apcupsd | {{#if: | :}}Apcupsd}}/ca | • {{#if: UbuntuHelp:apcupsd|català| [[::Apcupsd/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:apcupsd | UbuntuHelp:apcupsd | {{#if: | :}}Apcupsd}}/cs | • {{#if: UbuntuHelp:apcupsd|čeština| [[::Apcupsd/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:apcupsd | UbuntuHelp:apcupsd | {{#if: | :}}Apcupsd}}/de | • {{#if: UbuntuHelp:apcupsd|Deutsch| [[::Apcupsd/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:apcupsd | UbuntuHelp:apcupsd | {{#if: | :}}Apcupsd}}/el | • {{#if: UbuntuHelp:apcupsd|Ελληνικά| [[::Apcupsd/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:apcupsd | UbuntuHelp:apcupsd | {{#if: | :}}Apcupsd}}/es | • {{#if: UbuntuHelp:apcupsd|español| [[::Apcupsd/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:apcupsd | UbuntuHelp:apcupsd | {{#if: | :}}Apcupsd}}/fa | • {{#if: UbuntuHelp:apcupsd|فارسی| [[::Apcupsd/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:apcupsd | UbuntuHelp:apcupsd | {{#if: | :}}Apcupsd}}/fi | • {{#if: UbuntuHelp:apcupsd|suomi| [[::Apcupsd/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:apcupsd | UbuntuHelp:apcupsd | {{#if: | :}}Apcupsd}}/fr | • {{#if: UbuntuHelp:apcupsd|français| [[::Apcupsd/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:apcupsd | UbuntuHelp:apcupsd | {{#if: | :}}Apcupsd}}/gu | • {{#if: UbuntuHelp:apcupsd|ગુજરાતી| [[::Apcupsd/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:apcupsd | UbuntuHelp:apcupsd | {{#if: | :}}Apcupsd}}/he | • {{#if: UbuntuHelp:apcupsd|עברית| [[::Apcupsd/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:apcupsd | UbuntuHelp:apcupsd | {{#if: | :}}Apcupsd}}/hu | • {{#if: UbuntuHelp:apcupsd|magyar| [[::Apcupsd/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:apcupsd | UbuntuHelp:apcupsd | {{#if: | :}}Apcupsd}}/id | • {{#if: UbuntuHelp:apcupsd|Bahasa Indonesia| [[::Apcupsd/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:apcupsd | UbuntuHelp:apcupsd | {{#if: | :}}Apcupsd}}/it | • {{#if: UbuntuHelp:apcupsd|italiano| [[::Apcupsd/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:apcupsd | UbuntuHelp:apcupsd | {{#if: | :}}Apcupsd}}/ja | • {{#if: UbuntuHelp:apcupsd|日本語| [[::Apcupsd/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:apcupsd | UbuntuHelp:apcupsd | {{#if: | :}}Apcupsd}}/ko | • {{#if: UbuntuHelp:apcupsd|한국어| [[::Apcupsd/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:apcupsd | UbuntuHelp:apcupsd | {{#if: | :}}Apcupsd}}/ksh | • {{#if: UbuntuHelp:apcupsd|Ripoarisch| [[::Apcupsd/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:apcupsd | UbuntuHelp:apcupsd | {{#if: | :}}Apcupsd}}/mr | • {{#if: UbuntuHelp:apcupsd|मराठी| [[::Apcupsd/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:apcupsd | UbuntuHelp:apcupsd | {{#if: | :}}Apcupsd}}/ms | • {{#if: UbuntuHelp:apcupsd|Bahasa Melayu| [[::Apcupsd/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:apcupsd | UbuntuHelp:apcupsd | {{#if: | :}}Apcupsd}}/nl | • {{#if: UbuntuHelp:apcupsd|Nederlands| [[::Apcupsd/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:apcupsd | UbuntuHelp:apcupsd | {{#if: | :}}Apcupsd}}/no | • {{#if: UbuntuHelp:apcupsd|norsk| [[::Apcupsd/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:apcupsd | UbuntuHelp:apcupsd | {{#if: | :}}Apcupsd}}/oc | • {{#if: UbuntuHelp:apcupsd|occitan| [[::Apcupsd/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:apcupsd | UbuntuHelp:apcupsd | {{#if: | :}}Apcupsd}}/pl | • {{#if: UbuntuHelp:apcupsd|polski| [[::Apcupsd/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:apcupsd | UbuntuHelp:apcupsd | {{#if: | :}}Apcupsd}}/pt | • {{#if: UbuntuHelp:apcupsd|português| [[::Apcupsd/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:apcupsd | UbuntuHelp:apcupsd | {{#if: | :}}Apcupsd}}/ro | • {{#if: UbuntuHelp:apcupsd|română| [[::Apcupsd/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:apcupsd | UbuntuHelp:apcupsd | {{#if: | :}}Apcupsd}}/ru | • {{#if: UbuntuHelp:apcupsd|русский| [[::Apcupsd/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:apcupsd | UbuntuHelp:apcupsd | {{#if: | :}}Apcupsd}}/si | • {{#if: UbuntuHelp:apcupsd|සිංහල| [[::Apcupsd/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:apcupsd | UbuntuHelp:apcupsd | {{#if: | :}}Apcupsd}}/sq | • {{#if: UbuntuHelp:apcupsd|shqip| [[::Apcupsd/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:apcupsd | UbuntuHelp:apcupsd | {{#if: | :}}Apcupsd}}/sr | • {{#if: UbuntuHelp:apcupsd|српски / srpski| [[::Apcupsd/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:apcupsd | UbuntuHelp:apcupsd | {{#if: | :}}Apcupsd}}/sv | • {{#if: UbuntuHelp:apcupsd|svenska| [[::Apcupsd/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:apcupsd | UbuntuHelp:apcupsd | {{#if: | :}}Apcupsd}}/th | • {{#if: UbuntuHelp:apcupsd|ไทย| [[::Apcupsd/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:apcupsd | UbuntuHelp:apcupsd | {{#if: | :}}Apcupsd}}/tr | • {{#if: UbuntuHelp:apcupsd|Türkçe| [[::Apcupsd/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:apcupsd | UbuntuHelp:apcupsd | {{#if: | :}}Apcupsd}}/vi | • {{#if: UbuntuHelp:apcupsd|Tiếng Việt| [[::Apcupsd/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:apcupsd | UbuntuHelp:apcupsd | {{#if: | :}}Apcupsd}}/yue | • {{#if: UbuntuHelp:apcupsd|粵語| [[::Apcupsd/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:apcupsd | UbuntuHelp:apcupsd | {{#if: | :}}Apcupsd}}/zh | • {{#if: UbuntuHelp:apcupsd|中文| [[::Apcupsd/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:apcupsd | UbuntuHelp:apcupsd | {{#if: | :}}Apcupsd}}/zh-hans | • {{#if: UbuntuHelp:apcupsd|中文(简体)| [[::Apcupsd/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:apcupsd | UbuntuHelp:apcupsd | {{#if: | :}}Apcupsd}}/zh-hant | • {{#if: UbuntuHelp:apcupsd|中文(繁體)| [[::Apcupsd/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:apcupsd|:Apcupsd|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :Apcupsd/zh | | {{#ifexist: Apcupsd/zh | | {{#ifeq: {{#titleparts:Apcupsd|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:Apcupsd|1|-1|}} | zh | | }}
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.
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
First of all, we have to install apcupsd package. Install the apcupsd
package in the Synaptic Package Manager. See SynapticHowto. If you want to see the stat of the UPS through the browser, you can also install apcupsd-cgi
package.
Edit the file /etc/apcupsd/apcupsd.conf
which by default includes good comments on usage:
- For
UPSCABLE
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 writeusb
. - You must also look for and modify the
UPSTYPE
. 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 writeusb
. - The final setting you must fix is
DEVICE
. As the comments note, with ausb
type UPS apcupsd can autodetect the device, so you should comment out theDEVICE
setting (by putting a '#' in front of it). Otherwise, you will need to know which/dev
node your device is connected to. If your UPS cable is a serial type then your device may be something like/dev/ttyS0
.
Then you must edit the file /etc/default/apcupsd
and change the no
of the ISCONFIGURED
with a yes
.
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 apcaccess
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.
Optionally, if you want your computer to reboot after a power fail, you must edit the /etc/init.d/halt
due a bug that it has. You must change the poweroff="-p"
with poweroff=""
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"
- 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-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. Start by installing the apcupsd-cgi package with: 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/ The only thing left is to go to the web address: http://localhost/cgi-bin/apcupsd/multimon.cgi