For some reason no rpm package for apcupsd is available for CentOS 6, it is however available for CentOS 7 from the epel repo.
These notes focus on compiling, installing and setting up apcupsd for CentOS 6.
2. Getting the source and installing (compiling) it
Go here; https://sourceforge.net/projects/apcupsd/?source=directory and download the latest version.
Go to your Downloads folder and untar the archive, then start compiling the source for your system.
tar -xvf apcupsd-3.14.14.tar.gz
If the above configure step fails, you may want to check that your system has the needed dev tools installed.
yum groupinstall "Development Tools"
When installed, rerun the configure.
3. Connecting the UPS
If the UPS is brand-new; remove the plate at the bottom of the UPS and connect the battery; plus to plus, minus to minus, otherwise continue below. Replace the plate when done.
Shutdown your computer system and disconnect your computer power plug/s from the wall and connect it/them to the UPS using any of the four plugs marked BATTERY BACKUP + SURGE PROTECTION.
Connect the supplied RJ11-to-USB from the UPS to the computer.
Connect the UPS to the electrical outlet in the wall.
The UPS should beep a few times, blink the green LED after whoch the green LED will stay on lit if the power-up went well.
Boot your computer.
After boot, check /var/log/messages for something like the below. This indicates the computer found the usb-conencted UPS.
Jul 8 12:56:42 cyndane2 kernel: usb 1-3.2: new low speed USB device number 4 using ehci_hcd
Jul 8 12:56:42 cyndane2 kernel: usb 1-3.2: New USB device found, idVendor=051d, idProduct=0002
Jul 8 12:56:42 cyndane2 kernel: usb 1-3.2: New USB device strings: Mfr=3, Product=1, SerialNumber=2
Jul 8 12:56:42 cyndane2 kernel: usb 1-3.2: Product: Back-UPS ES 700G FW:871.O4 .I USB FW:O4
Jul 8 12:56:42 cyndane2 kernel: usb 1-3.2: Manufacturer: APC
Jul 8 12:56:42 cyndane2 kernel: usb 1-3.2: SerialNumber: 123456789100
Jul 8 12:56:42 cyndane2 kernel: usb 1-3.2: configuration #1 chosen from 1 choice
Jul 8 12:56:42 cyndane2 kernel: generic-usb 0003:051D:0002.0005: hiddev96,hidraw4: USB HID v1.10 Device [APC Back-UPS ES 700G FW:871.O4 .I USB FW:O4 ] on usb-0000:00:1a.7-3.2/input0
4. Configure the daemon
The config file is in /etc/apcupsd/apcupsd.conf. Edit it with eg nano.
Change the following lines to your specification.
Please note, the DEVICE line must not be commented. It must be there but the device should be blanked.
The below lines can be left with their default settings, or changed to suit your situation.
The NETSERVER must be on in order to check the UPS status with apcaccess. Check any of the sources below to find out what the settings do!
5. Testing the UPS
Stop the apcupsd(aemon) if started.
service apcupsd stop
The presented test functions should be fairly self-explanatory.
6. Halt scripts
Check /etc/rc.d/init.d/halt to ensure it has apcupsd setting updated at the end.
7. Enable the daemon
apcupsd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
chkconfig apcupsd on
apcupsd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
8. Control apcupsd
service apcupsd start
service apcupsd stop
service apcupsd restart
9. See current UPS status
10. Web based monitoring
Using apcupsd-cgi; future project to set up.
http://www.apcupsd.org/manual/manual.html (use "http" for this link)