A while back in asked about how to connect multiple computers to one UPS device (post). I received excellent advice to use a Raspberry Pi to run a NUT server to do this. I'm now the proud owner of a RPi4b 2GB ram and have installed NUT and it's working well locally thanks to this tutorial.
I'm not trying to connect it to my Windows 10 machine and I'm just having a frustrating time doing so. I've first attempted to install WinNut, even though it seems like an ancient relic. Although I'm certain my credentials are correct, I receive this error when I attempt to start it:
Level INFO 03/27/2020 17:59:28 In winNUTServiceMain- Received service command ID: 1
Level INFO 03/27/2020 17:59:28 WinNUT received STOP command
Level INFO 03/27/2020 17:59:29 Detected OS as Windows NT
Level NOTICE 03/27/2020 17:59:29 Network UPS Tools upsmon 2.0.0.4
Level INFO 03/27/2020 17:59:29 UPS: ups@192.168.1.3 (slave) (power value 1)
Level INFO 03/27/2020 17:59:29 Config Load: MINSUPPLIES set to 1
Level INFO 03/27/2020 17:59:29 Config Load: NOTIFYCMD set to "c:\Program Files (x86)\WinNUT\AlertPopup.exe"
Level INFO 03/27/2020 17:59:29 Config Load: POLLFREQ set to 5
Level INFO 03/27/2020 17:59:29 Config Load: POLLFREQALERT set to 5
Level INFO 03/27/2020 17:59:29 Config Load: HOSTSYNC set to 15
Level INFO 03/27/2020 17:59:29 Config Load: DEADTIME set to 15
Level INFO 03/27/2020 17:59:29 Config Load: RBWARNTIME set to 43200
Level INFO 03/27/2020 17:59:29 Config Load: NOCOMMWARNTIME set to 300
Level INFO 03/27/2020 17:59:29 Config Load: FINALDELAY set to 5
Level ALERT 03/27/2020 17:59:29 WinNUTUpsMon Service is starting to monitor UPS
Level ERROR 03/27/2020 17:59:29 Can't login to UPS [ups@192.168.1.3]: Access denied
So instead, I installed the Binary packages for Windows and I see it's been installed but it's not running, even when I try to under some command in command prompt. I've entered my MONITOR entry and the netclient in the confg files.
At this point I'm just over my head and could use some help. I've Googled as much as I can and I just don't see any helpful guides on using NUT on Windows.
If I can get this working, I think it would be helpful to others too.
P.S. I bought a separate NETGEAR POE Switch to power the RPi with a POE hat so I had less cables going to it. The primary goal is to go from two UPS units to one for a more minimal setup. RPi has been super fun and I think these are just the darndest little machines.
Videos
I'm trying to figure out if there are any *simple* ups management tools for Windows, that can speak to a NUT daemon? From what I can see, there *is* a NUT daemon for Windows, but it is kinda complicated to install and configure.
What I am ideally looking for is something as simple as a WMI32_Battery instance, that can be configured with the address and creds of a NUT daemon, and makes that data available as a Battery. From there, built in Windows functionality can be used to determine what to do when power fails, battery gets low, etc.
Wondering what the advised setup for having multiple UPSes serving multiple Windows servers.
With *nix I would plug all the UPSes into a NUT server and have the remaining servers power off when conditions are reached.
What does one do in the Windows world?
I do not have IT or computer background. I just like to play with computers as a hobby.
I have recently started self-hosting and am trying out a few things. One of thing that I tried out today was NUT which works fine for the UPS connected via USB on my Pi. Now, I do have 2 Windows 11 PCs, one which runs plex and another my PC for personal work. Both have a UP attached to them, Cyberpower and Tripp Lite. I was wondering is there a method for having data from these 2 UPS to be communicated to the NUT server on my Pi. Both these UPS are directly connected to respective PCs vis USB and these PCs are on the same network as the Pi.
I would appreciate it if someone could please point me to a good guide.
Thanks!
Hi there.
I'm trying to get a NUT server up and running so I can start controlling my Cyberpower CP1500AVRLCD and the devices attached to it and also devices attached to the network.
I'm debating just using SNMP and their cloud service ($12/year) vs doing a NUT server.
I don't want to build another physical box for the space and would love to just run it off the Windows box it's plugged into for their Powerpanel software currently. Is there a Windows Server for this or just clients?
Would it work if I spun up a VM on this Windows box? I already have an Ubuntu VM on this box for other things. I assume I'd have to route the USB device to the VM? (I use Oracle VirtualBox Manager)
TIA
Hi everyone,
I know there's information on using our Synology NAS' as UPS servers to power down other Synology devices, but it took me some time to piece together how to use Synology to safely power down my Mac Mini server in the event of a power outage so I figured I'd put it into a writeup here to maybe help some others.
WHY: Most UPS' only have one USB port to control a single device in the event power outage and the battery running low. If you're like me, I have my Synology NAS and other devices (i.e. Mac server) that I want all powered down safely.
My setup: These steps are not specific to my hardware/OS/UPS, but figured I'd provide for context.
-
APC 600VA UPS
-
Synology DS918+
-
Mac mini (running Ubuntu server 20.04, not Mac OS X) - this is not specific to Linux, it will work for Mac, Windows servers/computers
-
Your router needs to be also attached to the UPS otherwise your NAS and computers/servers won't be able to communicate.
Synology Setup
-
Connect NAS to UPS via USB cable.
-
Open up DSM and go to Control Panel > Hardware & Power > UPS (tab)
-
Enable UPS Support and check "Enable network UPS server"
4. Click "Permitted DiskStation Devices" and input the IP addresses of your servers/computers you would like to power down. In my case, I input the IP of my Mac Mini.
5. Apply settings. If you click, "Device Information" you should see your UPS info. (May require a restart of the NAS, I can't remember)
Server/Computer Setup
Linux
Synology is running a NUT Server (http://networkupstools.org) and in this part we have to install the Nut-client to monitor the NAS. I am walking through setup of the Nut-client on Linux, but the same basic steps apply for Mac/Windows. The NUT website has download/install instructions specific to Windows/Mac.
1.Install NUT
sudo apt-get install nut
2.Modify /etc/nut/nut.conf file to specify your computer/server as a client instead of server. Edit this specific line:
MODE=netclient
3.Add Synology address and credentials to /etc/nut/upsmon.conf
MONITOR ups@192.168.0.102 1 monuser secret slave
*Note: these credentials can be changed or you can add a user by SSHing into the NAS and modifying /usr/syno/etc/ups/upsd.users.
4. Lastly, start the nut-client service.
service nut-client restart
Now if I unplug my UPS (to simulate power outage), my Mac will update with the status of the UPS and also will safely shutdown when Synology triggers. I left my Synology settings to trigger shutdown when the UPS battery runs low, but you can check "Time before DiskStation enters Safe Mode" in step 3 above and put a specific time to shutdown.
Windows (Thanks to u/xnaas for providing Windows instructions)
-
Download and install the latest binary https://github.com/networkupstools/nut-package-archive/tree/master/windows
During install, uncheck the box for Install libUSB driver
2. Go to the etc folder of your NUT installation folder
Default: C:\Program Files (x86)\NUT\etc
3. Rename or copy nut.conf.sample to nut.conf
4. Rename or copy upsmon.conf.sample to upsmon.conf
5. Edit MODE inside nut.conf
MODE=netclient
6. Edit upsmon.conf
Find the SHUTDOWNCMD section
Default: SHUTDOWNCMD "/sbin/shutdown -h +0"
Change the default to something like SHUTDOWNCMD
SHUTDOWNCMD "C:\\WINDOWS\\system32\\shutdown.exe -s -t 0"
Customize the time (-t 0) to your liking. Optionally add -f to force the shutdown. If you want to hibernate, replace -s with -h.
Find the MONITOR section and add the following
MONITOR ups@192.168.1.150 1 monuser secret slave
Make sure to update the IP to your Synology IP
7. Copy libgcc_s_dw2-1.dll from the bin subfolder to the sbin subfolder
8. Download OpenSSL library https://indy.fulgan.com/SSL/
9. Copy libeay32.dll and ssleay32.dll to the sbin subfolder
10. Launch services.msc from Run (WIN+R)
11. Find the service called Network UPS Tools and Start it
Mac
To be added later. In the meantime, this wiki should be a good guide: https://github.com/networkupstools/nut/wiki/NUT-on-Mac-OS-X
Hope this helps someone!
I am planning to purchase the SMT3000RM2UC for my homelab and wanted to know the community's compatibility with NUT https://networkupstools.org/stable-hcl.html. The compatibility list isn't specifically listing this model.
Open to any other non-cloud based solutions to be able to gracefully shutdown all the components of my homelab (ubiquiti gear, synology, proxmox servers etc).
Apologies if I'm missing something obvious, but I can't figure out how to achieve dual shutdown of my UPS and my computer.
I'm running a data cable from my Cyberpower UPS (CP1500PFCLCD) to my NAS (DS418 running DSM 6.2.2-24922 Update 6). I have enabled the network UPS server within DSM, but now how do I consume that server in windows (windows 10 to be exact)?
Hey there folks, I've been digging into different tutorials and the documentation for NUT and I'm really struggling, hoping some of y'all can help me understand how to get what I'm after accomplished, or if it's even possible.
First, a quick rundown of my setup:
Home-built PFSense box
NUT server running on a Raspberry Pi 3B
1x Cyberpower UPS (Promxox) Connected via USB
1x APC UPS (Network stack) Connected via USB
Synology NAS (DS218J)
ProxMox VE in a DMZ (separate NIC)
One VM containing a semi-public Minecraft server
One VM containing Plex
I have NUT set up in server mode on the RPi 3, and slave clients set up in the Synology NAS, in the ProxMox VE, and in the Minecraft VM. All clients can see the NUT server, report alerts as they go out (to the terminal), and although I haven't tested it, as configured I'm fairly certain they will all shutdown when the batteries go critical.
What I would like to happen:
T0: Power outage occurs, UPSs switch to battery power.
T+1 min: At 60 seconds I am assuming I'm in a sustained power outage:
Minecraft server is sent the "halt" command in order to kick all players, save the world, and shutdown cleanly. (Assume this can be done through RCON)
Synology NAS unmounts drives and goes to sleep.
T+2 min: All active VMs on ProxMox are sent the shutdown command.
T+3 min: Proxmox VE shuts down.
At 3 minutes, the Minecraft server should have cleanly shut down, the NAS and all VMs have shut down, and Proxmox itself powers off. I would like to save as much battery on this UPS as possible for charging phones or as a backup for the network stack in the event the power outage drags on for long.
Network stack UPS - 25% Battery remains: pfSense is sent the halt command. Wait 2 minutes for shutdown, then shutdown UPS.
Either UPS goes Critical: UPS sent shutdown command.
Nice to have but not necessary:
Immediately upon going to battery power the Minecraft server is sent an alert to broadcast to the players (Again assume this can be done through RCON)
After power outage (NUT server boots back up) or upon detection that UPSs are back on mains power: NUT server sends WOL packets to router, NAS, and Proxmox.
So uh, is this even possible? I'm having some real difficulty deciphering the documentation on networkupstools.org and every tutorial I see or read just discusses setting up the master and slave and getting it to shutdown on a battery critical event. Any advice or maybe someone has a tutorial in their back pocket that deals with the execution of events, I'd really appreciate it.
Hello Guys. After a few HOURS, I got it working.
So, I got a new APC UPS with USB, plugged it to my Qnap nas and it was up and running with out any setup. But I also wanted to control my PC shutdown (also plugged to the same UPS box) so QNAQ USP master to the rescue... Not yet =P
First, you will need WinNUT ( https://code.google.com/archive/p/winnut/downloads latest release is from years ago but works fin in latest win 10 build)
Then after install you need to edit the upsmon.conf file from within the Winnut config tool.
now comes the funny part, in that file you are supposed to input your UPS name, IP, user and password...
so for QNAP nas boxes the ups name is ALWAYS qnapups. so qnapups@yournasIP great.
User and password, one thinks this is the admin user for the qnap ups? WRONG, its a hard coded user/password
user: admin
Password: 123456
The final format you need to input in the config file is
"MONITOR qnapups@yournasIP 1 admin 123456 slave"
save the file, get back to the winnut config util and start it as a service (you can mess around with the shutdown delay and stuff also)
now test, pull the plug from the wall on your UPS and you should get a shutdown signal to your PC in a few mins (unless you set up a shorter time in the winnut config tool)
I can get a few screenshots if anyone needs them!
<<<<< 2022 UPDATE >>>>>
So... since all the security issues we are all likely running with the admin account disabled, this will break the configuration.
This is how to fix it.
-
Enabled admin account and log in said account via winscp to the nas.
-
Go to /etc/.config/ups
-
Find the file named upsd.users and download it to your pc. also make a backup of the original file (just raname to something like OG_upsd.users)
Edit the file and add these lines at the bottom and save [monuser] password = upspasswordyoulike allowfrom = 192.168.1.1 upsmon slave
Your file should look like this
Stop and start the network ups service from the settings UI
You can now setup NUT with your new user and password like
MONITOR qnapups@192.168.1.1 1 monuser upspasswordyoulike slave
save the nut config file and start NUT, now it should be working as before disabling admin account.
Go back into the nas user settings and disabled the Admin account again.
Hi All!
I was curious, does anyone have a working solution for doing automation with Network UPS Tools? I would like to automate the shutdown of components that don't have a NUT client like my Ubiquiti Cloud Key and my Asustor NAS via script. Maybe even have it send out an email/push notification/etc.
Didn't see much out there while I was googling/searching GitHub, but thought I'd check here. If there's nothing out there already I think I might cook up a Docker container for it.
Thanks for reading!