DescriptionThis page covers setting up a UPS in Ubuntu, specifically related to my setup and UPS from APC.
- A working ubuntu system
- A supported APC UPS
InstallationFirst, install the apcupsd package if not already installed. This package contains the tools and daemon necessary for communicating with the APC UPS.
sudo apt-get install apcupsd
ConfigurationWe need to edit two files to configure and enable the apcupsd daemon.
- The first file controls the configuration for the UPS type and port.
- The second file controls the daemon and prevents is from running unconfigured.
sudo nano /etc/apcupsd/apcupsd.confChange the following parameters (adjust as necessary for your UPS). For my UPS, I have a usb model and the below are the settings for my setup.
UPSNAME UPS550 UPSCABLE usb UPSTYPE usb DEVICE POLLTIME 60Now we can enable the daemon to start on boot and become active by editing the following.
sudo nano /etc/default/apcupsdChange the following parameter from 'no' to 'yes'.
ISCONFIGURED=yesThen restart the apcupsd daemon.
sudo service apcupsd restartIf all went well, you can check the status of the apcupsd service (daemon).
sudo service apcupsd statusAnd you should see something like the below snippit, showing the service is active (running)
apcupsd.service - LSB: Starts apcupsd daemon Loaded: loaded (/etc/init.d/apcupsd) Active: active (running) since Mon 2016-05-02 15:40:02 NDT
TestingTo test the APC UPS driver, you will need to stop the service first, otherwise the test will be unable to connect to the UPS.
sudo service apcupsd stopNow run the APC test program.
sudo apctestThe tests listed below are pretty self-explanatory. For more information, please refer to the Ubuntu community docs or the main apcupsd site.
Please select the function you want to perform. 1) Test kill UPS power 2) Perform self-test 3) Read last self-test result 4) View/Change battery date 5) View manufacturing date 6) View/Change alarm behavior 7) View/Change sensitivity 8) View/Change low transfer voltage 9) View/Change high transfer voltage 10) Perform battery calibration 11) Test alarm 12) View/Change self-test interval Q) Quit Select function number:Remember to restart the UPS service once completed with apctest.
sudo service apcupsd start