element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Project14
  • Challenges & Projects
  • More
Project14
Make a Connection A NUT (Network UPS Tools) itch that needed scratching
  • News
  • Member Updates
  • Competitions
  • Forum
  • Documents
  • Theme Suggestions
  • Polls
  • Members
  • More
  • Cancel
  • New
Join Project14 to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: colporteur
  • Date Created: 1 Aug 2026 7:04 PM Date Created
  • Views 174 views
  • Likes 4 likes
  • Comments 6 comments
  • network monitoring
  • raspberry pi
  • usb communication
Related
Recommended

A NUT (Network UPS Tools) itch that needed scratching

colporteur
colporteur
1 Aug 2026

I had an IT itch that I needed to scratch. The yard supervisor met me at the office with his phone, he stated, “We’re performing seed-plant maintenance and received this message.” He showed me a screenshot of the control computer for the plant. Immediately I responded, “You don’t have a network. Let me take a look and I will let you know.”

image

All the golf carts used to ferry employees around the yard were gone. It was a walk or take my car the half kilometer to the seed-plant. How did I know it is half a kilometer? The point-to-point network elements that beam the network signal to that part of the yard indicate 600m.

While walking to the building, I pondered what could be wrong. I had used the network monitoring system in the office to examine that part of the network and it showed the switch for the plant was offline. When I arrived, I discovered the network switch didn’t have power. This issue stemmed from the UPS being offline.

The UPS was installed to prevent brownouts. The plant is at the far reaches of the yards AC power runs. Larger motors and industrial equipment powering up play havoc with the yard AC. Delicate equipment like computer had issues before the UPS was installed, frequent reboots or short network outages were normal.

Why was the UPS off? That question remained unanswered. My itch to know if and when such things happens motivated me to find a way to communicate with the UPS.

Of course, the vendor of the UPS had a solution.  The UPS hardware was old so it didn't support the current solution. Looking through the archive there were some options. They had a cost that didn’t fit the budget. I had just done a spring cleaning and discovered a Raspberry Pi2B in a cardboard box. Why not build a UPS monitoring system?

After some internet research, I discovered that my idea was not original. According to Wikipedia https://en.wikipedia.org/wiki/Network_UPS_Tools was developed 28 years ago, many contributors designed a NUT server.

NUT (Network UPS Tools) is a software suite designed to monitor power devices. Here, I thought I had an original idea. Considerable software development occurred within the 28 years since the concept’s inception. 

image

At the home for NUT https://networkupstools.org/ I found an archive that dates back to May 2005. Low and behold if the nuts that look after the NUT didn’t share a release for July 2026. YES my NUT itch could be scratched! My communication project is still on track.

OK for a BOM. I had a Pi2B with a 16M flash card and wall wart. The UPS equipment had a DB9 serial port and a USB 2.0 Type B connector. I call it a USB printer cable connector, since that is where I typically see that connector.

image

I didn’t have a USB to DB9 serial cable. I had plenty of USB printer cables. I couldn’t seem to lose all the USB printer cables kicking around the office. All the printers installed use a network connection, and the printer cable supplied never got used.

Got the software. Got the cable. Got the hardware. Let’s get communicating.

To get my NUT itch scratched required drawing on some knowledge not included in the HOW-TO’s that I found on the internet. If someone in IT pairs the two words “it’s” and “easy” in a statement, the immediate response should be “for whom”. I’ve been playing in IT for almost half of my 40-year career in technology. Tips and tricks I’ve learned along the way came in handy to crack this NUT.

sudo apt update                 		#just built the pi so the ubiquitous setup commands
sudo apt upgrade
sudo reboot                     		#my start from go command. It worked before does it work now.

vcgencmd get_throttled          		#check that the pi doesn't have any power issues

sudo apt install nut            		#install the Network UPS Tools package
sudo nut-scanner -U             		#with the USB cable connected this gets information needed later
sudo vi /etc/nut/ups.conf       		#the four configuration files that works for me.
sudo vi /etc/nut/upsd.conf
sudo vi /etc/nut/nut.conf
sudo vi /etc/nut/upsmon.conf
sudo reboot 

I judge the quality of a HOW-TO document on HOW-MUCH I need to change the HOW-TO in order to get the project working. I didn’t find one HOW-TO, that worked from start to finish. Gather nuts from each of the stashes of videos and Internet posts finally got my NUT working.

Below I have provided screenshots or code for the four files that I added configuration details to get the NUT working. The Pi needs to communicate with the UPS hardware in order to configure the NUT server. The NUT software provides a tool nut-scanner -U to make that USB query possible.

image

I’ve included a list MY-HOW-TO commands and the files to get a working NUT server, apc-seedplant. Note the software version reference points for this working NUT. Changes in the operating system, software packages, and the NUT software itself can move the dependencies so that things don’t work.

Hardware:
Description : Raspberry Pi 2B rev 1.1
RAM : 1GB
Storage : MicroSD 16G

Software:
Raspberry Pi OS Lite System 32-bit
PRETTY_NAME="Raspbian GNU/Linux 13 (trixie)"
Release date 18 Jun 2026


nut-server 2.8.1-5

image

sudo cat /etc/nut/ups.conf Recall you queried the UPS for information. This is the file where that information goes. I just drop to the bottom of the file and start entering.

image
sudo cat /etc/nut/upsd.conf Setting up port requirements.

image
sudo cat /etc/nut/nut.conf You will find the MODE line inside this file. In mine it had <none>, I changed it to this value.

MONITOR apc-seedplant@localhost 1 upsadmin BN11ooM2-C@ primary

RUN_AS_USER root

MINSUPPLIES 1
SHUTDOWNCMD "/sbin/shutdown -h"
NOTIFYCMD /usr/sbin/upssched
POLLFREQ 2
POLLFREQALERT 1
HOSTSYNC 15
DEADTIME 15
POWERDOWNFLAG /etc/killpower

NOTIFYMSG ONLINE    "UPS %s on line power"
NOTIFYMSG ONBATT    "UPS %s on battery"
NOTIFYMSG LOWBATT   "UPS %s battery is low"
NOTIFYMSG FSD       "UPS %s: forced shutdown in progress"
NOTIFYMSG COMMOK    "Communications with UPS %s established"
NOTIFYMSG COMMBAD   "Communications with UPS %s lost"
NOTIFYMSG SHUTDOWN  "Auto logout and shutdown proceeding"
NOTIFYMSG REPLBATT  "UPS %s battery needs to be replaced"
NOTIFYMSG NOCOMM    "UPS %s is unavailable"
NOTIFYMSG NOPARENT  "upsmon parent process died - shutdown impossible"

NOTIFYFLAG ONLINE   SYSLOG+WALL+EXEC
NOTIFYFLAG ONBATT   SYSLOG+WALL+EXEC
NOTIFYFLAG LOWBATT  SYSLOG+WALL
NOTIFYFLAG FSD      SYSLOG+WALL+EXEC
NOTIFYFLAG COMMOK   SYSLOG+WALL+EXEC
NOTIFYFLAG COMMBAD  SYSLOG+WALL+EXEC
NOTIFYFLAG SHUTDOWN SYSLOG+WALL+EXEC
NOTIFYFLAG REPLBATT SYSLOG+WALL
NOTIFYFLAG NOCOMM   SYSLOG+WALL+EXEC
NOTIFYFLAG NOPARENT SYSLOG+WALL

RBWARNTIME 43200

NOCOMMWARNTIME 600

FINALDELAY 5

sudo cat /etc/nut/upsmon.conf Lots of stuff to enter in this file so I flipped presentation to code to support cut and paste.

This is not a tutorial on the NUT server. Therefore I have omitted the details of the settings and purpose. The NUT site has the documentation if you wish to delve deeper.

What does the NUT do for me? The NUT is physically on top of the UPS, quietly communicating over the network what the USB port tells it about the condition of the UPS. It is logging that data to disk (i.e. SD card). The NUT communicates the condition of the past and the present. Of course there has been no power outage lately to look at my NUT.

sudo systemctl status nut-server 		#is the NUT active and running

sudo systemctl restart nut-server 		#command to restart the NUT server when needed

systemctl list-units | grep nut                 #get a look at what is in NUT
journalctl -u nut-driver@apc-seedplant.service  #service tell me what you have logged.
journalctl -u nut-server                        #service tell me what you have logged.
journalctl -u nut-monitor                       #service tell me what you have logged.


upscmd -l apc-seedplant				#cli tool to send commands to your UPS via the upsd server.
upscmd -u upsadmin -p BN11ooM2-C@ apc-seedplant test.battery.start.quick

upsc apc-seedplant				#read-only cli command for the upsd server to provide UPS status
upsc apc-seedplant battery.runtime

Above is a list of commands to poke around the NUT server. Again there are little details for a fuller understanding of the commands.

The communication contest caught my eye; I wanted to take part, but I was not working on any electronic bits and bobs at the moment to fashion an entry. Then I broadened my understanding of communicating.

E14 community is all about communicating. Folks share their creations with others. Those shares have brought me success. I use the community as a knowledge repository. I returned to locate my project specifics; I can’t recall.

Then I got a NUT itch that I could communicate about it communicating.

  • Sign in to reply
Parents
  • beacon_dave
    beacon_dave 22 days ago

    "...What does the NUT do for me? The NUT is physically on top of the UPS, quietly communicating over the network what the USB port tells it about the condition of the UPS..."

    If the UPS is powering the network switch and the NUT relies on the network switch for comms back to the office, then it sounds as if you are still going to get your steps in to get your answer ?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • obones
    obones 22 days ago in reply to beacon_dave

    Not if the UPS is able to deliver power long enough for the switch to transmit the messages.

    A full blow server with a GPU and ample drives takes 7 minutes to deplete my 650VA UPS so I believe a RPi would take much longer to arrive at a zero level.

    But you are right, this would not prevent someone from (maliciously) pressing the power off button on the front of the UPS itself.

    The ultimate solution would be to add a 3G/4G module on the PI with a SIM card that has a "SMS only" subscription attached to it. Cost effective and easy way to send messages to whoever needs to receive them.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • colporteur
    colporteur 21 days ago in reply to obones

    I'm limited on what I can invest. I suspect there are more elegant solutions that a Pi2B. The project was whimsical. I haven't played with Pi's for sometime. I discovered a lot has changed with the OS. Even the imaging software load on my laptop failed to flash a SD card. I'm curious to see what the logs generate.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • beacon_dave
    beacon_dave 21 days ago in reply to colporteur

    I suspect your answer lies here:

    "...We’re performing seed-plant maintenance..."

    Perhaps someone was pulling fuses and the UPS went onto battery and started beeping. That someone didn't like the annoying beeping and then turned the UPS off to silence it.

    You could perhaps move the Pi2B into the office and then look at tunnelling the comms from the UPS device over the existing network to it. That way the log data is stored 600m closer to you, when the network goes off-line.

    As you have network monitoring in the office, you could also perhaps convert the UPS monitoring to SNMP and then log it within the existing network monitoring software.

    Unfortunately the small batteries tend not to last in those small UPS units, so if you aren't replacing them annually, you don't really have a UPS. The on-battery testing feature often doesn't help much as the batteries tend to fail quickly (a cell fails) rather than capacity degrading nicely over time; so you can get 11 monthly tests that look absolutely fine and then on the 12th test it fails a few seconds into the test taking all your 'protected' IT down with it.

    I recall e14 member John Wiltrout replacing the built-in battery with an external car battery:

    https://community.element14.com/members-area/personalblogs/b/john-wiltrout-s-blog/posts/back-up-battery-failure-inspires-new-test-tools

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • colporteur
    colporteur 20 days ago in reply to beacon_dave

    The button push is one thing I suspected. I keep the UPS on silent to the annoying beeping. I did notice on total discharge the button push to stop the beeping is like pushing a lite button at an elevator. It makes you feel like you've done something but it accomplishes absolutely nothing.

    The NUT server is one of my own creations. I try to avoid inserting anything into the network that requires specialized support. The majority is out of the box. I think the piholes for DNS are the outliers. I'm getting long in the tooth and don't want to be looking over my shoulder when I ride off into the sunset.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • colporteur
    colporteur 20 days ago in reply to beacon_dave

    The button push is one thing I suspected. I keep the UPS on silent to the annoying beeping. I did notice on total discharge the button push to stop the beeping is like pushing a lite button at an elevator. It makes you feel like you've done something but it accomplishes absolutely nothing.

    The NUT server is one of my own creations. I try to avoid inserting anything into the network that requires specialized support. The majority is out of the box. I think the piholes for DNS are the outliers. I'm getting long in the tooth and don't want to be looking over my shoulder when I ride off into the sunset.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube