Dies ist eine alte Version des Dokuments!
~~UNDERCONSTRUCTION~~
APC UPS Daemon
USB/RS.232-Adapter
Jul 28 14:40:56 vml000020 kernel: usb 1-2.2: new full speed USB device number 5 using uhci_hcd Jul 28 14:40:56 vml000020 kernel: usb 1-2.2: New USB device found, idVendor=067b, idProduct=2303 Jul 28 14:40:56 vml000020 kernel: usb 1-2.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0 Jul 28 14:40:56 vml000020 kernel: usb 1-2.2: Product: USB-Serial Controller Jul 28 14:40:56 vml000020 kernel: usb 1-2.2: Manufacturer: Prolific Technology Inc. Jul 28 14:40:56 vml000020 kernel: usb 1-2.2: configuration #1 chosen from 1 choice Jul 28 14:40:56 vml000020 kernel: USB Serial support registered for pl2303 Jul 28 14:40:56 vml000020 kernel: pl2303 1-2.2:1.0: pl2303 converter detected Jul 28 14:40:56 vml000020 kernel: usb 1-2.2: pl2303 converter now attached to ttyUSB1 Jul 28 14:40:56 vml000020 kernel: usbcore: registered new interface driver pl2303 Jul 28 14:40:56 vml000020 kernel: pl2303: Prolific PL2303 USB to serial adaptor driver
Installation
# yum install apcupsd
Paketdetails
# rpm -qil apcupsd
Name : apcupsd Version : 3.14.12 Release : 1.el7 Architecture: x86_64 Install Date: Sun 08 Jan 2017 01:02:05 AM CET Group : System Environment/Daemons Size : 1492686 License : GPLv2 Signature : RSA/SHA256, Thu 22 Jan 2015 01:28:09 AM CET, Key ID 6a2faea2352c64e5 Source RPM : apcupsd-3.14.12-1.el7.src.rpm Build Date : Mon 19 Jan 2015 07:17:55 PM CET Build Host : buildhw-04.phx2.fedoraproject.org Relocations : (not relocatable) Packager : Fedora Project Vendor : Fedora Project URL : http://www.apcupsd.com Summary : APC UPS Power Control Daemon for Linux Description : Apcupsd can be used for controlling most APC UPSes. During a power failure, apcupsd will inform the users about the power failure and that a shutdown may occur. If power is not restored, a system shutdown will follow when the battery is exausted, a timeout (seconds) expires, or the battery runtime expires based on internal APC calculations determined by power consumption rates. If the power is restored before one of the above shutdown conditions is met, apcupsd will inform users about this fact. Some features depend on what UPS model you have (simple or smart). /etc/apcupsd /etc/apcupsd/apccontrol /etc/apcupsd/apcupsd.conf /etc/apcupsd/changeme /etc/apcupsd/commfailure /etc/apcupsd/commok /etc/apcupsd/offbattery /etc/apcupsd/onbattery /etc/logrotate.d/apcupsd /lib/systemd/system-shutdown/apcupsd_shutdown /lib/systemd/system/apcupsd.service /sbin/apcaccess /sbin/apctest /sbin/apcupsd /sbin/smtp /usr/share/doc/apcupsd-3.14.12 /usr/share/doc/apcupsd-3.14.12/COPYING /usr/share/doc/apcupsd-3.14.12/ChangeLog /usr/share/doc/apcupsd-3.14.12/ReleaseNotes /usr/share/doc/apcupsd-3.14.12/examples /usr/share/doc/apcupsd-3.14.12/examples/Makefile /usr/share/doc/apcupsd-3.14.12/examples/SmartUPS1400.snmp /usr/share/doc/apcupsd-3.14.12/examples/client.c /usr/share/doc/apcupsd-3.14.12/examples/gui /usr/share/doc/apcupsd-3.14.12/examples/gui/about.tcl /usr/share/doc/apcupsd-3.14.12/examples/gui/apcupsd.tcl /usr/share/doc/apcupsd-3.14.12/examples/gui/dialog.tcl /usr/share/doc/apcupsd-3.14.12/examples/gui/events.tcl /usr/share/doc/apcupsd-3.14.12/examples/gui/mainwindow.tcl /usr/share/doc/apcupsd-3.14.12/examples/gui/pkgIndex.tcl /usr/share/doc/apcupsd-3.14.12/examples/gui/splash.tcl /usr/share/doc/apcupsd-3.14.12/examples/gui/status.tcl /usr/share/doc/apcupsd-3.14.12/examples/hid-set.c /usr/share/doc/apcupsd-3.14.12/examples/hid-ups.c /usr/share/doc/apcupsd-3.14.12/examples/hiddev-hiddev.h-cleanup-2.4.patch /usr/share/doc/apcupsd-3.14.12/examples/hiddev.h /usr/share/doc/apcupsd-3.14.12/examples/hiddev.txt /usr/share/doc/apcupsd-3.14.12/examples/index.php /usr/share/doc/apcupsd-3.14.12/examples/libusb.h /usr/share/doc/apcupsd-3.14.12/examples/linux-2.4.20-USB-reject.patch /usr/share/doc/apcupsd-3.14.12/examples/linux-2.4.20-killpower.patch /usr/share/doc/apcupsd-3.14.12/examples/linux-2.6.0-USB-queue-overflow.patch /usr/share/doc/apcupsd-3.14.12/examples/linux-usb-patch-email.txt /usr/share/doc/apcupsd-3.14.12/examples/linux-usb-patch2-email.txt /usr/share/doc/apcupsd-3.14.12/examples/make-hiddev /usr/share/doc/apcupsd-3.14.12/examples/megaclient.c /usr/share/doc/apcupsd-3.14.12/examples/nagios_plugin_check_apcupsd.c /usr/share/doc/apcupsd-3.14.12/examples/newslave.c /usr/share/doc/apcupsd-3.14.12/examples/offbattery.cpufreq /usr/share/doc/apcupsd-3.14.12/examples/onbattery.cpufreq /usr/share/doc/apcupsd-3.14.12/examples/php-monitor.txt /usr/share/doc/apcupsd-3.14.12/examples/rpt /usr/share/doc/apcupsd-3.14.12/examples/rpt/Back-UPS-350-USB.rpt /usr/share/doc/apcupsd-3.14.12/examples/rpt/Back-UPS-350ES.rpt /usr/share/doc/apcupsd-3.14.12/examples/rpt/Back-UPS-500-USB.rpt /usr/share/doc/apcupsd-3.14.12/examples/rpt/Back-UPS-500ES.rpt /usr/share/doc/apcupsd-3.14.12/examples/rpt/Back-UPS-BR-800.rpt /usr/share/doc/apcupsd-3.14.12/examples/rpt/Back-UPS-CS-650.rpt /usr/share/doc/apcupsd-3.14.12/examples/rpt/Back-UPS-ES-550.rpt /usr/share/doc/apcupsd-3.14.12/examples/rpt/Back-UPS-XS-1300-LCD.rpt /usr/share/doc/apcupsd-3.14.12/examples/rpt/BackUPS.rpt /usr/share/doc/apcupsd-3.14.12/examples/rpt/Smart-UPS-1500.rpt /usr/share/doc/apcupsd-3.14.12/examples/rpt/SmartUPS-USB.rpt /usr/share/doc/apcupsd-3.14.12/examples/rpt/SmartUPS.rpt /usr/share/doc/apcupsd-3.14.12/examples/rpt/hid-ups.rpt /usr/share/doc/apcupsd-3.14.12/examples/safe.apccontrol /usr/share/doc/apcupsd-3.14.12/examples/smartsim.c /usr/share/doc/apcupsd-3.14.12/examples/snoopdecode.c /usr/share/doc/apcupsd-3.14.12/examples/status /usr/share/doc/apcupsd-3.14.12/examples/status/Back-UPS-BX-1500.status /usr/share/doc/apcupsd-3.14.12/examples/status/Back-UPS-Pro-1000.status /usr/share/doc/apcupsd-3.14.12/examples/status/BackUPS-USB.status /usr/share/doc/apcupsd-3.14.12/examples/status/JapaneseUPS.status /usr/share/doc/apcupsd-3.14.12/examples/status/PowerStack450.status /usr/share/doc/apcupsd-3.14.12/examples/status/SmartUPS-vs-650.status /usr/share/doc/apcupsd-3.14.12/examples/status/SmartUPS1000.status /usr/share/doc/apcupsd-3.14.12/examples/status/SmartUPS1400.status /usr/share/doc/apcupsd-3.14.12/examples/status/SmartUPS3000.status /usr/share/doc/apcupsd-3.14.12/examples/status/SmartUPS5000.status /usr/share/doc/apcupsd-3.14.12/examples/status/SmartUPS600.status /usr/share/doc/apcupsd-3.14.12/examples/status/SmartUPS700-2.status /usr/share/doc/apcupsd-3.14.12/examples/status/SmartUPS700.status /usr/share/doc/apcupsd-3.14.12/examples/status/newbackupspro1.status /usr/share/doc/apcupsd-3.14.12/examples/status/newbackupspro2.status /usr/share/doc/apcupsd-3.14.12/examples/upsapm.c /usr/share/doc/apcupsd-3.14.12/examples/usb_hid_usages /usr/share/doc/apcupsd-3.14.12/examples/usbsnoop.txt /usr/share/hal/fdi/policy/20thirdparty/80-apcupsd-ups-policy.fdi /usr/share/man/man5/apcupsd.conf.5.gz /usr/share/man/man8/apcaccess.8.gz /usr/share/man/man8/apccontrol.8.gz /usr/share/man/man8/apctest.8.gz /usr/share/man/man8/apcupsd.8.gz
# service apcupsd start
Starting UPS monitoring: [ OK ]
# chkconfig apcupsd on
# chkconfig --list | grep apcupsd
apcupsd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
# cat /var/log/apcupsd.events
2012-07-28 16:31:36 +0200 apcupsd 3.14.10 (13 September 2011) redhat startup succeeded
# cat /var/log/apcupsd.events 2012-07-28 15:58:51 +0200 apcupsd FATAL ERROR in smartsetup.c at line 172 PANIC! Cannot communicate with UPS via serial port. Please make sure the port specified on the DEVICE directive is correct, and that your cable specification on the UPSCABLE directive is correct. 2012-07-28 15:58:51 +0200 apcupsd error shutdown completed
APC : 001,051,1262 DATE : 2012-07-28 16:28:45 +0200 HOSTNAME : vml000020.dmz.nausch.org VERSION : 3.14.10 (13 September 2011) redhat UPSNAME : APC1400 CABLE : Custom Cable Smart DRIVER : APC Smart UPS (any) UPSMODE : Stand Alone STARTTIME: 2012-07-28 16:28:33 +0200 MODEL : SMART-UPS 1400 RM STATUS : ONLINE LINEV : 226.2 Volts LOADPCT : 33.2 Percent Load Capacity BCHARGE : 100.0 Percent TIMELEFT : 9.0 Minutes MBATTCHG : 5 Percent MINTIMEL : 3 Minutes MAXTIME : 0 Seconds MAXLINEV : 228.8 Volts MINLINEV : 226.2 Volts OUTPUTV : 226.2 Volts SENSE : High DWAKE : 000 Seconds DSHUTD : 020 Seconds DLOWBATT : 02 Minutes LOTRANS : 196.0 Volts HITRANS : 253.0 Volts RETPCT : 000.0 Percent ITEMP : 34.2 C Internal ALARMDEL : 5 seconds BATTV : 27.6 Volts LINEFREQ : 50.0 Hz LASTXFER : Automatic or explicit self test NUMXFERS : 0 TONBATT : 0 seconds CUMONBATT: 0 seconds XOFFBATT : N/A SELFTEST : NO STESTI : 336 STATFLAG : 0x07000008 Status Flag DIPSW : 0x00 Dip Switch REG1 : 0x00 Register 1 REG2 : 0x00 Register 2 REG3 : 0x00 Register 3 MANDATE : 09/23/11 SERIALNO : GS9939006549 BATTDATE : 09/23/11 NOMOUTV : 230 Volts NOMBATTV : 24.0 Volts EXTBATTS : 0 FIRMWARE : 72.11.I END APC : 2012-07-28 16:28:50 +0200
# vim /etc/httpd/conf.d/vhosts.conf
- /etc/httpd/conf.d/vhosts.conf
... # # power.nausch.org # <VirtualHost *:80> ServerAdmin webmaster@nausch.org ServerName power.nausch.org ServerAlias www.power.nausch.org ServerPath / DocumentRoot "/var/www/apcupsd" AddHandler cgi-script .cgi <Directory "/var/www/apcupsd"> Options FollowSymLinks AllowOverride all Order Allow,Deny Allow from all Options ExecCGI </Directory> AddType application/x-httpd-php .php DirectoryIndex multimon.cgi ErrorLog logs/power_error.log CustomLog logs/power_access.log combined </VirtualHost> ...
Date: Mon, 30 Jul 2012 17:23:01 +0200 From: root@nausch.org (root) To: root@nausch.org Subject: vml000020.dmz.nausch.org Power Failure !!! vml000020.dmz.nausch.org Power Failure !!! APC : 001,052,1297 DATE : 2012-07-30 17:22:59 +0200 HOSTNAME : vml000020.dmz.nausch.org VERSION : 3.14.10 (13 September 2011) redhat UPSNAME : APC1400 CABLE : Custom Cable Smart DRIVER : APC Smart UPS (any) UPSMODE : Stand Alone STARTTIME: 2012-07-28 16:31:25 +0200 MODEL : SMART-UPS 1400 RM STATUS : ONBATT LINEV : 000.0 Volts LOADPCT : 33.2 Percent Load Capacity BCHARGE : 100.0 Percent TIMELEFT : 10.0 Minutes MBATTCHG : 5 Percent MINTIMEL : 3 Minutes MAXTIME : 0 Seconds MAXLINEV : 000.0 Volts MINLINEV : 000.0 Volts OUTPUTV : 230.4 Volts SENSE : High DWAKE : 000 Seconds DSHUTD : 020 Seconds DLOWBATT : 02 Minutes LOTRANS : 196.0 Volts HITRANS : 253.0 Volts RETPCT : 000.0 Percent ITEMP : 33.7 C Internal ALARMDEL : 5 seconds BATTV : 24.4 Volts LINEFREQ : 50.0 Hz LASTXFER : Line voltage notch or spike NUMXFERS : 1 XONBATT : 2012-07-30 17:22:55 +0200 TONBATT : 6 seconds CUMONBATT: 6 seconds XOFFBATT : N/A SELFTEST : NO STESTI : 336 STATFLAG : 0x07060010 Status Flag DIPSW : 0x00 Dip Switch REG1 : 0x00 Register 1 REG2 : 0x00 Register 2 REG3 : 0x00 Register 3 MANDATE : 09/23/99 SERIALNO : GS9939006549 BATTDATE : 09/23/99 NOMOUTV : 230 Volts NOMBATTV : 24.0 Volts EXTBATTS : 0 FIRMWARE : 72.11.I END APC : 2012-07-30 17:23:01 +0200
Date: Mon, 30 Jul 2012 17:23:59 +0200 From: root@nausch.org (root) To: root@nausch.org Subject: vml000020.dmz.nausch.org Power has returned vml000020.dmz.nausch.org Power has returned APC : 001,052,1322 DATE : 2012-07-30 17:23:58 +0200 HOSTNAME : vml000020.dmz.nausch.org VERSION : 3.14.10 (13 September 2011) redhat UPSNAME : APC1400 CABLE : Custom Cable Smart DRIVER : APC Smart UPS (any) UPSMODE : Stand Alone STARTTIME: 2012-07-28 16:31:25 +0200 MODEL : SMART-UPS 1400 RM STATUS : ONLINE LINEV : 227.5 Volts LOADPCT : 33.2 Percent Load Capacity BCHARGE : 090.0 Percent TIMELEFT : 9.0 Minutes MBATTCHG : 5 Percent MINTIMEL : 3 Minutes MAXTIME : 0 Seconds MAXLINEV : 000.0 Volts MINLINEV : 024.7 Volts OUTPUTV : 228.8 Volts SENSE : High DWAKE : 000 Seconds DSHUTD : 020 Seconds DLOWBATT : 02 Minutes LOTRANS : 196.0 Volts HITRANS : 253.0 Volts RETPCT : 000.0 Percent ITEMP : 33.3 C Internal ALARMDEL : 5 seconds BATTV : 25.9 Volts LINEFREQ : 50.0 Hz LASTXFER : Line voltage notch or spike NUMXFERS : 1 XONBATT : 2012-07-30 17:22:55 +0200 TONBATT : 0 seconds CUMONBATT: 64 seconds XOFFBATT : 2012-07-30 17:23:59 +0200 SELFTEST : NO STESTI : 336 STATFLAG : 0x07040008 Status Flag DIPSW : 0x00 Dip Switch REG1 : 0x00 Register 1 REG2 : 0x00 Register 2 REG3 : 0x00 Register 3 MANDATE : 09/23/99 SERIALNO : GS9939006549 BATTDATE : 09/23/99 NOMOUTV : 230 Volts NOMBATTV : 24.0 Volts EXTBATTS : 0 FIRMWARE : 72.11.I END APC : 2012-07-30 17:23:59 +0200