A bit confused with Apcupsd
-
Hello, After a lot of back and forth I finally got this package to work/connect to my ups.
My APC UPS has a management card and I already have the APC Network Shutdown app installed on a windows server to monitor and shutdown my other servers.
I've installed Apcupsd on my pfsense so I can then shut that down gracefully. (don't want to go down the route of ssh/sudo)
My main question or want is. When the UPS fails over to battery mode I want pfsence to trigger its own shutdown.
As I have set the UPS to shut itself down via the APC Network Shutdown app after 10 mins on battery power, when this command is run, will Apcupsd/pfsense sense the UPS is going down shut itself down as well?
If so how will pfsense power off gracefully before the ups?
If it does not, then is all I need to do is set say 9 mins in the Timeout config on Apcupsd? Which wil give pfsense time to shutdown before the ups.
Will other settings conflict with this? Or I need to set something else?
Thanks and cheers in advance.
-
@flashpan Is the UPS directly connected to pfSense box or just the Windows box?
If directly connected to pfSense then running apcupsd on the pfSense device will shut it down correctly.
If the Windows box is the only thing directly connected and it sends out events, then I think (NOTE: think because I have not done this) you may be able to configure apcupsd on the pfSense box to react to network events sent by the Windows box.
If you need to do timer stuff, I'd be conservative and do 8 mins instead of 9.
Another possibility is the pkg "NUT" to react to the network events. -
Thanks mer,
The UPS has a network management card and pfsense is configured to directly communicate with that over IP. Another (windows) server is also connected via IP to the management card and with the APC Network Shutdown app installed on that server. This app I can control when the UPS will shutdown on events etc.
So if the windows server sends a command to shutown the UPS that is the part I am not sure about if pfsense hears/sees the UPS is starting a shutdown and then starts its own shutdown but as you confirm the timer thing wil most likely work.
Did a lot of reading on NUT and feels like a foreign language to me. Kinda got some of it but other areas I just didn't.
I should say as well, I do not really like my UPS to run it batts down to trigger a shutdown. Prefer to have a shutdown after 5 - 10 mins.
Cheers
-
@flashpan
Thanks for explaining physical connectivity. It helps.
So, if you are running apcupsd on pfSense, does it correctly see the UPS and report events?
If you go to the web interface on pfSense, under services you should see apcupsd. See what it says when you do "status".
If you can see status, you should be able to see events from the UPS.
A simple test would be to unplug the UPS from AC power, and see what pfSense does. By default apcupsd should shut itself down. -
@mer
Hi again,Yep the apcupsd package is now running fine on my pfsense and I see all the correct status info (as well as the widget on the main page).
Am going to simulate a power loss as you say. Just got a pick a good time.
Thanks
-
@flashpan You shouldn't need to actually get it to power down, you just want to make sure that it reacts to the events from the UPS. So unplug for 15-20 secs then plug back in should be enough to see if it gets "lost power and power returned". Then just tweak the apcupsd config on pfsense for probably "min time left" or "min battery charge" for the shutdown. Just keep in mind that the Windows server is actually controlling the UPS and you have it configured to "shutdown systems and UPS after being on battery for 10 minutes", so you'll need to figure out how to tell apcupsd on pfSense "shutdown after being on battery for 5 minutes".
Nice to see that at least you are able to get status. That is 90% of it.