How do I move the downloaded .Deb installer for powerpanel to proxmox and install. Want to have the program to alow automatic shutdowns.
curl -o cyberpowerpowerpanel.deb https://www.cyberpower.com/tw/en/File/GetFileSampleByType?fileId=SU-18070001-06&fileType=Download%20Center&fileSubType=FileOriginal
dpkg -i cyberpowerpowerpanel.deb
pwrstat -status
pwrstat -pwrfail -delay 60 -active on -cmd /etc/pwrstatd-powerfail.sh -duration 1 -shutdown on
pwrstat -lowbatt -runtime 300 -capacity 35 -active on -cmd /etc/pwrstatd-lowbatt.sh -duration 1 -shutdown on
man pwrstat
Thanks for this! SO much easier than nut server. Thank youOk 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.
Yes that would be helpful. I have never setup nut client ( I have server)if needed i will post my config files as an example. Just let me know
/etc/ssmtp/ssmtp.conf
AuthUser=user@gmail.com
AuthPass=GmailPassword #obtain from ”Applications Password” on your google account
FromLineOverride=YES
mailhub=smtp.gmail.com:587
UseSTARTTLS=YES
echo "this is for testing" | mail -s "$(echo -e "test\nFrom: UPS Alert <yourdesiredsenderaddress@email.com>\nContent-Type: text/html\n")" recipient@email.com
echo "${DATA[*]}" | mail \
-s "$(echo -e "$SUBJECT\nFrom: $FROM\n")" \
"$TO"
exit 0
/etc/pwrstatd-email.sh
with the following:IFS=$'\n'
echo "${DATA[*]}" | mail -s "$SUBJECT" root
exit 0