How to? Two PC's, one UPS?

Otroi

Cadet
Joined
Jul 29, 2016
Messages
3
I've tried searching for anyone who's tried to do the same thing and didn't find much that offered a good solution. I want to run, and successfully control, 2 pcs (freenas, main pc) off of one UPS.

This doesn't seem to be a super easy thing to do.

My UPS is a CyberPower CP1500AVRLCD. I've tried using the "business edition" of the UPS software to run a command ... "plink -ssh -P 500 -l root -pw <pw> 192.168.5.101 /sbin/shutdown -p now"

which works on it's own from a command line from the main pc, however it seems that the command script is never run from the UPS software on a power outage signal. I don't know if it's because I don't actually have a business UPS and it's not communicating properly for the business software or if something else is wrong with the script/configuration.

The home edition of the UPS software has no such feature to run commands.

So which direction should I be looking in order to get both pcs to shutdown in a power outage? What do I use on the main pc to either be the server or client for the UPS signals? (and how do I configure it?)

Thanks :)
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
Not really a FreeNAS forum question but I do see what you want to do. You might be better off to ask this in some sort of UPS forum but here is some advice I can give you...

I'd recommend connecting your UPS USB cable to the FreeNAS computer and when setting up your UPS configuration ensuring it is MASTER, select a "Identifier" name (I used "ups"), and I leave my password field blank but if you find out you need one, well fill that in too. Also ensure your FreeNAS has a static IP address or it's just going to be more painful, my FreeNAS IP is "192.168.1.51".

Next your Main PC needs to be on the same network/subnet and you need to be running software which will monitor for your FreeNAS UPS command to shutdown.

So in my situation I am running Ubuntu and if I type "upsc ups@192.168.1.51" then I get a report back from my UPS. These are the first steps to connectivity and then control of your system. The format of the command is something you can look up via Google "upsc command".

So that should get you started, and you can control all your computers this way as well.
 

Otroi

Cadet
Joined
Jul 29, 2016
Messages
3
Next your Main PC needs to be on the same network/subnet and you need to be running software which will monitor for your FreeNAS UPS command to shutdown.

I think that's mainly where my problem is. I looked at nut/winnut/shutter and other software that was nut related for Windows but couldn't get anything to communicate.

I'll have to try again I guess, and keep trying until I figure something out.

Thanks.
 

wblock

Documentation Engineer
Joined
Nov 14, 2014
Messages
1,506
I do this with FreeBSD. One system is connected by USB to an APC system and runs apcupsd as the master. The second system runs apcupsd as a slave, communicating with the master over the network. I would think this could be done with NUT also, but have not tried it.
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
You could also have a firewall issue. Disable your firewall(s) or you could boot something like the Ubuntu Live DVD (do not install it), and open a terminal window and type in the command like I indicated above. That would at least tell you if your FreeNAS is working and you have physical communications. If that works then you know it's likely a firewall issue.
 

Stuartbe

Dabbler
Joined
Feb 4, 2017
Messages
16
I have had this issue with APC ups software. The other machine (not the freenas) will create a service that runs under the system account. I found that the ups service will be unable to perform a shutdown on the other machine unless it is running under an admin account.

I would find the service on the machine connected to the ups and change the service from system to an account that has admin rights (if its windows) if not include sudo in the script.

I hope that helps.

Stuart.
 

couzin2000

Cadet
Joined
Oct 9, 2018
Messages
6
First time poster here. Not user yet, but soon.
I realize this post is old, but in reviving it I hope perhaps someone will help me gain perspective.

I am about to build an always-on Mini-ITX FreeNAS box. This will be physically connected (by USB and power cable) to a Cyberpower CP1500AVRLCD UPS.
I also currently own a bigger PC running Windows 7, which is my audio workstation. This will be physically connected (power cable only) to the same UPS. Not always on.
Since my FreeNAS box is on at all times, logically it will be monitoring the power. If and when the power goes down, this box would send a signal to other PCs physically connected to the UPS unit (but not monitored).

How (or better yet, WHAT) do I install something on FreeNAS which will contact the other PC (possibly via winNUT) so that the second PC realizes power is down and that it must shutdown?

In other words, UPS ---a--->FreeNAS box ---b--->Win7 workstation
How do I get "b" connection to work?
 

joeschmuck

Old Man
Moderator
Joined
May 28, 2011
Messages
10,994
The FreeNAS has a built in NUT server if you will and will transmit a command stating the UPS is on battery. You need to search the internet on how to make your Windoze system to react to that signal. This should be fairly easy to do.
 
Top