Uninterruptible power supply
Uninterruptible power supply (UPS), provides near-instantaneous protection from input power interruptions by switching to energy stored in battery packs, supercapacitors or flywheels. The on-battery run-times of most UPSs are relatively short (only a few minutes) but sufficient to "buy time" for initiating a standby power source or properly shutting down the protected equipment. (source: Wikipedia)
Network UPS Tools (NUT) is a collection of software for managing power devices, mainly UPS units. This article describes the configuration of NUT for a simple server with a single power supply, with no local users and no additional equipment.
This article is mostly adapted from the excellent NUT ConfigExamples book, version 3.0, by Roger Price. [1]
Compatible Hardware
Compatible hardware are listed at NUT website [2]. For best results, choose a model with good driver support with battery replacement notification. Battery pack in UPS is designed to be replaced every few years. For example, Eaton Ellipse ECO 650 [3] needs a new battery every four years, under optimal operating conditions.
Components of NUT Software
One or more UPS's are attached to the attachment
daemon upsd via a UPS-specific driver
daemon.
The attachment daemon maintains an abstract image of the UPS in
memory. The attachment daemon can be queried by the upsc
command. The driver daemon talks to the hardware and the attachment
daemon. The driver daemon can be controlled by the
upsdrvctl command.
The management daemon upsmon is a client
of upsd. It runs permanently, checks the status of UPS, and react to
status changes, such as initiating a shutdown.
Configuration files in use
In this simple standalone server setup, the following configuration files are generated:
- ups.conf, declare UPS-specific driver information, power.ups.ups.* option
- upsd.conf, control access to upsd, power.ups.upsd option
- upsd.users, add user with access to upsd, power.ups.users option
- upsmon.conf, connect to upsd, power.ups.upsmon.monitor section;
- upsmon.conf, set how upsmon should react to status changes, power.ups.upsmon.settings section
- delayed UPS shutdown systemd unit, to make Restore Power on AC Return BIOS option functional, systemd.services.nut-delayed-ups-shutdown section