Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
centos:apc [08.01.2017 17:21. ] – [Installation] django | centos:apc [22.07.2019 14:52. ] (aktuell) – Externe Bearbeitung 127.0.0.1 | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
- | ~~UNDERCONSTRUCTION~~ | + | ====== APC UPS Daemon |
- | ====== APC UPS Daemon ====== | + | {{ : |
- | FIXME | + | {{: |
+ | |||
+ | Beim Betrieb eines Servers ist der Einsatz einer gesicherten Energieversorgung natürlich obligatorisch. Im **RZ**((**R**echen **Z**entrum)) stehen dazu meist unterbrechungsfreie Stromversorgungen, | ||
+ | |||
+ | {{: | ||
+ | |||
+ | Eine ausführliche Programmdokumentation ist auf der Seite [[http:// | ||
===== USB/ | ===== USB/ | ||
+ | Die Verbindung zwischen der USV und dem Server erfolgt mittels zugehörigem seriellen Verbindungskabel vom Typ **// | ||
+ | |||
+ | Mit Hilfe der installierten **usbutiuls** können Details zum USB_Adapter abgefragt werden. | ||
+ | |||
+ | Bei Bedarf installieren wir uns also besagtes RPM-Paket. | ||
# yum install usbutils | # yum install usbutils | ||
+ | Den Inhalt des Paketes können wir uns wie folgt anzeigen lassen. | ||
# rpm -qil usbutils | # rpm -qil usbutils | ||
< | < | ||
Zeile 41: | Zeile 54: | ||
/ | / | ||
+ | Der Aufruf von **lsusb** zeigt uns neben den anderen USB-Devices auch unseren 4-Port Adapter. | ||
# lsusb | # lsusb | ||
Zeile 50: | Zeile 64: | ||
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub | Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub | ||
- | '' | + | Eine ähnliche aussagekräftige Detailanzeige können wir uns mit dem Befehl **usb-devices** anzeigen lassen. |
# usb-devices | # usb-devices | ||
< | < | ||
Zeile 65: | Zeile 78: | ||
I: If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=ftdi_sio</ | I: If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=ftdi_sio</ | ||
+ | Damit der Adapter auch verwendet werden kann, benötigen wir noch die **libftdi**-Bibliotheken, | ||
# yum install libftdi | # yum install libftdi | ||
+ | Auch hier können wir bei Interesse, den Inhalt des RPM-Paketes anzeigen lassen. | ||
# rpm -qil libftdi | # rpm -qil libftdi | ||
< | < | ||
Zeile 96: | Zeile 111: | ||
/ | / | ||
/ | / | ||
- | < | ||
- | Jul 28 14:40:56 vml000020 kernel: usb 1-2.2: New USB device found, idVendor=067b, | ||
- | 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: | ||
- | 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 | |
- | ===== Installation ===== | + | ==== apcupsd ==== |
+ | === Installation === | ||
+ | Zur Administration unserer USV benötien wir nun noch einen passenden Daemon, den **[[http:// | ||
# yum install apcupsd | # yum install apcupsd | ||
- | + | Welche Verzeichnisse und Dateien uns die Installation eben ins System brachte, lassen wir uns mit Unterstützung des Befehls **rpm** und der Option '' | |
- | + | ||
- | ===== Paketdetails ===== | + | |
# rpm -qil apcupsd | # rpm -qil apcupsd | ||
Zeile 239: | Zeile 242: | ||
/ | / | ||
+ | === Konfiguration === | ||
+ | Zur Einstellungen des Daemon sind in der Konfigurationsdatei // | ||
+ | # vim / | ||
+ | <file bash / | ||
+ | # | ||
+ | # for apcupsd release 3.14.12 (29 March 2014) - redhat | ||
+ | # | ||
+ | # " | ||
+ | # | ||
+ | # ========= General configuration parameters ============ | ||
+ | # | ||
- | # service apcupsd start | + | # 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. | ||
+ | # Django : 2017-01-08 | ||
+ | # default: #UPSNAME | ||
+ | UPSNAME APC1400 | ||
- | | + | # UPSCABLE < |
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # Or a specific cable model number may be used: | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # Django : 2017-01-08 | ||
+ | # default: UPSCABLE usb | ||
+ | UPSCABLE 940-0024B | ||
+ | # 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 | ||
+ | # apcsmart | ||
+ | # SmartUPS models using a serial cable (not USB). | ||
+ | # | ||
+ | # usb < | ||
+ | # setting enables autodetection, | ||
+ | # the best choice for most installations. | ||
+ | # | ||
+ | # net | ||
+ | # Network Information Server. This is used if the | ||
+ | # UPS powering your computer is connected to a | ||
+ | # different computer for monitoring. | ||
+ | # | ||
+ | # snmp hostname: | ||
+ | # SNMP network link to an SNMP-enabled UPS device. | ||
+ | # Hostname is the ip address or hostname of the UPS | ||
+ | # on the network. Vendor can be can be " | ||
+ | # " | ||
+ | # catching; you usually want " | ||
+ | # 161. Community is usually " | ||
+ | # | ||
+ | # netsnmp | ||
+ | # OBSOLETE | ||
+ | # Same as SNMP above but requires use of the | ||
+ | # net-snmp library. Unless you have a specific need | ||
+ | # for this old driver, you should use ' | ||
+ | # | ||
+ | # dumb / | ||
+ | # simple-signaling UPSes. | ||
+ | # | ||
+ | # pcnet | ||
+ | # PowerChute Network Shutdown protocol which can be | ||
+ | # used as an alternative to SNMP with the AP9617 | ||
+ | # family of smart slot cards. ipaddr is the IP | ||
+ | # address of the UPS management card. username and | ||
+ | # passphrase are the credentials for which the card | ||
+ | # has been configured. port is the port number on | ||
+ | # which to listen for messages from the UPS, normally | ||
+ | # 3052. If this parameter is empty or missing, the | ||
+ | # default of 3052 will be used. | ||
+ | # | ||
+ | # modbus | ||
+ | # supporting the MODBUS protocol. | ||
+ | # | ||
+ | # Django : 2017-01-08 | ||
+ | # default: UPSTYPE usb | ||
+ | # DEVICE | ||
+ | UPSTYPE apcsmart | ||
+ | DEVICE / | ||
- | # chkconfig | + | # POLLTIME < |
+ | # | ||
+ | # | ||
+ | # dumb) and networked UPSes (UPSTYPE net, snmp). Lowering this setting | ||
+ | # will improve apcupsd' | ||
+ | # | ||
+ | # | ||
+ | # Django : 2017-01-08 | ||
+ | # default: #POLLTIME 60 | ||
+ | POLLTIME 60 | ||
+ | # LOCKFILE <path to lockfile> | ||
+ | # Path for device lock file. Not used on Win32. | ||
+ | LOCKFILE /var/lock | ||
- | # chkconfig --list | grep apcupsd | + | # SCRIPTDIR <path to script directory> |
+ | # | ||
+ | SCRIPTDIR /etc/apcupsd | ||
- | apcupsd | + | # PWRFAILDIR <path to powerfail directory> |
+ | # | ||
+ | # is created when apcupsd | ||
+ | # | ||
+ | # | ||
+ | PWRFAILDIR / | ||
- | <code># systemctl restart apcupsd.service | + | # NOLOGINDIR |
- | [root@vml000127 ~]# systemctl status apcupsd.service | + | # Directory in which to write the nologin file. The existence |
- | ● apcupsd.service - APC UPS Power Control Daemon for Linux | + | # |
- | | + | NOLOGINDIR |
- | Active: active (running) since Sun 2017-01-08 11:20:21 CET; 3s ago | + | |
- | Process: 2571 ExecStartPre=/ | + | |
- | Main PID: 2573 (apcupsd) | + | |
- | | + | |
- | └─2573 / | + | |
- | Jan 08 11:20:21 vml000127.dmz.nausch.org systemd[1]: Starting APC UPS Power Control Daemon for Linux... | ||
- | Jan 08 11:20:21 vml000127.dmz.nausch.org systemd[1]: Started APC UPS Power Control Daemon for Linux. | ||
- | Jan 08 11:20:21 vml000127.dmz.nausch.org apcupsd[2573]: | ||
- | Jan 08 11:20:21 vml000127.dmz.nausch.org apcupsd[2573]: | ||
- | [root@vml000127 ~]# cat / | + | # |
- | 2017-01-08 11:20:21 +0100 apcupsd 3.14.12 (29 March 2014) redhat startup succeeded | + | # ======== Configuration parameters used during power failures ========== |
- | </ | + | # |
+ | # The ONBATTERYDELAY is the time in seconds from when a power failure | ||
+ | # is detected until we react to it with an onbattery event. | ||
+ | # | ||
+ | # This means that, apccontrol will be called with the powerout argument | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # i.e. comment out the wall. | ||
+ | ONBATTERYDELAY 6 | ||
- | # cat / | + | # |
+ | # Note: BATTERYLEVEL, | ||
+ | # the first that occurs will cause the initation of a shutdown. | ||
+ | # | ||
- | | + | # If during a power failure, the remaining battery percentage |
+ | # (as reported by the UPS) is below or equal to BATTERYLEVEL, | ||
+ | # apcupsd | ||
+ | BATTERYLEVEL 5 | ||
+ | # If during a power failure, the remaining runtime in minutes | ||
+ | # (as calculated internally by the UPS) is below or equal to MINUTES, | ||
+ | # apcupsd, will initiate a system shutdown. | ||
+ | MINUTES 3 | ||
+ | # If during a power failure, the UPS has run on batteries for TIMEOUT | ||
+ | # many seconds or longer, apcupsd will initiate a system shutdown. | ||
+ | # A value of 0 disables this timer. | ||
+ | # | ||
+ | # Note, if you have a Smart UPS, you will most likely want to disable | ||
+ | # this timer by setting it to zero. That way, you UPS will continue | ||
+ | # on batteries until either the % charge remaing drops to or below BATTERYLEVEL, | ||
+ | # or the remaining battery runtime drops to or below MINUTES. | ||
+ | # if you are testing, setting this to 60 causes a quick system shutdown | ||
+ | # if you pull the power plug. | ||
+ | # If you have an older dumb UPS, you will want to set this to less than | ||
+ | # the time you know you can run on batteries. | ||
+ | TIMEOUT 0 | ||
+ | |||
+ | # Time in seconds between annoying users to signoff prior to | ||
+ | # system shutdown. 0 disables. | ||
+ | ANNOY 300 | ||
+ | |||
+ | # Initial delay after power failure before warning users to get | ||
+ | # off the system. | ||
+ | ANNOYDELAY 60 | ||
+ | |||
+ | # The condition which determines when users are prevented from | ||
+ | # logging in during a power failure. | ||
+ | # NOLOGON < | ||
+ | NOLOGON disable | ||
+ | |||
+ | # If KILLDELAY is non-zero, apcupsd will continue running after a | ||
+ | # shutdown has been requested, and after the specified time in | ||
+ | # seconds attempt to kill the power. This is for use on systems | ||
+ | # where apcupsd cannot regain control after a shutdown. | ||
+ | # KILLDELAY < | ||
+ | KILLDELAY 0 | ||
+ | |||
+ | # | ||
+ | # ==== Configuration statements for Network Information Server ==== | ||
+ | # | ||
+ | |||
+ | # NETSERVER [ on | off ] on enables, off disables the network | ||
+ | # information server. If netstatus is on, a network information | ||
+ | # server process will be started for serving the STATUS and | ||
+ | # EVENT data over the network (used by CGI programs). | ||
+ | NETSERVER on | ||
+ | |||
+ | # NISIP <dotted notation ip address> | ||
+ | # IP address on which NIS server will listen for incoming connections. | ||
+ | # This is useful if your server is multi-homed (has more than one | ||
+ | # network interface and IP address). Default value is 0.0.0.0 which | ||
+ | # means any incoming request will be serviced. Alternatively, | ||
+ | # configure this setting to any specific IP address of your server and | ||
+ | # NIS will listen for connections only on that interface. Use the | ||
+ | # loopback address (127.0.0.1) to accept connections only from the | ||
+ | # local machine. | ||
+ | NISIP 0.0.0.0 | ||
+ | |||
+ | # NISPORT < | ||
+ | # port to use for sending STATUS and EVENTS data over the network. | ||
+ | # It is not used unless NETSERVER is on. If you change this port, | ||
+ | # you will need to change the corresponding value in the cgi directory | ||
+ | # and rebuild the cgi programs. | ||
+ | NISPORT 3551 | ||
+ | |||
+ | # If you want the last few EVENTS to be available over the network | ||
+ | # by the network information server, you must define an EVENTSFILE. | ||
+ | EVENTSFILE / | ||
+ | |||
+ | # EVENTSFILEMAX < | ||
+ | # By default, the size of the EVENTSFILE will be not be allowed to exceed | ||
+ | # 10 kilobytes. | ||
+ | # be removed from the beginning of the file (first in first out). The | ||
+ | # parameter EVENTSFILEMAX can be set to a different kilobyte value, or set | ||
+ | # to zero to allow the EVENTSFILE to grow without limit. | ||
+ | EVENTSFILEMAX 10 | ||
+ | |||
+ | # | ||
+ | # ========== 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 ] | ||
+ | # | ||
+ | # card. | ||
+ | UPSCLASS standalone | ||
+ | |||
+ | # UPSMODE [ disable | share ] | ||
+ | # | ||
+ | UPSMODE disable | ||
+ | |||
+ | # | ||
+ | # ===== Configuration statements to control apcupsd system logging ======== | ||
+ | # | ||
+ | |||
+ | # Time interval in seconds between writing the STATUS file; 0 disables | ||
+ | STATTIME 0 | ||
+ | |||
+ | # Location of STATUS file (written to only if STATTIME is non-zero) | ||
+ | STATFILE / | ||
+ | |||
+ | # LOGSTATS [ on | off ] on enables, off disables | ||
+ | # Note! This generates a lot of output, so if | ||
+ | # you turn this on, be sure that the | ||
+ | # file defined in syslog.conf for LOG_NOTICE is a named pipe. | ||
+ | # You probably do not want this on. | ||
+ | LOGSTATS off | ||
+ | |||
+ | # Time interval in seconds between writing the DATA records to | ||
+ | # the log file. 0 disables. | ||
+ | DATATIME 0 | ||
+ | |||
+ | # FACILITY defines the logging facility (class) for logging to syslog. | ||
+ | # If not specified, it defaults to " | ||
+ | # if you want to separate the data logged by apcupsd from other | ||
+ | # programs. | ||
+ | #FACILITY DAEMON | ||
+ | |||
+ | # | ||
+ | # ========== Configuration statements used in updating the UPS EPROM ========= | ||
+ | # | ||
+ | |||
+ | # | ||
+ | # These statements are used only by apctest when choosing "Set EEPROM with conf | ||
+ | # file values" | ||
+ | # | ||
+ | |||
+ | # UPS name, max 8 characters | ||
+ | #UPSNAME UPS_IDEN | ||
+ | |||
+ | # Battery date - 8 characters | ||
+ | #BATTDATE mm/dd/yy | ||
+ | |||
+ | # Sensitivity to line voltage quality (H cause faster transfer to batteries) | ||
+ | # SENSITIVITY H M L (default = H) | ||
+ | # | ||
+ | |||
+ | # UPS delay after power return (seconds) | ||
+ | # WAKEUP 000 060 180 300 | ||
+ | #WAKEUP 60 | ||
+ | |||
+ | # UPS Grace period after request to power off (seconds) | ||
+ | # SLEEP 020 180 300 600 (default = 20) | ||
+ | #SLEEP 180 | ||
+ | |||
+ | # Low line voltage causing transfer to batteries | ||
+ | # The permitted values depend on your model as defined by last letter | ||
+ | # of FIRMWARE or APCMODEL. Some representative values are: | ||
+ | # D 106 103 100 097 | ||
+ | # M 177 172 168 182 | ||
+ | # A 092 090 088 086 | ||
+ | # I 208 204 200 196 | ||
+ | # | ||
+ | |||
+ | # High line voltage causing transfer to batteries | ||
+ | # The permitted values depend on your model as defined by last letter | ||
+ | # of FIRMWARE or APCMODEL. Some representative values are: | ||
+ | # D 127 130 133 136 | ||
+ | # M 229 234 239 224 | ||
+ | # A 108 110 112 114 | ||
+ | # I 253 257 261 265 | ||
+ | #HITRANSFER 253 | ||
+ | |||
+ | # Battery charge needed to restore power | ||
+ | # RETURNCHARGE 00 15 50 90 (default = 15) | ||
+ | # | ||
+ | |||
+ | # Alarm delay | ||
+ | # 0 = zero delay after pwr fail, T = power fail + 30 sec, L = low battery, N = never | ||
+ | # BEEPSTATE 0 T L N (default = 0) | ||
+ | #BEEPSTATE T | ||
+ | |||
+ | # Low battery warning delay in minutes | ||
+ | # LOWBATT 02 05 07 10 (default = 02) | ||
+ | #LOWBATT 2 | ||
+ | |||
+ | # UPS Output voltage when running on batteries | ||
+ | # The permitted values depend on your model as defined by last letter | ||
+ | # of FIRMWARE or APCMODEL. Some representative values are: | ||
+ | # D 115 | ||
+ | # M 208 | ||
+ | # A 100 | ||
+ | # I 230 240 220 225 | ||
+ | # | ||
+ | |||
+ | # Self test interval in hours 336=2 weeks, 168=1 week, ON=at power on | ||
+ | # SELFTEST 336 168 ON OFF (default = 336) | ||
+ | #SELFTEST 336</ | ||
+ | |||
+ | === Programmstart === | ||
+ | Haben wir die Konfiguration unseren Wünschen nach angepasst, steht dem Start des **apcupsd** nichts mehr im Wege. | ||
+ | # systemctl start apcupsd.service | ||
+ | |||
+ | Damit der Daemon automatisch beim Starten des Servers gleich mitstartet, aktivieren wir gleich noch den Autostart des Daemon. | ||
+ | # systemctl enable apcupsd.service | ||
+ | |||
+ | Created symlink from / | ||
+ | |||
+ | Den erfolgreichen Start des Daemon können wir wie folgt abfragen. | ||
+ | # systemctl start apcupsd.service | ||
+ | |||
+ | < | ||
+ | <font style=" | ||
+ | | ||
+ | | ||
+ | Process: 1750 ExecStartPre=/ | ||
+ | Main PID: 1752 (apcupsd) | ||
+ | | ||
+ | | ||
+ | |||
+ | Jan 08 11:41:41 vml000127.dmz.nausch.org systemd[1]: Starting APC UPS Power Control Daemon for Linux... | ||
+ | Jan 08 11:41:41 vml000127.dmz.nausch.org systemd[1]: Started APC UPS Power Control Daemon for Linux. | ||
+ | Jan 08 11:41:41 vml000127.dmz.nausch.org apcupsd[1752]: | ||
+ | Jan 08 11:41:41 vml000127.dmz.nausch.org apcupsd[1752]: | ||
+ | </ | ||
+ | |||
+ | Im Syslog wird der erfolgreiche Start entsprechend dokumentiert. | ||
+ | # less / | ||
+ | |||
+ | Jan 8 11:41:41 vml000127 apcupsd[1752]: | ||
+ | Jan 8 11:41:41 vml000127 apcupsd[1752]: | ||
+ | |||
+ | Ebenso erfolgt ein zum Start des Daemon gehöriger Log-Eintrag in der Log-/ | ||
+ | # cat / | ||
- | # cat / | + | 2017-01-08 22:24:57 +0100 |
- | 2012-07-28 15:58:51 +0200 | + | |
- | 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 | + | |
+ | === Statusabfrage === | ||
+ | Zur Abfrage des aktuellen Status unseres **apcupsd** verwenden wir das Programm **apcaccess**. | ||
- | < | + | # / |
- | DATE : | + | < |
- | HOSTNAME : vml000020.dmz.nausch.org | + | DATE : |
- | VERSION | + | HOSTNAME : vml000127.dmz.nausch.org |
+ | VERSION | ||
UPSNAME | UPSNAME | ||
CABLE : Custom Cable Smart | CABLE : Custom Cable Smart | ||
DRIVER | DRIVER | ||
UPSMODE | UPSMODE | ||
- | STARTTIME: | + | STARTTIME: |
MODEL : SMART-UPS 1400 RM | MODEL : SMART-UPS 1400 RM | ||
STATUS | STATUS | ||
- | LINEV : 226.2 Volts | + | LINEV : 221.0 Volts |
- | LOADPCT | + | LOADPCT |
BCHARGE | BCHARGE | ||
- | TIMELEFT : 9.0 Minutes | + | TIMELEFT : 17.0 Minutes |
MBATTCHG : 5 Percent | MBATTCHG : 5 Percent | ||
MINTIMEL : 3 Minutes | MINTIMEL : 3 Minutes | ||
MAXTIME | MAXTIME | ||
- | MAXLINEV : 228.8 Volts | + | MAXLINEV : 222.3 Volts |
- | MINLINEV : 226.2 Volts | + | MINLINEV : 219.7 Volts |
- | OUTPUTV | + | OUTPUTV |
SENSE : High | SENSE : High | ||
- | DWAKE : 000 Seconds | + | DWAKE : 0 Seconds |
- | DSHUTD | + | DSHUTD |
- | DLOWBATT : 02 Minutes | + | DLOWBATT : 2 Minutes |
LOTRANS | LOTRANS | ||
HITRANS | HITRANS | ||
- | RETPCT | + | RETPCT |
- | ITEMP : 34.2 C Internal | + | ITEMP : 27.4 C |
- | ALARMDEL : 5 seconds | + | ALARMDEL : 5 Seconds |
BATTV : 27.6 Volts | BATTV : 27.6 Volts | ||
LINEFREQ : 50.0 Hz | LINEFREQ : 50.0 Hz | ||
LASTXFER : Automatic or explicit self test | LASTXFER : Automatic or explicit self test | ||
NUMXFERS : 0 | NUMXFERS : 0 | ||
- | TONBATT | + | TONBATT |
- | CUMONBATT: 0 seconds | + | CUMONBATT: 0 Seconds |
XOFFBATT : N/A | XOFFBATT : N/A | ||
SELFTEST : NO | SELFTEST : NO | ||
STESTI | STESTI | ||
- | STATFLAG : 0x07000008 Status Flag | + | STATFLAG : 0x05000008 |
- | DIPSW : 0x00 Dip Switch | + | DIPSW : 0x00 |
- | REG1 : 0x00 Register 1 | + | REG1 : 0x00 |
- | REG2 : 0x00 Register 2 | + | REG2 : 0x00 |
- | REG3 : 0x00 Register 3 | + | REG3 : 0x00 |
- | MANDATE | + | MANDATE |
SERIALNO : GS9939006549 | SERIALNO : GS9939006549 | ||
- | BATTDATE : 09/23/11 | + | BATTDATE : 09/23/99 |
NOMOUTV | NOMOUTV | ||
- | NOMBATTV : 24.0 Volts | + | NOMBATTV : 24.0 Volts |
EXTBATTS : 0 | EXTBATTS : 0 | ||
FIRMWARE : 72.11.I | FIRMWARE : 72.11.I | ||
- | END APC : 2012-07-28 16:28:50 +0200 | + | END APC : 2017-01-08 14:53:15 +0100</ |
- | </ | + | |
- | + | ||
- | # vim / | + | |
- | + | ||
- | <file apache / | + | |
- | + | ||
- | # | + | |
- | # power.nausch.org | + | |
- | # | + | |
- | < | + | |
- | ServerAdmin webmaster@nausch.org | + | |
- | ServerName power.nausch.org | + | |
- | ServerAlias www.power.nausch.org | + | |
- | ServerPath / | + | |
- | DocumentRoot "/ | + | |
- | AddHandler cgi-script .cgi | + | |
- | < | + | |
- | Options FollowSymLinks | + | |
- | AllowOverride all | + | |
- | Order Allow, | + | |
- | Allow from all | + | |
- | Options ExecCGI | + | |
- | </ | + | |
- | AddType application/ | + | |
- | DirectoryIndex multimon.cgi | + | |
- | ErrorLog logs/ | + | |
- | CustomLog logs/ | + | |
- | </ | + | |
- | + | ||
- | ... | + | |
- | </ | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | < | + | === Statusbenachrichtigungen per eMail === |
+ | Bei einem Stromausfall oder anderen Störungen wird automatisch der User **root** per eMail informiert. | ||
+ | < | ||
From: root@nausch.org (root) | From: root@nausch.org (root) | ||
To: root@nausch.org | To: root@nausch.org | ||
- | Subject: | + | Subject: |
- | vml000020.dmz.nausch.org Power Failure !!! | + | vml000127.dmz.nausch.org Power Failure !!! |
- | APC : 001,052,1297 | + | APC : 001,051,1170 |
- | DATE : | + | DATE : |
- | HOSTNAME : vml000020.dmz.nausch.org | + | HOSTNAME : vml000127.dmz.nausch.org |
- | VERSION | + | VERSION |
UPSNAME | UPSNAME | ||
CABLE : Custom Cable Smart | CABLE : Custom Cable Smart | ||
Zeile 435: | Zeile 744: | ||
EXTBATTS : 0 | EXTBATTS : 0 | ||
FIRMWARE : 72.11.I | FIRMWARE : 72.11.I | ||
- | END APC : 2012-07-30 17:23:01 +0200 | + | END APC : 2017-01-08 23:23:01 +0200 |
</ | </ | ||
- | < | + | Wird die Stromversorgung wieder hergestellt, |
+ | < | ||
From: root@nausch.org (root) | From: root@nausch.org (root) | ||
To: root@nausch.org | To: root@nausch.org | ||
- | Subject: | + | Subject: |
- | vml000020.dmz.nausch.org Power has returned | + | vml000127.dmz.nausch.org Power has returned |
- | APC : 001,052,1322 | + | APC : 001,051,1170 |
- | DATE : | + | DATE : |
- | HOSTNAME : vml000020.dmz.nausch.org | + | HOSTNAME : vml000127.dmz.nausch.org |
- | VERSION | + | VERSION |
UPSNAME | UPSNAME | ||
CABLE : Custom Cable Smart | CABLE : Custom Cable Smart | ||
Zeile 498: | Zeile 808: | ||
EXTBATTS : 0 | EXTBATTS : 0 | ||
FIRMWARE : 72.11.I | FIRMWARE : 72.11.I | ||
- | END APC : 2012-07-30 17:23:59 +0200 | + | END APC : 2017-01-08 23:23:59 +0200 |
</ | </ | ||
- | ===== START ===== | ||
- | # systemctl start apcupsd.service | ||
- | < | ||
- | | ||
- | | ||
- | Process: 1750 ExecStartPre=/ | ||
- | Main PID: 1752 (apcupsd) | ||
- | | ||
- | | ||
- | Jan 08 11:41:41 vml000127.dmz.nausch.org systemd[1]: Starting APC UPS Power Control Daemon for Linux... | ||
- | Jan 08 11:41:41 vml000127.dmz.nausch.org systemd[1]: Started APC UPS Power Control Daemon for Linux. | ||
- | Jan 08 11:41:41 vml000127.dmz.nausch.org apcupsd[1752]: | ||
- | Jan 08 11:41:41 vml000127.dmz.nausch.org apcupsd[1752]: | ||
- | |||
- | # less / | ||
- | |||
- | Jan 8 11:41:41 vml000127 apcupsd[1752]: | ||
- | Jan 8 11:41:41 vml000127 apcupsd[1752]: | ||
- | |||
- | # cat / | ||
- | |||
- | 2017-01-08 11:41:41 +0100 apcupsd 3.14.12 (29 March 2014) redhat startup succeeded | ||
- | 2017-01-08 11:41:52 +0100 apcupsd FATAL ERROR in smartsetup.c at line 155 | ||
- | 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. | ||
- | 2017-01-08 11:41:52 +0100 apcupsd error shutdown completed | ||
===== apcupsd-gui ===== | ===== apcupsd-gui ===== | ||
- | ==== Installation | + | Hat man auf dem Server einen X-server am laufen, muss man sich nicht auf die textbasierten Informationen zurückgreifen. Hier kann man auch auf das **GUI**((**G**raphical **U**ser **I**nterface)) für den APCUPS-Daemon zurückgreifen. Die Installation |
# yum install -y apcupsd-gui | # yum install -y apcupsd-gui | ||
+ | Den Inhalt des RPM-Paketes erforscht man bei Interesse wie folgt. | ||
# rpm -qil apcupsd-gui | # rpm -qil apcupsd-gui | ||
< | < | ||
Zeile 564: | Zeile 847: | ||
/ | / | ||
/ | / | ||
+ | |||
+ | Der Start der GUI erfolgt über das Startmenü oder durch Aufruf des Befehls **gamcmon** nach Eingabe der Tatsenkobination **ALT**+**F2**. | ||
{{ : | {{ : | ||
- | ==== apcupsd-cgi ==== | ||
+ | ===== apcupsd-cgi ===== | ||
+ | Eine weitere Möglichkeit zur Visualisierung der Stati unseres APCUPS-Daemon ist die Verwendung einer WEB-GUI, so dass von berechtigten Hosts, Netzen und/oder Nutzern eine Statusabfrage im Intra- oder auch Internet erfolgen kann. Die notwendigen Programmteile und Konfigurationsbeispiele sind in dem RPm-Paket **apcupsd-cgi** enthalten. | ||
+ | |||
+ | ==== Installation ==== | ||
+ | Dieses Paket installieren wir nun mit Unterstützung des Befehls **yum**. | ||
# yum install apcupsd-cgi | # yum install apcupsd-cgi | ||
- | < | + | Den Inhalt des Paketes und auch den Speicherort ermitteln wir wie gewohnt mittels **rpm** und der Option //-qil//. |
- | Name : apcupsd-cgi | + | # rpm -qil apcupsd-cgi |
+ | |||
+ | < | ||
Version | Version | ||
Release | Release | ||
Zeile 600: | Zeile 891: | ||
/ | / | ||
/ | / | ||
+ | |||
+ | ==== Konfiguration ==== | ||
+ | Da wir die WEB-GUI über einen separaten Apache vHOST ansprechen wollen deaktivieren wir als erstes die mitgelieferte Apache Konfigurationsdatei // | ||
+ | |||
+ | Die Installation und Konfiguration des **// | ||
+ | # vim / | ||
+ | <file apache / | ||
+ | ## apcupsd configuration file for Apache Web server | ||
+ | ## | ||
+ | # | ||
+ | ## files are off the documentroot of Web server | ||
+ | #Alias /apcupsd / | ||
+ | #< | ||
+ | # AddHandler cgi-script cgi pl | ||
+ | # Options ExecCGI | ||
+ | #</ | ||
+ | # | ||
+ | ## | ||
+ | ## Allow only local access at default | ||
+ | ## Change the " | ||
+ | ## access rights to your needs to enable remote access also. | ||
+ | ## | ||
+ | #< | ||
+ | # DirectoryIndex upsstats.cgi | ||
+ | # AllowOverride None | ||
+ | # Options ExecCGI Indexes | ||
+ | # < | ||
+ | # # Apache 2.4 | ||
+ | # Require local | ||
+ | # </ | ||
+ | # < | ||
+ | # # Apache 2.2 | ||
+ | # Order deny,allow | ||
+ | # Deny from all | ||
+ | # Allow from 127.0.0.1 | ||
+ | # Allow from ::1 | ||
+ | # </ | ||
+ | #</ | ||
+ | |||
+ | Die Konfiguration unseres Apache vHOST erledigen wir mit Hilfe einer eigenen Konfigurationsdatei // | ||
+ | |||
+ | <file bash / | ||
+ | # power.nausch.org | ||
+ | # | ||
+ | < | ||
+ | ServerAdmin webmaster@nausch.org | ||
+ | ServerName power.nausch.org | ||
+ | ServerPath / | ||
+ | DocumentRoot "/ | ||
+ | AddHandler cgi-script .cgi | ||
+ | DirectoryIndex multimon.cgi | ||
+ | |||
+ | < | ||
+ | Require all granted | ||
+ | AddHandler cgi-script cgi pl | ||
+ | Options ExecCGI | ||
+ | </ | ||
+ | |||
+ | AddType application/ | ||
+ | ErrorLog logs/ | ||
+ | CustomLog logs/ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | Den Zugriff werden wir natürlich entsprechend beschneiden und den Transportweg absichern. Auf unserem HTTP-Proxy-Host legen wir hierzu eine passende vHOST-Konfigurationsdatei an. | ||
+ | # vim / | ||
+ | <file apache / | ||
+ | # Django : 2015-10-29 | ||
+ | # vHost power | ||
+ | # | ||
+ | |||
+ | # Variablen der Hostvariablen | ||
+ | Define vhost power | ||
+ | Define errors_log logs/ | ||
+ | Define access_log logs/ | ||
+ | Define ssl_log logs/ | ||
+ | |||
+ | < | ||
+ | ServerAdmin webmaster@nausch.org | ||
+ | ServerName ${vhost}.nausch.org | ||
+ | |||
+ | RewriteEngine on | ||
+ | RewriteCond %{HTTPS} off | ||
+ | RewriteRule (.*) https:// | ||
+ | |||
+ | # Welche Logdateien sollen beschrieben werden | ||
+ | SetEnvIf Remote_Addr " | ||
+ | ErrorLog | ||
+ | CustomLog ${access_log} combined env=!dontlog | ||
+ | </ | ||
+ | < | ||
+ | ServerAdmin webmaster@nausch.org | ||
+ | ServerName ${vhost}.nausch.org | ||
+ | ServerPath / | ||
+ | |||
+ | # Wer soll Zugriff auf die Webseite(n) bekommen? | ||
+ | <Proxy *> | ||
+ | Options +FollowSymLinks +Multiviews -Indexes | ||
+ | AllowOverride None | ||
+ | AuthType Basic | ||
+ | AuthName "Fuer den Zugriff auf den Webserver bitte Anmeldedaten eingeben!" | ||
+ | AuthBasicProvider ldap | ||
+ | AuthLDAPUrl ldaps:// | ||
+ | AuthLDAPBindDN cn=TechnischerUser, | ||
+ | AuthLDAPBindPassword " | ||
+ | AuthLDAPBindAuthoritative on | ||
+ | Require ldap-user django | ||
+ | </ | ||
+ | |||
+ | # Welcher Inhalt soll angezeigt bzw. auf welchen Server sollen die HTTP-Requests weitergeleitet werden? | ||
+ | ProxyRequests Off | ||
+ | ProxyPreserveHost On | ||
+ | ProxyPass / http:// | ||
+ | ProxyPassReverse / http:// | ||
+ | |||
+ | # Welche Logdateien sollen beschrieben werden | ||
+ | SetEnvIf Remote_Addr " | ||
+ | ErrorLog | ||
+ | CustomLog ${access_log} combined env=!dontlog | ||
+ | CustomLog ${ssl_log} "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \" | ||
+ | |||
+ | # Absicherung der Übertragung mit Hilfe von TLS | ||
+ | # Django : 2015-10-04 - TLS-Verschlüsselung mit Hilfe von mod_ssl | ||
+ | SSLEngine on | ||
+ | # Definition der anzubietenden Protokolle | ||
+ | SSLProtocol All -SSLv2 -SSLv3 -TLSv1 -TLSv1.1 | ||
+ | # Definition der Cipher | ||
+ | SSLCipherSuite ECDHE-RSA-AES256-GCM-SHA384: | ||
+ | # Schlüsseldatei, | ||
+ | SSLCertificateKeyFile / | ||
+ | # Zertifikatsdatei, | ||
+ | SSLCertificateFile / | ||
+ | # Zertifikatsdatei des bzw. der Intermediate-Zertifikate(s) | ||
+ | SSLCertificateChainFile / | ||
+ | # Änderung der Cipherorder der Clients verneinen | ||
+ | SSLHonorCipherOrder on | ||
+ | # TLS 1.0 Kompremmierung deaktivieren (CRIME attacks) | ||
+ | SSLCompression off | ||
+ | # Online Certificate Status Protocol stapling zum Prüfen des Gültigkeitsstatus des Serverzertifikats. | ||
+ | SSLUseStapling on | ||
+ | SSLStaplingResponderTimeout 5 | ||
+ | SSLStaplingReturnResponderErrors off | ||
+ | |||
+ | # HTTP Strict Transport Security (HSTS), bei dem der Server dem Client im HTTP-Header mitteilt, | ||
+ | # dass dieser nur noch verschlüsselt mit dem Server kommunizieren soll. | ||
+ | Header always set Strict-Transport-Security " | ||
+ | |||
+ | # This header enables the Cross-site scripting (XSS) filter built into most recent web browsers. | ||
+ | # It's usually enabled by default anyway, so the role of this header is to re-enable the filter for | ||
+ | # this particular website if it was disabled by the user. | ||
+ | # https:// | ||
+ | #Header set X-XSS-Protection "1; mode=block" | ||
+ | Header always set X-Xss-Protection "1; mode=block" | ||
+ | |||
+ | # when serving user-supplied content, include a X-Content-Type-Options: | ||
+ | # to disable content-type sniffing on some browsers. | ||
+ | # https:// | ||
+ | # currently suppoorted in IE > 8 http:// | ||
+ | # http:// | ||
+ | # ' | ||
+ | # Sofern die Datei auch den entsprechenden MIME-Typ " | ||
+ | # CSS-Dateien nur als CSS interprätieren. | ||
+ | Header always set X-Content-Type-Options nosniff | ||
+ | |||
+ | # config to don't allow the browser to render the page inside an frame or iframe | ||
+ | # and avoid clickjacking http:// | ||
+ | # if you need to allow [i]frames, you can use SAMEORIGIN or even set an uri with ALLOW-FROM uri | ||
+ | # https:// | ||
+ | ###header set X-Frame-Options SAMEORIGIN | ||
+ | header always set X-Frame-Options DENY | ||
+ | |||
+ | # hide server header (apache and php version) | ||
+ | Header always unset Server | ||
+ | |||
+ | # Only allow JavaScript from the same domain to be run. | ||
+ | # don't allow inline JavaScript to run. | ||
+ | Header always set X-Content-Security-Policy "allow ' | ||
+ | |||
+ | # Add Secure and HTTP only attributes to cookies | ||
+ | Header edit Set-Cookie ^(.*)$ $1; | ||
+ | |||
+ | # prevent Clickjacking Attack | ||
+ | #Header always append X-Frame-Options SAMEORIGIN | ||
+ | Header always set X-Frame-Options " | ||
+ | |||
+ | # hkpk-stuff | ||
+ | Header always set Public-Key-Pins " | ||
+ | </ | ||
+ | |||
+ | Bevor wir zur Aktivierung unserer Konfigurationsänderungen den bzw. die HTTP-Daemon einmal durchstarten überprüfen wir unsere Apache-Konfigurationsdateien auf syntaktische Fehler. | ||
+ | # apachectl -t | ||
+ | |||
+ | Syntax OK | ||
+ | |||
+ | Ist alles O.K. starten wir den/die Daemon nun einmal neu. | ||
+ | # systemctl restart httpd.service | ||
+ | |||
+ | < | ||
+ | <font style=" | ||
+ | | ||
+ | | ||
+ | Docs: man: | ||
+ | | ||
+ | Process: 11642 ExecStop=/ | ||
+ | Main PID: 11647 (httpd) | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | Jan 09 11:03:23 vml000127.dmz.nausch.org systemd[1]: Starting The Apache HTTP Server... | ||
+ | Jan 09 11:03:23 vml000127.dmz.nausch.org systemd[1]: Started The Apache HTTP Server.</ | ||
+ | </ | ||
+ | |||
+ | Nun starten wir einen Browser und öffnen die zugehörige URL. | ||
+ | $ konqueror http:// | ||
+ | |||
+ | Im ersten Bild sehen wir die Startseite der WEB-GUI. | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | Das zweite Bild zeigt die Übersicht zu den aktuellen Stati unserer USV. | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | Eine Ansicht aller Detailangaben zeigt das dritte Bild. | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | ====== Links ====== | ||
+ | * **[[wiki: | ||
+ | * **[[http:// | ||
+ | |||
+ | |||