Ben Stienstra

Linux, Unix, network, radio and more...

User Tools

Site Tools


apcupsd

~~TOC~~

APCUSPd CentOS 6.5

This guide will let you configure apcupsd using PCNET broadcasts from the UPS network management card.

Prerequisites:

  • EPEL repo
  • APC UPS with network management card 2, firmware 6.1.1.

Configure APC network management card to allow PCNET connection

PCNET is UDP broadcast communication over port 3052. If you use a firewall, open communication for this port.

  • Configuration → Shutdown, disable Basic Signaling Shutdown.
  • Configuration → Shutdown, enter 16 character shutdown phrase.
  • Configuration → Shutdown, username: device.
  • Configuration → PowerChute clients → add client IP address.

Install and configure apcupsd

  • Install apcupsd.
    yum install apcupsd
  • Autostart apcupsd after boot.
    chkconfig apcupsd on
  • Configure apcupsd. Edit /etc/apcupsd/apcupsd.conf.
    UPSNAME SMART750
    UPSCABLE ether
    UPSTYPE pcnet
    DEVICE 1.2.3.4:apc:1234567890123456       # Your 16 char shutdown phrase.
    BATTERYLEVEL 10                           # Issue shutdown at or below 10% battery.
    MINUTES 10                                # If runtime left is 10 minutes or below, shutdown.
  • Open UDP 3052 from UPS to server. Edit /etc/sysconfig/iptables
    -A INPUT -m state --state NEW -m udp -p udp --dport 3052 -j ACCEPT
  • Restart iptables.
    service iptables restart
  • SELinux: Allow bind to port 3052. This should be fixed in newer versions of CentOS.
    yum -y install policycoreutils-python
    setenforce 0
    
    # clear the audit log
    cd /var/log/audit
    echo > audit.log
    
    service apcupsd start
    service apcupsd stop
    
    setenforce 1
    
    cp audit.log /var/tmp
    cd /var/tmp
    
    audit2allow -M myapcupsd < audit.log
    
    semodule -i myapcupsd.pp
  • Start apcupsd.
    service apcupsd start

Test

  • Wait 30 seconds for the PCNET broadcast and test access.
    apcaccess
apcupsd.txt · Last modified: 2014/06/10 23:34 by admin