NUT

Introduction
Do you have a UPS? Do you want to have you system gracefully shutdown in case of a power outage? This guide will show how you can make the most out of your UPS by using NUT from the Network UPS Tools project

Install NUT
If you are connecting your UPS via USB, make sure to set the usb USE flag

Configure nut.conf
Set mode to standalone if your machine is connected to the UPS directly and you want to run NUT on this machine.

Configure /etc/nut/ups.conf
This is where you set up your UPS configuration. Make sure that your UPS name (the text in the brackets) doesn't have any spaces. For configuration specific to your UPS you need to look it up here: NUT Hardware Compatibility Lookup

Configure /etc/nut/upsd.users
You need to configure at least one user so that upsmon can be launched later. upsd will create a tcp connection that upsmon will use to check on the status of your UPS.

Test your upsd configuration
Start upsd:

Check the status of your ups manually. Note that you might have to adjust your UPS name for this work.

OL means that your UPS is "online" and not drawing from the battery. It also means that you configured the above files correctly.

Setup upsmon
Create a MONITOR configuration in /etc/nut/upsmon.conf: