apcupsd auf Xenserver 7.x
libusb installieren:
yum --enablerepo=base install libusb
apcupsd Paket herunterladen: Infos dazu finden sich hier.
wget http://dl.fedoraproject.org/pub/epel/7/x86_64/a/apcupsd-3.14.14-5.el7.x86_64.rpm
Installieren:
rpm -Uvh apcupsd-3.14.14-5.el7.x86_64.rpm
Jetzt gehts weiter wie immer, man muss in der Datei /etc/apcupsd/apcupsd.conf
die Konfiguration anpassen, insbesondere Kabeltyp, USV-Typ und Schnittstelle.
Um zu sehen, ob die USv erreichbar ist, kann man den Befehl apctest
verwenden:
[root@lise apcupsd]# apctest 2017-08-26 20:08:32 apctest 3.14.14 (31 May 2016) redhat Checking configuration ... : Warning: old configuration file found. : Expected: "## apcupsd.conf v1.1 ##" : Found: "UPSCABLE smart " : Please check new file format and : modify accordingly the first line : of config file . : Processing config file anyway. sharenet.type = Network & ShareUPS Disabled cable.type = Custom Cable Smart mode.type = APC Smart UPS (any) Setting up the port ... Doing prep_device() ... You are using a SMART cable type, so I'm entering SMART test mode Hello, this is the apcupsd Cable Test program. This part of apctest is for testing Smart UPSes. Please select the function you want to perform. 1) Query the UPS for all known values 2) Perform a Battery Runtime Calibration 3) Abort Battery Calibration 4) Monitor Battery Calibration progress 5) Program EEPROM 6) Enter TTY mode communicating with UPS Q) Quit Select function number:
Wenn alles soweit passt, wie man das möchte, muss man den Dienst noch starten und aktivieren:
systemctl start apcupsd.service systemctl enable apcupsd.service
Einsatz in Kürze 1):
tar -xvzf check_apcupsd.tgz
erzeugt die Datei usr/local/bin/check_apcupsd
In der Datei /etc/check_mk/mrpe.dfg
die folgenden Checks definieren, Grenzen für warning (-w) und critical (-c) nach Bedarf anpassen 2).
# USV USV_LOAD /usr/local/bin/check_apcupsd -c 70 -w 60 loadpct USV_TEMP /usr/local/bin/check_apcupsd -c 50 -w 44 itemp USV_BCHARGE /usr/local/bin/check_apcupsd -c 10 -w 30 bcharge USV_TIMELEFT /usr/local/bin/check_apcupsd -c 1 -w 5 timeleft