FreeNAS + APC Powerchute Network Shutdown

Status
Not open for further replies.

Kljajoni

Cadet
Joined
Apr 20, 2015
Messages
7
Hi everybody.

After a lots of unsuccessful attempts to get this working, I would like to ask community for help .

Company where I work recently purchased two APC Smart-UPS X 3000 that came with network management cards AP9631. Two APC UPS devices are put in redundant configuration (they behave as one). We installed Powerchute Network Shutdown 4.0 software for graceful shutdown of physical/virtual machines and only problem that we are currently having are two FreeNAS servers because we could not find a way how to connect them to PowerChute Virtual Appliance. According to APC Powerchute Compatibility Matrix, FreeNAS (Freebsd) is not officially supported.

We managed to connect them to single network card (Services -> UPS -> driver *APC ups 3 (various AP9630), port IP address of management card, monitor user user on management card and monitor password authentification phraze on UPS device, remote monitor ticked +
command from cli upsc upsname@localhost for verification). Unfortunately, this will not perfectly protect servers in some cases.

The only useful thing that we managed to find is this

https://numberformatdata.wordpress.com/2012/01/16/ups-configuration-on-freebsd-8-2/

which gaves us an idea that we could compile PCNS driver, but we do not know how to do something similar on FreeNAS 9.3 (if it is possible)

Is there any way to connect Freenas to PowerChute Virtual Appliance ver. 4 ? If that is not possible, what solution would you recommend for this case ?

Thanks
 

DrKK

FreeNAS Generalissimo
Joined
Oct 15, 2013
Messages
3,630
This device (The APC Smart-UPS) would appear to be compatible with the built in UPS drivers for FreeNAS. Now, I don't know anything about rackmount UPS's, but, this one appears to have USB ports on it. Is there any chance that you can connect the FreeNAS's via the USB connection, use the built-in nut drivers in FreeNAS (by turning on the UPS service), and have the FreeNAS be in charge of shutting itself down when it receives the appropriate signal from the UPS? ie., bypass the network card thing that came with the UPS?
 
Joined
Oct 2, 2014
Messages
925
I asked this very question over at reddit/r/homelab at one time, and the consensus there was for me to make a script to shut it down via ssh
 

hugovsky

Guru
Joined
Dec 12, 2011
Messages
567
You have to make powerchute execute a command at x% battery. The command will be in a folder called agent/cmdfiles. My install is powerchute business edition, windows version.

you need plink and a file called default with +/- this:

Code:
@START "" "C:\Program Files (x86)\APC\PowerChute Business Edition\agent\cmdfiles\plink.exe" -pw yourpassword root@192.168.xx.xx halt


plink download

At least for me, it worked while I needed it.
 

Kljajoni

Cadet
Joined
Apr 20, 2015
Messages
7
Remote shutdown with ssh via Powerchute command execution on event makes perfect sense in this case, appropriate BAT file with @Hugovski command will 100% do the trick.

Thanks for help !
 

kspare

Guru
Joined
Feb 19, 2015
Messages
508
You can do it directly from the FreeNAS box.

Under services turn on the UPS service and click the wrench to open up the options.

UPS mode is master.

Identifier is just the name of the ups.
Driver I use is APC ups 3 (various) AP9
Port is the ip address of the 9631
Aux para's:
mibs=apcc
community=public <-- you can change this if you use something else in your 9631
Description: i put this the same as the identifier1
shutdown mode : I use when ups reaches low battery
monitor user: apc
monitor password: apc <-- may want to change

Remote monitor: checked off

I also do email updates.

Hope that helps!
 
Last edited by a moderator:

Tenek

Explorer
Joined
Apr 14, 2014
Messages
97
Noob question:
Assuming I'm going to have APC with AP9631. And I have FreeNAS box with VirtualBox template running a few Window Servers.
I can install PowerChute on windows guest systems and connect them to management card on APC by IP. That card has environmental monitoring, and I would like to bring servers down after certain temperature is reached.
After all guest systems are down I have to bring down FreeNAS box. And in order to do it, I have to connect to APC a separate windows computer with PowerChute installed.
In PowerChute description I see "Sequenced shutdown and restart", sounds like it is possible what I want: bring down guest systems and after that main box.
Also it sounds like I have to use "PowerChute Network Shutdown" to do all this.
 
Last edited by a moderator:

steve.long

Dabbler
Joined
Jun 14, 2016
Messages
41
I know I'm SUPER late to the game on this, but I can't get this to work for the life of me. I'm setting up my FreeNAS Mini and I just bought an APC battery backup. I have PowerChute Business Edition installed on my Windows Server.

When I run your command, with my details filled in, the system doesn't shut down. It 'halts' I guess, but the system remains on with all the hard drive bays still lit and the power LED still on. Is that what I'm going for?
 
Status
Not open for further replies.
Top