UPS Support - pfSense and a FreeNAS Server?



  • I current have a FreeNAS server and a pfSense box both plugged into an APC UPS.  I have the APC USB 'control' cable hooked into the FreeNAS box so (in theory) it will gracefully shutdown if I loose power before the UPS dies.

    I was wondering is there any way to also tie in the pfSense box to the UPS control such that it also gracefully shuts-down before (if) the UPS runs out of battery?

    At least with my current setup the FreeNAS box will gracefully shutdown and then the pfSense box should only experience a single fairly clean loss of power no matter what actually happens on the AC mains coming into the house.

    Thanks,
    -TAC


  • LAYER 8 Netgate

    I have the same setup.  I'm far more concerned about FreeNAS gracefully shutting down than I am about pfSense.  There's a backup pfSense config on my FreeNAS, anyway. ;)



  • The apcupsd daemon supports a network mode whereby one instance is the server and then you can have multiple clients.  The server notifies the clients of power status, so when the battery is exhausted and the server is ready to shutdown its host it will notify the clients as well so they can shutdown their hosts.

    Bill



  • Derelict, I can relate to your comments.  I think I have it covered.

    Bill, Thanks for your comments.  It's really cool to know that is possible, maybe some day I'll be able to relate. ;-)

    -TAC



  • I'm not entirely sure if you were asking if it was possible or not but if you were, to answer your question, yes it is. I just got mine to do it via snmp to FreeNAS and FreeNAS acting as the NUT server.

    Configure FreeNAS to connect on yours and open a command prompt and check that it is actually seeing the UPS by typing

    upsc ups@localhost
    

    Replace "ups" with your chosen identifier for your UPS.

    You should get a response with all your UPS information and status. Towards the bottom it should say, "ups.status OL", meaning "UPS status Online"
    See… https://forums.freenas.org/index.php?threads/nut-not-working-solved-with-little-to-no-input.26432/#post-168093

    Once you have configured your device (granted I did not give instructions on how to do that) you can then configure NUT on FreeNAS to be a server for a remote device.
    To do so you must have NUT set as master.

    So it should look something like this.....

    UPS Mode: Master
    Identifier: ups (or your chosen name, cap sensitive)
    Driver: (Your UPS, see above link to verify connected)
    Port: (In your case I do not know)
    Auxiliary parameters:
    Description: (In my case I put Tripplite)
    Shutdown mode: UPS goes on battery
    Shutdown timer: 180 (Keep the timer well within the limits of your battery backup's capable time)
    Monitor User: (This is the user you must set for remote devices to use to connect)
    Monitor Password: (This is the password you must set for remote devices to authenticate)
    Extra users:
    Remote Monitor: (Check this to enable remote monitoring from your PfSense box)
    Send Email Status Updates: (User preference)

    On your PfSense Box it should look something like this...
    Under "NUT" - "NUT Settings" tab....

    UPS Monitoring: Remote NUT UPS

    Scroll down to "Remote NUT UPS Settings" and configure the following....

    Remote NUT UPS name should be the exact same as "Identifier" on your FreeNAS box (I believe cap sensitive)
    Remote NUT UPS address should be the address of your FreeNAS box
    Remote NUT UPS User is the "Monitor User:" user you defined on your FreeNAS box
    Remote NUT UPS Password is the "Monitor Password" password you defined on your FreeNAS box

    After all this click on "Change" on you should see the status of your UPS in NUT on your PfSense box.

    Hopefully that answers your questions.
    I just got this working myself tonight, thankfully.



  • Visseroth,  Yes this is exactly what I was looking for.  Your instructions even look detailed enough that even I could get it going.  I'll let you know how it goes.

    Thnx again.

    -TAC



  • Cool! Glad to hear! Those instuctions were directly from my own setup, so if you need any further assistance I'll help where I can.


Log in to reply