Electrical power recommendations

More
2 years 5 months ago #495 by retate
Electrical power recommendations was created by retate
The myServer Startup states the following "Connecting the Controller to a good Uniteruptible Power Supply (UPS) helps prevent inadvertant power cycling events." I agree with this, however I would hope it could be taken one step further to be able to shutdown based on communication with the UPS when there is an extended power failure. As this is common practice for Network Attached Storage such as QNAP, Windows Server, etc. I would think there would be a way to do it for this application. Could this be addressed with documentation or is there software development needed to make this possible?

Please Log in to join the conversation.

More
2 years 5 months ago #515 by Krumpy
Replied by Krumpy on topic Electrical power recommendations
Folks.... 

Yes, myServer6 can have integration with a UPS. Of course, since there are so many UPS devices/manufacturers out there, I have done the implementation with APCUPSD. Would love to do a integration with a Generac, but do not yet have the funds to implement one in my Florida home.    Another day....   To date, the integration has been simple just to gracefully shutdown myServer during power outage. 

So let's start the conversation with what hardware you have, and what are your objectives.

Please Log in to join the conversation.

More
2 years 5 months ago - 2 years 5 months ago #516 by Krumpy
Replied by Krumpy on topic UPS via APCUPSD software (linux)
The APCUPSD package:

To install run sudo apt-get install apcupsd command from a Linux terminal and then you will find the files in /etc/apcupsd folder. Find more info at  apcupsd | A daemon for controlling APC UPSes  .  Happy reading....

As part of the APCUPSD package, there is a file named APCCONTROL file which allows one to customize what to do in an event. In the "DOSHUTDOWN" section one can define commands which will run as part of the shutdown UPS procedures.    Here I just ran the enclosed CURL command:to shutdown myServer and OS before UPS cuts the power. Very simple:
    doshutdown)
        echo "UPS ${2} initiated Shutdown Sequence" | ${WALL}
        ${SHUTDOWN} -h now "apcupsd UPS ${2} initiated shutdown"
        curl http://192.168.0.1/api/docommand/?command=poweroff &
        sleep 300

    ;;

So, yes, one can initiate myServer6 commands from a linux command file via curl http://192.168.0.1/api/docommand/?command=poweroff  to run a command. Anything after command= are the myServer command structure.  The ampersand in this line is a linux command sequence to run the command asynchronously. 

Of course one could call (via the CURL command) a myServer macro to send text message and then shutdown myServer/OS, or a plethora of options.   

There are other options as well.. 
Last edit: 2 years 5 months ago by Krumpy.

Please Log in to join the conversation.

More
2 years 5 months ago #519 by retate
Replied by retate on topic UPS via APCUPSD software (linux)
I am aware of the multiple variations of UPS vendors and interfaces. In my case I am using Cyberpower UPS units with ethernet interface cards, The Cyberpower choice is based on some bad historical experience with APC units. I would like to implement logic for myServer similar to my QNAP NAS units which initiate a shutdown after incoming power has been lost for 2 minutes. The notes regarding the APC configuration gives me a place to start.

Please Log in to join the conversation.

More
2 years 5 months ago #523 by Krumpy
Replied by Krumpy on topic Electrical power recommendations
Understood.  

So what Linux software does Cyberpower have to interface to the UPS? Or are you perhaps using Windows? You can also try NUT maybe they support your hardware. I suppose the concept stays the same.

Either way, from a terminal window run the following command curl http://192.168.0.1/api/docommand/?command=poweroff and you should see myServer initiate a graceful system shutdown.

This is outside of the scope of Allonis. With APCUPSD and I think NUT a well, one establishes one machine that talks to the UPS hardware (called master), then you can install slaves which talk to the master and they all hav their own configuration parameters for shutdown.   This way you can have an entire data center shutdown on power failure.   Start small, and build up.   Just showing what **** could **** be done.   Of course this all would work in a VM environment as well.   I personally have my Proxmox server connected to the UPS hardware, then have slave APCUPSD installations talk to the master for graceful shutdown. Same with my firewall which is bare metal. 
The following user(s) said Thank You: retate

Please Log in to join the conversation.

More
2 years 5 months ago #559 by retate
Replied by retate on topic Electrical power recommendations

Understood.  

So what Linux software does Cyberpower have to interface to the UPS? Or are you perhaps using Windows? You can also try NUT maybe they support your hardware. I suppose the concept stays the same.

Either way, from a terminal window run the following command curl http://192.168.0.1/api/docommand/?command=poweroff and you should see myServer initiate a graceful system shutdown.

This is outside of the scope of Allonis. With APCUPSD and I think NUT a well, one establishes one machine that talks to the UPS hardware (called master), then you can install slaves which talk to the master and they all hav their own configuration parameters for shutdown.   This way you can have an entire data center shutdown on power failure.   Start small, and build up.   Just showing what **** could **** be done.   Of course this all would work in a VM environment as well.   I personally have my Proxmox server connected to the UPS hardware, then have slave APCUPSD installations talk to the master for graceful shutdown. Same with my firewall which is bare metal. 
 
Cyberpower lists support for Debian 8 32/64bit, Ubuntu 14.04 LTS 32/64bit, Red Hat Enterprise 7 32/64bit, Fedora 32/64bit, CentOS 7 64bit, & openSUSE 64bit. NUT lists support for the Cyberpower interface cards so I think I have enough information to proceed. My QNAP NAS have built in support for the Cyberpower interface cards so I haven't had a reason to try Cyberpower's Linux interface software. Your firewall comment reminded me that ideally, I would configure shutdown on my Opnsense firewall which is bare metal. However, knowing that the configuration is saved locally and in the cloud I know that I can put up a new firewall in a short period of time if there is a hardware failure. Your input is appreciated.

Please Log in to join the conversation.

Time to create page: 0.191 seconds