Sign inSign up

mavyre/eaton-ipp

By mavyre

Updated almost 3 years ago

Run Eaton® Intelligent Power® Protector onto a Debian docker container

Image
2

1.8K

mavyre/eaton-ipp repository overview

About The Container

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.

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 with the host network 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 instead.

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

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 from Github repository 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
    
  • Run the docker container with the script mapped: -v ~/shutdown.sh:/root/shutdown.sh
  • Allow the script to be executed in the container: docker exec eaton-ipp chmod u+x /root/shutdown.sh
  • In IPP, under Settings, Shutdown, Edit shutdown configuration:
    • Shutdown type: Script
    • Shutdown script: /root/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.

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
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 from the Github repository 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.

Contributing

You can contribute on the original Github repository

License

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

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

Tag summary

Content type

Image

Digest

sha256:28bfe4d37

Size

86.3 MB

Last updated

almost 3 years ago

docker pull mavyre/eaton-ipp