I don’t know about you but in my area of residence the weather is always unpredictable when it comes to thunderstorms, they can come on any season of the year and usually are short lived. However, they are very thunderous and our power goes down on average 4 times a year, probably.
For me running a server this is not great, multiple services might be writing to databases at any moment, failing then would be a sure way to either lose data or simply create headaches for me when the database fails to boot and I need to manually fix it.
As such I decided to get a UPS to avoid any sudden shutdowns. For this I decided to go with the weird solution of using a Raspberry Pi connected to the UPS via USB and use it to communicate with the UPS via NUT.
I set the Raspberry Pi as the NUT server on my local network, then on my server, I installed nut-client and configured it to receive events from the ups on the raspberry – ups@pi.local.
As such I decided to get a UPS to avoid any sudden shutdowns. For this I decided to go with the weird solution of using a Raspberry Pi connected to the UPS via USB and use it to communicate with the UPS via NUT.
I set the Raspberry Pi as the NUT server on my local network, then on my server, I installed nut-client and configured it to receive events from the ups on the raspberry – ups@pi.local.
One important note here is that all the computers and the switches are also protected by the UPS and it is most important that they never actually feel the power outage, even if they are off, because commercial devices, like the ones I use, are usually bad at WoLing from a complete power outage.
So the whole system is now passing through the UPS – Would be interesting to try and use the UPS with lithium batteries and charging them during the day with solar panels and at night we changed to using battery power. Lithium could probably keep it alive for a long time.