Netgate SG-1000 microFirewall

Author Topic: UPS PfSense Shutdown  (Read 340 times)

0 Members and 1 Guest are viewing this topic.

Offline Peter847

  • Newbie
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
UPS PfSense Shutdown
« on: January 03, 2018, 08:00:41 am »
I run a small small office LAN through PfSense and am looking for advice on how I manage my UPS.

The UPS supplies PfSense and a couple of Windows machines.  Its main purpose is to ride through the relatively frequent power drop outs that last a few seconds, real outages (greater than a minute) are rare.  It does not look easy to get one UPS management suite that will gracefully shutdown all the machines so I am thinking about letting PfSense just run out of power.

PfSense runs on a passively cooled Atom system with an SSD, will I damage anything if I just let the power on the UPS run out and restart PfSense when the power returns?

Offline Gertjan

  • Hero Member
  • *****
  • Posts: 2283
  • Karma: +173/-9
    • View Profile
Re: UPS PfSense Shutdown
« Reply #1 on: January 03, 2018, 08:13:39 am »
.. will I damage anything if I just let the power on the UPS run out and restart PfSense when the power returns?
This situation will happen every time the power gets lost.
If power outages rarely last for more then a minute or so, it will not happen anymore, as your UPS will take over over this "minute or so"'.
When the UPS is connected to pfSense with an USB or serial cable, the UPS can even start a clean shut down sequence.

"If damage occurs" can't be answered. You should avoid these situations as much as possible.

Offline mer

  • Sr. Member
  • ****
  • Posts: 310
  • Karma: +43/-1
  • FreeBSD since 3.3
    • View Profile
Re: UPS PfSense Shutdown
« Reply #2 on: January 03, 2018, 11:50:28 am »
You should be able to use apcupsd or NUT package on the pfSense box and have it gracefully shutdown.
If you want the single UPS to gracefully shutdown all the machines, you'll need to pick something that runs everywhere and has the ability to talk across the network. 
NUT (networkupstools.org) has this feature, I believe there is a pfSense package for it, it looks like it may run on Windows.

I'd set up pfSense to be the master of the UPS and the other machines as slaves to that.  When it's time to shutdown, master tells the slaves to shutdown then shuts itself down.

Just my opinion and you may need to play around with whatever solution (timing between slaves shutting down and the master shutting down)

Offline Peter847

  • Newbie
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Re: UPS PfSense Shutdown
« Reply #3 on: January 05, 2018, 12:56:46 am »
Many thanks for the replies.  I think I need to give you a few more details.

I currently have NUT installed on my PfSense machine and can see the status of the UPS, I do not think it is compatible with apcupsd.  No doubt I can configure NUT to shutdown this machine but the UPS also powers two Windows machines and it does not look like the Windows port of NUT is actively supported.  I was considering using the UPS manufacturer's Windows software to shutdown the critical Windows machine and just let PfSense and the other Windows machine die when the power runs out.  But that looks like a bad idea?

So it looks like my only solution is to buy another APC compatible UPS?

Offline dennypage

  • Hero Member
  • *****
  • Posts: 715
  • Karma: +136/-0
    • View Profile
Re: UPS PfSense Shutdown
« Reply #4 on: January 05, 2018, 01:56:55 am »
I suggest scanning the NUT package info thread. It's a long thread (20 pages), but there is a lot of good information in there. The 1st reply discusses remote access.

There are several NUT client variants for Windows. You can find information here and here. I can't recommend any particular one because I haven't used Windows for a while.

If you have an APC UPS, there is a apcupsd package available for pfSense. It doesn't have an official package info thread, but you can search the package forum for "apcupsd". Make sure that posts you are looking at correspond to the current generation of the package (pfSense 2.3/2.4) rather than the prior generation (pfSense 2.2 and below). It begins around here. I don't know how/if apcupsd interacts with Windows remote access, but I'm sure that someone in the package forum could provide some information.

Offline mer

  • Sr. Member
  • ****
  • Posts: 310
  • Karma: +43/-1
  • FreeBSD since 3.3
    • View Profile
Re: UPS PfSense Shutdown
« Reply #5 on: January 05, 2018, 07:43:45 am »
Second what dennypage is saying.

If you already have NUT on the pfSense system, you don't need/want apcupsd on it, just make it shutdown the pfSense system.  That way pfSense is the master.
The Windows machines then run NUT as a client, over a network connection to the pfSense system.   That way the one master instance controls the other machines and should be able to shut them all down.

It's a fairly common configuration;  moreso as machines evolved so they draw less power so a single UPS handles more than one.

Offline Peter847

  • Newbie
  • *
  • Posts: 16
  • Karma: +0/-0
    • View Profile
Re: UPS PfSense Shutdown
« Reply #6 on: January 08, 2018, 01:30:10 am »
Many thanks for all the replies, very helpful.  I did some more digging on the NUT website, the first Windows client I found was unsupported but it appears there are others.  I'll shutdown down the Windows machine using one of these NUT clients and then bring down PfSense.

Thanks again.

Offline Ryu945

  • Full Member
  • ***
  • Posts: 122
  • Karma: +2/-0
    • View Profile
Re: UPS PfSense Shutdown
« Reply #7 on: January 11, 2018, 09:51:08 am »
I run a small small office LAN through PfSense and am looking for advice on how I manage my UPS.

The UPS supplies PfSense and a couple of Windows machines.  Its main purpose is to ride through the relatively frequent power drop outs that last a few seconds, real outages (greater than a minute) are rare.  It does not look easy to get one UPS management suite that will gracefully shutdown all the machines so I am thinking about letting PfSense just run out of power.

PfSense runs on a passively cooled Atom system with an SSD, will I damage anything if I just let the power on the UPS run out and restart PfSense when the power returns?

I have commonly dropped the power on a Pfsense router I have (Basically whenever I had a need to turn it off/restart it).   Only once in a few years of doing this have I had a problem.   I somehow managed to line up one of my power drops with a process you can't drop the power on and I had to run some program to fix it so that the router would operate again.   Consdering how many times I have dropped the power and yet I had this happen only once, it is quite rare.