/docker-eaton-ipp

Install and run Eaton® Intelligent Power® Protector onto a Debian docker container

Primary LanguageDockerfileMIT LicenseMIT

Contributors Forks Stargazers Issues MIT License LinkedIn


Logo

Dockerised Eaton® IPP

Install and run Eaton® Intelligent Power® Protector onto a Debian docker container!
Explore the official Eaton® IPP documentation »

Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Upgrade Considerations
  4. Usage
  5. Contributing
  6. License
  7. Acknowledgments

About The Project

Product Name Screen Shot

"Eaton® Intelligent Power® Protector (IPP) is protection software that gracefully shuts down local computers and servers powered by a UPS in the event of a power outage."

Eaton® IPP is distributed on their download page for multiple platforms. However, a dockerised instance of IPP may be necessary if:

  • You want to run IPP on an unsupported CPU architecture (arm/aarch64 for instance).
  • You don't want, or can't install IPP directly on the target host, and prefer to offload it on a Docker node.

This repository contains a Dockerfile which installs and runs Eaton® IPP on the latest Debian container using their official deb installer package, as well as some utilities.

(back to top)

Built With

  • Docker

(back to top)

Getting Started

Prerequisites

 curl -fsSL https://get.docker.com -o get-docker.sh
 sh get-docker.sh

Build the Docker image

docker build https://github.com/Mavyre/eaton-ipp-docker.git

OR

git clone https://github.com/Mavyre/eaton-ipp-docker.git
cd eaton-ipp-docker
docker build -t eaton-ipp .

(back to top)

Upgrade Considerations

When upgrading from app version prior to 1.72, the mount path inside the container changed. Eaton IPP now resides in /usr/local/eaton/IntelligentPowerProtector instead of /usr/local/Eaton/IntelligentPowerProtector (notice the lower-case eaton folder).

All mounted volume paths need to be adjusted.

Depending on the location of your shutdown script, you might need to update the path to it in Eaton IPP shutdown action as well.

(back to top)

Usage

docker run -d --net host -v ~/ipp/db:/usr/local/eaton/IntelligentPowerProtector/db -v ~/ipp/configs:/usr/local/eaton/IntelligentPowerProtector/configs --name eaton-ipp Mavyre/eaton-ipp

Launching the docker within the host namespace allows IPP to easily scan the network for UPSes, receive the shutdown signals and connect to the host to shut it down. If the shutdown target is not the host, you can run the docker with -p 4679:4679 -p 4680:4680 -p 4679:4679/udp -p 4680:4680/udp instead of --net host.

The two folders db and configs are mapped on host to retain IPP configurations and database.

(back to top)

Shutdown host from IPP

The easiest way with --net host is to use a shutdown script and SSH:

  • Prepare a shutdown script that connects to localhost. shutdown.example.sh can be used as a template.
    • The user must have sudo access to the poweroff command without password in /etc/sudoers:
    username ALL = (root) NOPASSWD: /usr/sbin/poweroff
    
  • Eaton IPP enforces shutdown scripts to be located in its /usr/local/eaton/IntelligentPowerProtector/configs/actions folder, so put the script in ~/ipp/configs/actions
  • Allow the script to be executed in the container: docker exec eaton-ipp chmod u+x /usr/local/eaton/IntelligentPowerProtector/configs/actions/shutdown.sh
  • In IPP, under Settings, Shutdown, Edit shutdown configuration:
    • Shutdown type: Script
    • Shutdown script: /usr/local/eaton/IntelligentPowerProtector/configs/actions/shutdown.sh

Each time a shutdown will be triggered by the UPS, the shutdown.sh script will be executed by IPP and shut down the host using SSH.

(back to top)

Launch IPP on an ARM machine (e.g. Raspberry Pi)

IPP is not natively compatible with arm/aarch computers. If you want to run it anyway, you need to emulate the AMD64 architecture.

⚠️ Disclaimer: When emulating, IPP might be slow and eat a lot of resources even when idle.

You can enable the AMD64 emulation using the awesome helper by tonistiigi:

sudo docker run --privileged --rm tonistiigi/binfmt --install amd64

Next, run the docker using AMD64:

docker run -d --platform linux/amd64 --net host -v ~/ipp/db:/usr/local/eaton/IntelligentPowerProtector/db -v ~/ipp/configs:/usr/local/eaton/IntelligentPowerProtector/configs  --name eaton-ipp Mavyre/eaton-ipp

(back to top)

Automatically start IPP after a reboot on an ARM machine

Even if the container is run with the --restart flag, it will not restart after a reboot. The AMD64 emulation must be re-enabled before starting the IPP container. In a Debian environment, the simple solution is to create a systemd service.

First, stop the docker container:

docker stop eaton-ipp

Copy ipp.service into /etc/systemd/system. Then, enable the service on boot, and start IPP:

systemctl enable ipp
systemctl start ipp

The service will re-enable the AMD64 emulation before starting the IPP container at each reboot.

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

The docker is distributed under the MIT License. See LICENSE.txt for more information.

Eaton® Intelligent Power® Protector is distributed under its own EULA that you must read and accept prior using it.

(back to top)

Acknowledgments

(back to top)