This is an old revision of the document!
PowerPanel e-mail alerts use the
mail
command. This will not work on XenServer and many other boxes, at least not without additional tweaking. Don't enable mail alerts without first dealing with the mail
command.
See also: Postfix Authenticated Smarthost
See also: SSMTP
Connect the included USB cable to UPS. You may have problems getting it to work with the serial cable.
Tested with SME Server 8 and a CyberPower CP900AVR UPS.
rpm -Uvh http://www.cyberpowersystems.com/software/powerpanel_123_i386.rpm
Tested with SME Server 7.3 and a CyberPower CP1500AVRT UPS.
Download the PowerPanel software to the machine where the UPS is connected:
wget http://www.cyberpowersystems.com/software/powerpanel_1.2_i386.tar.gz
Unpack and install:
tar -xzvf powerpanel-1.1.tar.gz cd powerpanel-1.1 ./install.sh
pwrstat -status pwrstat -config
Verify startup:
chkconfig --list |grep pwr
For SME Server only which uses runlevel 7:
ln -s /etc/rc.d/init.d/pwrstatd /etc/rc7.d/S93pwrstatd
We don't want the server to shut down immediately upon power failure…we want to wait until the battery gets low before we actually run the shutdown command.
Edit the PowerPanel configuration file:
vi /etc/pwrstatd.conf
And change:
powerfail-shutdown = no #we want to shut down the UPS when the battery gets low, not when the power fails shutdown-sustain = 200 #set this to a little longer than it takes to shut your server down lowbatt-threshold = 15 #don't run the battery completely dead
Restart the service:
/etc/init.d/pwrstatd restart
or
service pwrstatd restart
Commands that run upon power-fail and low-battery events are also specified in the /etc/pwrstatd.conf configuration file. By default, it specifies:
/etc/pwrstatd-powerfail.sh
and
/etc/pwrstatd-lowbatt.sh
You may want to change the lowbatt-threshold so the box shuts down in a shorter time, then change it back when finished testing.
lowbatt-threshold = 15 service pwrstatd restart tail -f /var/log/pwrstatd.log
Modifications to above for XenServer:
vi /etc/pwrstatd.conf
And change:
powerfail-shutdown = no #we want to shut down the UPS when the battery gets low, not when the power fails shutdown-sustain = 600 #set this to a little longer than it takes to shut down all VMs and your server lowbatt-threshold = 35 #don't run the battery completely dead and give time to shut down
vi /etc/pwrstatd-lowbatt.sh
and append:
xe vm-shutdown power-state=running --multiple