Install UPS using Eaton 3S with Arch Linux

I recently bought an UPS for my home workstation. As I am using software RAID, a power failure is not acceptable with the software cache turned on. However, turning off software cache will result to a significant performance loss, so I decide to get a UPS. And now I am writing this article and hopefully it can help you.

How did I choose my UPS

As I have only a workstation with no graphic card or monitor connected, I do not need an expensive UPS which has thousands VA and hours of power supply. All I need is a system that properly turn off my computer when the power goes off. I firstly decide to buy a power meter to measure the power consumption of the server, which you can get for about A$25. I created a little C program that consumes 100% of the CPU, and at the same time I used the dd command to write data to all the hard drives. I had a maximal power consumption of 128W, which far less than the designed maximal power consumption for my system consumption (I think it was about 380W when I was using a power consumption tool online). From this measurement, I know that I probably need only a simplest one.

I looked through different vendors that I can get in Melbourne, Australia, compared their price and the drivers they support. APC seems has the best UPS for Linux either from the product itself, or the software support. However, the problem for me is that their products are more expensive and difficult to get in store in Melbourne. Finally I decided to go for the Eaton 3S. This UPS is a relatively good one with a competitive price and enough feature. It also has a very good web-based configuration interface for almost all systems. As it is really cheap even in Australia, I got the 700VA one for $119 from a local store. It comes with 3 years warranty so I am generally very happy about that.

How to make Eaton 3S work?

It is pretty easy. The UPS has 3 ports providing battery backup, even there are 6 ports on the board, the other 3 of them are just for protection, not for battery. It comes with an USB cable, and you can just plug it into your USB port on your machine, and it will display something like this:

As you can see the system has no problem recognise it and seems to be really happy. The next step is to download the software for configuration and set-up. I think you know where to download the software, otherwise I would think you may not need an UPS. Just joking, anyway, you can go to the Eaton website, register your product, and you should be able to download it.

Run the installer for your operating system. As I am using Arch Linux and connecting to my server using SSH, I am using the command line version of the installer. You will see a license agreement and by pressing space you can quickly go to the end of that. Then you may want to specify a location for the software, which I set up as /opt/Eaton/IPP.

After installation you will be able to find few files in the directory. And then you can run mc2 file to start the listener daemon. If the daemon does not work after 1 minute, try to run bin/ as well, and then you should be able to now view the configuration website in your browser.

Configuration and testing

If you have GUI on the machine you are connecting the UPS, then you can go http://localhost:4679, otherwise you can navigate to http://ip.of.your.server:4679, which will work as well. If your network environment is not secure, navigate to the https version on port 4680, and you should see a blue-theme website, where you can log in and do configuration.

If you can see that screen, I think you will not have any problem understanding the configurations in there. Just for people who haven’t got this device, I will list the key features of this software.

Generally speaking, you can: see status of the UPS, see events and logs, create actions to notify you when something is happening, configure shut down criteria, create and manage users.

Quick wrap up

Yes, it is really easy to use an USB based UPS, I would imagine a network one would be more complicated to configure. In the previous writing, I did not include anything about how to auto-enable the service because I think you are able to find documentation to the service management system of your choice. Now I am able to let my computer to shut down when the UPS has only 20% power. My problem now is that I don’t have any method to restart the machine because basically an USB cable cannot do this. Maybe I will later try a Raspberry Pie so that I can have this low-powered computer powered by the UPS as well and use that to send signal to the workstation when the main power comes back. Therefore, good luck and enjoy.