Cyberpower power panel

Dec 24, 2022
44
7
8
How do I move the downloaded .Deb installer for powerpanel to proxmox and install. Want to have the program to alow automatic shutdowns.
 
It's a cyberpower ups. Would like to somehow configure everything to auto shutdown. I saw a thing where someone used NUT on pfsense router and had proxmox pull info from that to alow auto shutdown of all connected devices. That would be nice
 
I have the same question. I saw on another post that a user recommended installing cyber power's Debian linux based power panel software directly on the proxmox host instead of using NUT. I like that idea and would like to do that. However, I am new to proxmox and I am unsure how to install 3rd party software that is not in the repository directly to the proxmox host.

Did you end up finding a solution?
 
it could be an lxc ubun or alpine with the cyberpower soft installed on it. As being even smaller in resource..
 
i figured out how to get it installed.
i went into the proxmox shell and typed:
curl -o cyberpowerpowerpanel.deb https://www.cyberpower.com/tw/en/File/GetFileSampleByType?fileId=SU-18070001-06&fileType=Download%20Center&fileSubType=FileOriginal
to download the installer.
then I did:
dpkg -i cyberpowerpowerpanel.deb
and that installed it.

it is definately working insofar as that I can type
pwrstat -status

and it will display things like battery capacity and runtime.

I am still unsure how to configure it for a graceful shutdown from here but I am working on it and I will get back to you.
 
Ok I configured the graceful shutdown and it worked perfectly. For me personally, this was a much better solution than NUT (although if I end up with a setup in the future with multiple servers connected to the same UPS - or something else requiring different commands being sent to different machines, I can see why I would use NUT in that case.)

After you get the install set up from my post above, here is how you set up graceful shutdowns for power failures (mine is currently set up for a shutdown after 1 minute, but I might change it to 5 minutes by changing the delay from 60 to 300):
pwrstat -pwrfail -delay 60 -active on -cmd /etc/pwrstatd-powerfail.sh -duration 1 -shutdown on

you can also do a shutdown for low battery like this (This is set for when you have less than 5 minutes of battery time remaining but you can adjust that by changing the 300 seconds to something else if you like):
pwrstat -lowbatt -runtime 300 -capacity 35 -active on -cmd /etc/pwrstatd-lowbatt.sh -duration 1 -shutdown on

you can see all the options at:
man pwrstat

i tested the above by unplugging the UPS and after 1 minute, proxmox shutdown.
 
Ok I configured the graceful shutdown and it worked perfectly. For me personally, this was a much better solution than NUT (although if I end up with a setup in the future with multiple servers connected to the same UPS - or something else requiring different commands being sent to different machines, I can see why I would use NUT in that case.)

After you get the install set up from my post above, here is how you set up graceful shutdowns for power failures (mine is currently set up for a shutdown after 1 minute, but I might change it to 5 minutes by changing the delay from 60 to 300):
pwrstat -pwrfail -delay 60 -active on -cmd /etc/pwrstatd-powerfail.sh -duration 1 -shutdown on

you can also do a shutdown for low battery like this (This is set for when you have less than 5 minutes of battery time remaining but you can adjust that by changing the 300 seconds to something else if you like):
pwrstat -lowbatt -runtime 300 -capacity 35 -active on -cmd /etc/pwrstatd-lowbatt.sh -duration 1 -shutdown on

you can see all the options at:
man pwrstat

i tested the above by unplugging the UPS and after 1 minute, proxmox shutdown.
Thanks for this! SO much easier than nut server. Thank you
 
you might want to mark this thread as a tutorial!
nicely done... though i have 3 servers and need to figure out NUT with my cyberpower with RM card :)
 
if its not to late i just use my pi3 as a nut server and then setup nut client on the proxmox hosts... Very straight forward setup..
 
  • Like
Reactions: scyto
Thanks so much @NOiSEA for sharing, this certainly saved me a lot of hassle. For anyone who wants to also set up email alerts, this is what worked for me:

1. Install ssmtp or your desired smtp service. For ssmtp configure
Code:
/etc/ssmtp/ssmtp.conf

Example for gmail:

Code:
AuthUser=user@gmail.com
AuthPass=GmailPassword #obtain from ”Applications Password” on your google account
FromLineOverride=YES
mailhub=smtp.gmail.com:587
UseSTARTTLS=YES

2. Test to ensure the mail command works

Code:
echo "this is for testing" | mail -s "$(echo -e "test\nFrom: UPS Alert <yourdesiredsenderaddress@email.com>\nContent-Type: text/html\n")" recipient@email.com

3. Edit the email script command at the end of your pwrstatd-email.sh script (in /etc/) to follow the current syntax for Mailutils if it's not like this already:

Code:
echo "${DATA[*]}" | mail \

-s   "$(echo -e "$SUBJECT\nFrom: $FROM\n")" \

     "$TO"

exit 0

(ref: https://github.com/bhavenga/pwrstatd_scripts/blob/master/pwrstatd-email.sh )

I also edited the "TO:" line to have my single email address instead of pulling it from the powerfail/lowbatt scripts $RECEIPT_ADDRESS since I'm only using this at home and have the same recipient address for everything.

4. Ensure in the shell script being used, e.g. pwrstatd-powerfail.sh or pwrstatd-lowbatt.sh, the email variable is set to yes.
 
if you setup smtp via datacenter you can simply ignore the from to address variables in your scripts and setup /etc/pwrstatd-email.sh with the following:

Bash:
IFS=$'\n'

echo "${DATA[*]}" | mail -s "$SUBJECT" root

exit 0
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!