The sysutils/nut port

nut-2.8.2 – UPS monitoring program supporting many brands (cvsweb github mirror)


Network UPS Tools is a collection of programs which provide a common
interface for monitoring and administering Uninterruptible Power
Supply (UPS), Power Distribution Unit (PDU), and Solar Controller
Device (SCD) hardware. It uses a layered approach to connect all
of the parts.

Drivers are provided for a wide assortment of equipment. They
understand the specific language of each device and map it back to
a compatibility layer. This means both an expensive high end UPS,
a simple "power strip" PDU, or any other power device can be handled
transparently with a uniform management interface.

This information is cached by the network server upsd, which then
answers queries from the clients. upsd contains a number of access
control features to limit the abilities of the clients. Only
authorized hosts may monitor or control your hardware if you wish.
Since the notion of monitoring over the network is built into the
software, you can hang many systems off one large UPS, and they
will all shut down together. You can also use NUT to power on, off
or cycle your data center nodes, individually or globally through
PDU outlets.
WWW: https://networkupstools.org/


| Running ${PKGSTEM} on OpenBSD

NUT is split into separate components. A hardware driver interfaces
with the device and sends information to upsd. A monitor (upsmon)
connects to upsd and shuts down the machine when necessary.

These components can reside on separate computers (i.e. UPS monitored
by various computers may communicate with a central upsd, and a whole
network may run upsmon to allow for shutdown).

On OpenBSD, daemons from packages are usually started by adding to the
pkg_scripts line in /etc/rc.conf.local. For NUT, machines running
upsd or the hardware driver should include "upsd" in this line, and all
machines should include "upsmon". Where you run both, upsd should
be started first. For example you could use this line:

	pkg_scripts=upsd upsmon [...any other daemons...]

Network devices
To reduce dependencies for the basic NUT package, some network devices
are supported by optional subpackages: nut-snmp (for SNMP-based devices),
nut-xml (for Eaton/MGE devices using an XML/HTTP protocol).

Connecting to a remote server running nutd(8) requires only the basic
NUT package which also includes the file you are reading now.

Configuring NUT
The following files must be edited for a typical installation.

* ups.conf

Details of UPS device/s are held here. These may either be directly
connected, or network devices (this can include a NUT server running on
another machine). Configuration sections for this file can be generated
for network and USB devices using nut-scanner(8). This is in the main
NUT package but picks up dependencies at runtime, so if you wish
to scan for network devices, just make sure the relevant package
is installed before you run the scanner.

To scan for network devices, specify start and end IP addresses:

	# nut-scanner -s -e

* upsd.users

upsd(8) user authentication is configured here.

* upsmon.conf

This file informs upsmon(8) which devices (configured in ups.conf) it
should monitor. It also contains passwords to authenticate to upsd(8).

Device permissions
For locally connected UPS devices, the userid running NUT (normally
_ups) must have access to the relevant device nodes.

RS232: Either add _ups to group "dialer" or change the group ownership
of the relevant /dev/tty* device to _ups.

USB: Use "usbdevs -vd" (as root) to identify the specific controller
(/dev/usbXX) and ugen (/dev/ugenXX) device nodes, then adjust permissions
to allow _ups to have write access (e.g. chmod g+w and chgrp _ups).

Special notice for APC USB devices
Some APC USB devices are reported to only work with NUT if the device is
attached to ugen(4). Normally these devices attach to upd(4) to provide
system power sensors (see "sysctl hw.sensors"). If you are having problems
using such a device with NUT, you may need to prevent this attachment.
The option with fewest side-effects is to add the following entries to
the table in /sys/dev/usb/usb_quirks.c and build a new kernel:


Alternatively, if you do not use a USB keyboard/mouse, you could simply
disable the upd and uhidev drivers. The following line creates a new kernel
with the relevant changes:

  printf 'disable uhidev\ndisable upd\nquit\n' | config -e -o /bsd.no-uhid /bsd

Starting the daemons
To start the daemons without rebooting you can use:

	# ${RCDIR}/upsd start
	# ${RCDIR}/upsmon start

NUT documentation refers to a nut.conf file; this can be ignored, it is
only used with their System V init scripts, and not OpenBSD's rc scripts.

It is recommended that you test a full cycle of rebooting, checking
that the daemons are running correctly ("upsc " will display
information retrieved by NUT from the UPS), allowing the machine
to be shut down by the UPS, and returning power.


The OpenBSD ports mailing-list


nut-2.8.2 nut-cgi-2.8.2 nut-snmp-2.8.2 nut-xml-2.8.2

Only for arches

aarch64 alpha amd64 arm hppa i386 mips64 mips64el powerpc powerpc64 riscv64 sh sparc64


lang/python sysutils

Library dependencies

Build dependencies

Reverse dependencies