CyberPower UPS

From ArchWiki
Revision as of 09:51, 14 August 2013 by Scarletxfi (Talk | contribs) (Created page with "Category:Power management This document describes how to install the CyberPower UPS daemon. The main advantage of using a CyberPower UPS is that it is cheap and it can com...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This document describes how to install the CyberPower UPS daemon. The main advantage of using a CyberPower UPS is that it is cheap and it can communicate with your Linux box through either a RS-232 or USB serial connection. In the event of a prolonged power outage, should the CyberPower UPS lose most of its battery capacity, it can tell the Linux box to perform a safe shutdown.

Download and Extract the package

Download the PowerPanel tar.gz package from here: http://www.cpsww.com.au/products/ups_systems/Value_soho/value600ei.htm

tar -zxvf package

Install Procedure

The latest PowerPanel version 1.2.3-0, only include support for rc.d, as such some manual intervention is needed. Using the included install.sh file as template, it needs to be modified for systemd so it should look like this:

In the following example, the lines of text are changed to support a USB style cable: {{bc| vim install.sh

  1. !/bin/sh
  1. The PowerPanel for Linux Software Installation


  1. copy files
  1. PowerPanel for Linux client program

/bin/cp bin/pwrstat /usr/sbin

  1. PowerPanel for Linux daemon program

/bin/cp bin/pwrstatd /usr/sbin

  1. Script command for event of power failure

if [ ! -e /etc/pwrstatd-powerfail.sh ]; then /bin/cp script/pwrstatd-powerfail.sh /etc fi

  1. Script command for event of battery low

if [ ! -e /etc/pwrstatd-lowbatt.sh ]; then /bin/cp script/pwrstatd-lowbatt.sh /etc fi

  1. Script command for e-mail notification

if [ ! -e /etc/pwrstatd-email.sh ]; then /bin/cp script/pwrstatd-email.sh /etc fi

  1. PowerPanel for Linux daemon configuration

if [ ! -e /etc/pwrstatd.conf ]; then /bin/cp conf/pwrstatd.conf /etc fi

  1. PowerPanel for Linux client man-page

if [ ! -e /usr/share/man/man8/pwrstat.8.gz ]; then /bin/cp doc/pwrstat.8 /usr/share/man/man8 fi

  1. PowerPanel for Linux daemon man-page

if [ ! -e /usr/share/man/man8/pwrstatd.8.gz ]; then /bin/cp doc/pwrstatd.8 /usr/share/man/man8 fi

  1. compress the man page file

if [ -e /usr/share/man/man8/pwrstat.8 ]; then if [ -e /usr/bin/gzip ]; then /usr/bin/gzip -9 /usr/share/man/man8/pwrstat.8 else /bin/gzip -9 /usr/share/man/man8/pwrstat.8 fi fi

if [ -e /usr/share/man/man8/pwrstatd.8 ]; then if [ -e /usr/bin/gzip ]; then /usr/bin/gzip -9 /usr/share/man/man8/pwrstatd.8 else /bin/gzip -9 /usr/share/man/man8/pwrstatd.8 fi fi


  1. Change the files owner

/bin/chown root:root /usr/sbin/pwrstat /bin/chown root:root /usr/sbin/pwrstatd /bin/chown root:root /etc/pwrstatd-powerfail.sh /bin/chown root:root /etc/pwrstatd-lowbatt.sh /bin/chown root:root /etc/pwrstatd-email.sh /bin/chown root:root $STRATUP_DIR/$DAEMON /bin/chown root:root /etc/pwrstatd.conf /bin/chown root:root /usr/share/man/man8/pwrstat.8.gz /bin/chown root:root /usr/share/man/man8/pwrstatd.8.gz

  1. Change the files mode

/bin/chmod 700 /usr/sbin/pwrstat /bin/chmod 700 /usr/sbin/pwrstatd /bin/chmod 700 /etc/pwrstatd-powerfail.sh /bin/chmod 700 /etc/pwrstatd-lowbatt.sh /bin/chmod 700 /etc/pwrstatd-email.sh /bin/chmod 700 $STRATUP_DIR/$DAEMON /bin/chmod 600 /etc/pwrstatd.conf /bin/chmod 644 /usr/share/man/man8/pwrstat.8.gz /bin/chmod 644 /usr/share/man/man8/pwrstatd.8.gz


if you try and run /usr/bin/pwrstat you should get "Daemon service is not found." So you need to create a custom service as below {{

  1. vim /etc/systemd/system/pwrstatd.service

[Unit] Description=The PowerPanel Service for Linux to monitor CyberPower UPS

[Service] Type=simple ExecStart=/usr/sbin/pwrstatd

[Install] WantedBy=multi-user.target }}

run the service {{

  1. systemctl start pwrstatd
  2. systemctl enable pwrstatd

}}

Then run {{

  1. pwrstat -status

}}

You should get something like this


The UPS information shows as following:

        Properties:
                Model Name...................  Value 1500E
                Firmware Number.............. BFF7104#7N5
                Rating Voltage............... 230 V
                Rating Power................. 900 Watt
 
        Current UPS status:
                State........................ Normal
                Power Supply by.............. Utility Power
                Utility Voltage.............. 230 V
                Output Voltage............... 230 V
                Battery Capacity............. 100 %
                Remaining Runtime............ 61 min.
                Load......................... 126 Watt(14 %)
                Line Interaction............. None
                Test Result.................. Unknown
                Last Power Event............. None