Linux: Configure and Control APC SmartUPS During a Power Failure

The APC SmartUPS can be configured and controlled during a power failure on a Linux system using the apcupsd daemon and its associated utilities.

Here’s how to set it up:

  1. Install the apcupsd package:
    • On Debian/Ubuntu based systems:
    sudo apt-get update
    sudo apt-get install apcupsd
    • On Red Hat/CentOS based systems:
    sudo yum install apcupsd
  2. Configure the apcupsd daemon:
    • Edit the configuration file /etc/apcupsd/apcupsd.conf and set the values for the following parameters:
      • UPSNAME: a name for the UPS.
      • UPSCABLE: the cable type used to connect the UPS to the system.
      • UPSTYPE: the type of UPS (e.g. “smart”).
      • DEVICE: the device file that represents the UPS (e.g. “/dev/ttyS0”).
      • ONBATTERYDELAY: the time in seconds to wait before shutting down the system when on battery power.
  3. Start the apcupsd daemon:
    sudo systemctl start apcupsd
  4. Check the status of the UPS:
    apcaccess status
  5. Perform a controlled shutdown of the system:
    sudo apcupsd-cgi stop

Note: The exact configuration steps may vary depending on your specific setup and UPS model. Please refer to the apcupsd manual for more information.

Leave a Comment