Warning: session_start(): open(/tmp/sess_78d92a664cccb8d100be2c59d614c58e, O_RDWR) failed: No space left on device (28) in /var/www/html/inc/init.php on line 265

Warning: session_start(): Failed to read session data: files (path: ) in /var/www/html/inc/init.php on line 265
Writing /var/www/html/data/log/error/2024-06-17.log failed

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/inc/init.php:265) in /var/www/html/inc/auth.php on line 432
Writing /var/www/html/data/log/error/2024-06-17.log failed

Warning: Trying to access array offset on value of type bool in /var/www/html/inc/parserutils.php on line 313
Writing /var/www/html/data/log/error/2024-06-17.log failed

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/inc/init.php:265) in /var/www/html/inc/actions.php on line 38
apcupsd [Ben's notes]

Ben's notes

Linux, Unix, network, radio...

User Tools

Site Tools


apcupsd

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: 2021/10/09 15:14 by 127.0.0.1