Hands-on tutorial
Tutorials · Monitoring
How to Shut Down NVRs and Servers Automatically on Power Failure (Network UPS Tools)
Use Network UPS Tools (NUT) to watch a UPS, alert the team on power loss and shut down NVRs, servers and storage cleanly before the battery runs out.
Before you start
- A UPS with USB or a network management card
- A Linux server or small appliance near the UPS
- SSH or agent access to the systems you want to shut down
Step by step
Connect the UPS
Connect the UPS by USB to the monitoring server, or enable SNMP on its network card.
Install NUT
Install the NUT server and configure the UPS driver.
apt install nut # /etc/nut/ups.conf [rackups] driver = usbhid-ups port = auto
Run the NUT server
Set NUT to netserver mode and create a monitoring user so other machines can read the UPS status.
Configure clients
On each server, run the NUT monitor as a client of the NUT server, so it shuts down when the battery is low.
Handle appliances
NVRs and storage that cannot run NUT can be shut down by a script over SSH or their API, triggered by NUT's event commands.
Alert the team
Send a notification on 'on battery' and 'low battery' events by email or webhook.
Test
In a maintenance window, unplug mains power and confirm alerts and shutdown order: applications, then storage, then the network last.
Commands are generic, industry-standard examples. Exact syntax and menu names vary by model and firmware; check your device's manual on the Documentation page.
Pro tips
- Shut down the network last so shutdown commands still reach other devices.
- Set shutdown timing based on measured runtime, not the label.
- Make sure systems start again automatically when power returns.
FAQ
Frequently asked questions
Do I need NUT if my UPS has software?
Vendor software often supports only Windows or one machine. NUT is open source and coordinates many systems.
Can NUT read a UPS over SNMP?
Yes, with the SNMP driver, if the UPS has a network card.
Keep learning
Related guides
UPS backup for PoE switches
Read more →Online vs line-interactive UPS
Read more →Server room environmental monitoring
Read more →How to Monitor Your Network With SNMP and Syslog
Know about failures before users call: collect interface statistics with SNMPv3 and central logs with syslog.
Read more →How to Synchronise Time on Network Devices With NTP
Accurate clocks are essential for logs, certificates, schedules and CCTV evidence. Configure NTP everywhere in minutes.
Read more →How to Back Up and Restore Network Device Configurations
A configuration backup turns a failed device into a quick swap. Set up regular backups and test a restore.
Read more →Stuck on a step?
Ask Navijin technical support or an authorised partner for help with your configuration.