Simple guide to setup UPS with NUT (unraid master and windows clients)


Recommended Posts

Just wanted to share a simple How To for setting up NUT if you plan on using unraid as the master and windows clients. I am using a Cyberpower UPS, so your settings may differ. Please note that this guide is based on unraid being a physical server.

 

I wanted to have the UPS also shut off after the server shuts off, and power back on all the devices when the power goes back up. Because "Turn off UPS after shutdown" on apcusd doesn't work with Cyberpower UPS, I need to use NUT. Finding a simple windows client for NUT seemed challenging. Just wanted to find something with a gui and a little ini editting. The main windows binaries from the NUT team didn't seem straight forward. Other windows clients seemed deprecated or abandoned.

 

1. Install the NUT plugin from community applications. Turn off default UPS service in unraid.

 

2. In Settings -> NUT, configure it to be:

 

Start Network UPS Tools service: Yes (when done configuring)

Enable Manual Config Only: No

UPS Mode: Netserver (if you want unraid to be master)

UPS IP Addresss: 127.0.0.1

UPS Name: (whichever you like)

UPS Monitor Username: (whichever you like)

UPS Monitor Password: (whichever you like)

UPS Slave Username: (whichever you like, perhaps needs to be something different than Monitor)

UPS Slave Password: (whichever you like, perhaps needs to be something different than Monitor)

UPS Driver: Usbhid-ups (for cyberpower, try different ones if you cannot get it to detect)

UPS Port: auto (if using usb to server)

Shutdown Mode: (whichever you like)

Battery Runtime Left: Battery Level (maybe some users need to use Battery Level Low)

Turn off UPS after shutdown: Yes (If you want UPS to shut off after server shuts off, and turn back on when power comes back on. If you want server to turn back on automatically, need to set bios power setting to On or Last State)

 

 Apply when done and hopefully it detects the UPS properly. If not, try different UPS driver settings.

 

3. In Windows client PC or VM, install winNUT utility 2.0.0.4a (https://code.google.com/archive/p/winnut/downloads)

and follow this guide here to set it up from step 5:

https://www.seriouslytrivial.com/2018/09/26/shutdown-windows-computer-and-synology-nas-using-winnut/

Example Monitor command:

MONITOR [enter your ups name]@[your unraid server ip] 1 [monitor username] [monitor password] slave

 

If it shows access denied in the log file, try using different UPS monitor username and password.

 

By default I think it shuts down right away once on battery. If you want it to shutdown after a certain amount of time on battery, set Shutdown Delay to time in seconds. Forced will be a shutdown forcing programs to terminate. Normal can have prompts confirming programs to exit upon shutdown.

 

For windows 7 and up, to make it run as a service, run configuration tool as administrator and set to run as service. Check services.msc that winNut service is working.

 

I don't know if there is ways to change shutdown metric to be battery level/ runtime left on windows clients. If someone knows, please share. Thanks!

Edited by kakashisensei
  • Like 3
  • Thanks 1
Link to comment
  • 2 weeks later...
  • 11 months later...
On 7/14/2020 at 12:56 AM, Energen said:

I have not used the winNUT program but I do use the apcusbd (https://sourceforge.net/projects/apcupsd/files/) program on Windows to accomplish the same task.   My configuration file only needs two lines for basic operation.

 

UPSTYPE net
DEVICE <UNRAID_IP>:3551

 

 

Whats your unraid setup look like?  i have a UNRAID box and a Dell Server (windows) sharing the same UPS (connected by USB on dell server).  I'm running apcusbd on the windows machine but cant get the unraid box configured correctly,

Link to comment
  • 1 month later...
On 6/15/2021 at 6:25 AM, sc0tt said:

 

Whats your unraid setup look like?  i have a UNRAID box and a Dell Server (windows) sharing the same UPS (connected by USB on dell server).  I'm running apcusbd on the windows machine but cant get the unraid box configured correctly,

 

Apologies for the late response.

 

My setup is actually reverse to yours.  I have Unraid as the host for the UPS, i.e. the UPS is connected by USB to Unraid.  In the grand scheme of things my Unraid server is the more important piece of equipment to handle in a power outage.

 

Then on my Windows machine I have apcusbd running as the slave, and it gets it's power outage information from Unraid.

 

I imagine though that your setup should be able to be accomplished, you would just have to figure out which combination of settings on Unraid works.  In the UPS settings of Unraid you may have to play with the UPS cable and/or UPS type options to figure out how to connect to the Windows apcusbd.  It seems that it's probably easier to do it my way though. ;)

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.