hn.today

Configure a UPS on Linux with NUT

linuxjunkies.org20 points0 comments
Screenshot of Configure a UPS on Linux with NUT

Network UPS Tools (NUT) lets a Linux computer monitor a connected UPS and shut down cleanly before its battery is exhausted. The guide focuses on a single-machine setup, where the UPS connects by USB or serial cable and the driver, data server (upsd), and shutdown monitor (upsmon) all run on the same host. It explains installation on Debian/Ubuntu, Fedora/RHEL/Rocky, and Arch, then uses nut-scanner to identify the UPS and suggest a driver. The detected settings go into ups.conf; common USB choices include usbhid-ups, blazer_usb, and nutdrv_qx. Setting MODE=standalone keeps the setup local, while networked monitoring requires a different mode.

The remaining configuration makes the monitoring and shutdown chain work: upsd listens only on localhost, an authenticated upsmon user is defined with protected file permissions, and upsmon.conf specifies the UPS, credentials, required power supply, shutdown command, event notifications, and timing parameters. After enabling the appropriate driver and services, upsc should report status such as OL for mains power, OB for battery, and LB for low battery; briefly disconnecting mains power can test driver communication. Troubleshooting covers USB permissions, failed drivers, communication errors, and unexpected shutdowns, emphasizing correct driver names, matching credentials, and confirming the UPS reports OL before starting services. The guide also notes how to extend monitoring to other machines and configure email notifications.

Read on linuxjunkies.org0 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

The Hardest Tarball?

A carefully crafted tar archive uses duplicate filenames, a hard link, and a POSIX extension to trigger eight different extraction behaviors across popular tools. The differences center on whether the hard link’s declared data is treated as file contents, skipped, or interpreted as the next archive header. (stoppels.ch)

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.