Shutdown Windows computer and Synology NAS using WinNut

Previously, my Windows PC happily send a command to my Synology NAS to shutdown when the UPS (connected to my PC) was running low on battery power. (See my post, “Shutdown Windows computer and Synology NAS using CyberPower UPS“) Things came to a grinding halt when DSM 6 was released and eliminated remote access by the root user…probably a good thing security-wise, of course.

After much research, I discovered the Network UPS Tools (NUT) project. Included in its goals is uniform control and management of UPSs and it seems manufacturers, including Synology, have embraced the “standard”. It’s a server-client model where you connect the UPS to the Synology NAS, the server (aka master), and run a monitoring program on your PC, the client (aka slave), to shut it down when the UPS battery power gets low.

Setup on the NAS side, is as easy as checking a couple option boxes. It’s not so straight forward on the client side of things. I found at least three different Windows client applications, all with less than clear configuration instructions. I settled on WinNUT, but lost patience trying to figure out how to configure the new version and opted for the older one which still seems to work under Windows 10.

Here’s the steps to set everything up. (Note that I have a CyberPower 1500PFCLCD UPS connected via USB to a Synology DS212j NAS currently running DSM 6.2-23739 Update 2.)

1. First, navigate to the WinNUT download page. Download WinNUT-2.0.0.4a-Installer.exe and install it.

2. Next, open your Diskstation Control Panel and choose Hardware & Power. Click on the UPS tab.

3. Enable the options Enable UPS support and Enable network UPS server.

4. Click Permitted DiskStation devices and enter your PC’s IP address in the dialog that appears. Click OK to close the dialog and then click Apply.

5. Run WinNUT Configuration Tool on your PC and click the Edit button.

6. Notepad will open with the config file. Add the following line: MONITOR [email protected]192.168.1.3 1 monuser secret slave

Be sure to substitute your own NAS’s IP address. Note that monuser and secret are the default username and password for the ups device user.

(I won’t go into detail here, but if you want to change the default username and/or password, the UPS config files are in the /usr/syno/etc/ups on the NAS and you need to edit the upsd.users file)

7. Save the file and close Notepad

8. Click the Apply and Start WinNUT button.

9. Click the View button. Scan the log and make sure there are no errors.

If you get a connection error, make sure the IP you entered in the WinNUT config file is your NAS’s correct IP address. Also, make sure you entered your PC’s correct IP address in DiskStation’s Permitted DiskStation devices dialog and applied it.

This should go without saying, but your router/hub needs to be connected to a UPS as well, or your NAS and PC can’t communicate when the power goes off.

10. Click OK to close the WinNUT window.

Now, you can either put the Start WinNUT Ups Monitor shortcut in your Startup folder (start and stop shortcuts are created by the install) or enable the Install As A Service option on the WinNUT window.

I really like the NUT method better than the one it replaced. However, currently, DSM is triggering a low battery event not long after the power goes off, even though my UPS has plenty of battery power. Based on this thread, I’m hoping it’s just a bug that will be fixed at some point.

Comments 10

  • Were you able to get the monitor started on boot by putting the “Start WinNUT Ups Monitor shortcut” into the startup folder? That doesn’t work for me and I’m guessing that it’s because the tool needs administrative privilege.

  • @dj – 2.0.0.4a still works just fine, even on the latest Win10 builds.

    https://code.google.com/archive/p/winnut/downloads

    That being said, if you want to run the 2.6 version, the only line you should need to add to upsmon.conf is the one mentioned above.

    MONITOR [email protected] 1 monuser secret slave

    Literally just substitute your IP for X.X.X.X – leave the rest the same.

  • Hi, many thanks for this, very helpful post, and super helpful software.

    Unfortunately the latest version for windows (2.6.5-6) is a port from linux and the “WinNUT Configuration Tool” doesnt seem to exist anymore?

    From what I can see, one has to modify the config files manually – the defaults in the upsmon.conf file need modifying and the examples in the sample don’t all explain the windows equivalents so it’s a little more involved than in the write-up unfortunately.

    Would anyone know therefore how to find the location of the winnutupsmon.log or a way to configure winnut so that it writes to it so I know what’s going on?

    Your advice would be really appreciated.

  • Great article, thanks !
    Do you need to put all your ethernet switches and router on UPS too for this to work ?
    I guess, no network means no NUT …
    Thanks

  • Hello, I tried this but when I click on view I get the error “Can’t connect to UPS [[email protected]]: Access denied”.
    I authorized my PC IP in my DS416 (running DSM 6.2.2).
    Is there any ‘authorization’ to do on DS side?
    Alaini

  • The MONITOR command has been changed to include the number of devices monitored. Enter 1, typically, after the IP address and before the user name.

    The format is documented in the config file.

    Other than that it installed easily. Thanks for the article.

Leave a Reply