Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    UPS configuration master/slave

    General pfSense Questions
    2
    18
    3.4k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • I
      Inxsible
      last edited by

      I recently bought a Eaton 5PX1500RTN UPS(1440VA/1440W) with a Network-MS card. I connected it via ethernet and can now see the Web UI for Eaton. This thread here gave me confidence that the UPS would work via the network instead of using the USB or Serial cable/driver. Now comes the part where I configure it with FreeNAS and pfSense router in order for it to gracefully shutdown in case of a power outage.

      I want to achieve the following in case of a power outage:

      • 60 seconds into the power outage -- initiate graceful shut down of Main NAS and backup NAS.
      • Keep the pfSense router, unmanaged switch, modem and DD-WRT Access Point running until the battery is 5% remaining. At that point, gracefully shut everything down including the UPS.

      Given what I want to achieve, here are some questions I have:

      • Do I still need to connect the "control cable" (usb or serial) even though the UPS has a network card and is visible on my network?
      • Should I make FreeNAS as the master or pfSense as the Master?
      • What is the advantage of making FreeNAS as master or vice-a-versa?
      • In what order would a device shut down if it is a master vs a slave?
      • Since my switch is a dumb switch, I believe that when the UPS shuts down at 5% battery, the switch and modem will just die due to lack of power and I am ok with that. However can the DD-WRT access point be configured to shutdown gracefully?

      Note: all of the devices listed are connected to a PDU which is connected to the UPS.

      1 Reply Last reply Reply Quote 0
      • stephenw10S
        stephenw10 Netgate Administrator
        last edited by

        If you are polling the UPS via SNMP, then you don't any other sort of connection to it. Thouhg there is some argument for out of band connectivity there.

        In a Master-Slave type setup the slave(s) query the master and that queries the UPS so the master must remain up longer then the slave(s). I.e. FreeNAS would be a slave here. However since they are connecting via SNMP they could all connect directly, there is no need to have other devices query a master device. Other than perhaps reducing SNMP traffic.

        If DD-WRT has a NUT package it could be configured either as a slave to pfSense or SNMP direct like anything else. An AP probably doesn't need to be shutdown gracefully though.

        Steve

        1 Reply Last reply Reply Quote 0
        • I
          Inxsible
          last edited by Inxsible

          @stephenw10 said in UPS configuration master/slave:

          If you are polling the UPS via SNMP, then you don't any other sort of connection to it. Thouhg there is some argument for out of band connectivity there.

          I am not worried about out of band connectivity as this is in my home network and the UPS is physically easily accessible.

          @stephenw10 said in UPS configuration master/slave:

          However since they are connecting via SNMP they could all connect directly, there is no need to have other devices query a master device.

          It's good that only an ethernet cable can take care of everything as that will reduce cables in my rack. I need to learn about SNMP too so this will be a good option.

          @stephenw10 said in UPS configuration master/slave:

          Other than perhaps reducing SNMP traffic.

          Is that usually too much of traffic that it will bog the network down? If so, I have no issues using a usb/serial cable via the master/slave route as I have those cables that came with the UPS.

          @stephenw10 said in UPS configuration master/slave:

          If DD-WRT has a NUT package it could be configured either as a slave to pfSense or SNMP direct like anything else.

          I will research if DD-WRT has a NUT package. Thanks.

          @stephenw10 said in UPS configuration master/slave:

          An AP probably doesn't need to be shutdown gracefully though.

          Agreed. I do reset it at times by just pulling the power from it. I was just trying a graceful shutdown for the coolness factor -- again maybe I might learn a bit more about the whole thing.

          How would I set up SNMP polling in pfSense and FreeNAS? When configuring the UPS in FreeNAS gui -- it only gives options of Master or Slave -- Should I just pick Master?

          1 Reply Last reply Reply Quote 0
          • stephenw10S
            stephenw10 Netgate Administrator
            last edited by

            No I wouldn't expect three devices polling the UPS to be an issue as long as you set rational polling rates etc. You probably can't set anything that could cause an issue there but you can always switch to a master/slave setup later.
            Even in that setup you still wouldn't require a serial/USB cable. The master would query the UPS via SNMP and the slaves query the master.
            It looks like DD-WRT can use NUT via Entware. I've never tried that myself though.
            I can't say for FreeNAS, though I doubt it's very difficult, but in the pfSense NUT package you just select 'Remote SNMP' as the UPS type and enter the IP address.

            Steve

            1 Reply Last reply Reply Quote 0
            • I
              Inxsible
              last edited by

              Thanks again Steve.

              I will look into Entware, but if it turns out to be more trouble than worth, I might skip it altogether.

              1 Reply Last reply Reply Quote 0
              • I
                Inxsible
                last edited by

                Do I need to put anything in the "Extra arguments to driver" or anything in the Advanced configuration for upsmon.conf, ups.conf, uspd.conf, upsd.users?

                1 Reply Last reply Reply Quote 0
                • stephenw10S
                  stephenw10 Netgate Administrator
                  last edited by

                  I would not expect to, certainly to get basic data which is normally sufficient.
                  If you need to customise the queries you'd need to know what the UPS provides and that's a question for Eaton.

                  Steve

                  1 Reply Last reply Reply Quote 0
                  • I
                    Inxsible
                    last edited by

                    Thanks again for the quick reply. Do I need to worry about SNMP v1 vs v2c vs v3 since only v3 seems to be secure?

                    Also, the secName, authPassword and privPassword -- are they in cleartext in the ups.conf?

                    1 Reply Last reply Reply Quote 0
                    • stephenw10S
                      stephenw10 Netgate Administrator
                      last edited by

                      It looks like you can set it in ups.conf but it defaults to v1. Depends what your UPS provides though. That would be an extra argument in the pfSense package.

                      snmp_version=version
                      Set SNMP version (default = v1, allowed: v2c, v3)
                      

                      Steve

                      1 Reply Last reply Reply Quote 0
                      • I
                        Inxsible
                        last edited by Inxsible

                        Is there a difference between driver.parameter.pollfreq & driver.parameter.pollinterval ? Initially only the pollinterval was set as 2. Then I passed in an extra argument of pollfreq and set it to 30 since I think 30 seconds is good enough for me. I saw the new parameter of pollfreq

                        Edit: From your reply above it seems many of the parameters and fine grained settings depend highly on the make and model of the UPS. The link that you gave me is the exact one that I was looking at while trying to figure out what if anything should I be passing as arguments etc to the driver.

                        1 Reply Last reply Reply Quote 0
                        • stephenw10S
                          stephenw10 Netgate Administrator
                          last edited by

                          Personally I have not played with those values, the defaults sufficed.

                          There will be other posts here that give more detail though. Have a look in the packages sub-forum.

                          Steve

                          1 Reply Last reply Reply Quote 0
                          • I
                            Inxsible
                            last edited by

                            Will do. Thank you again.

                            1 Reply Last reply Reply Quote 0
                            • I
                              Inxsible
                              last edited by

                              I was able to set up the UPS correctly and the UPS Status page now shows me all the parameters that my UPS provides over the SNMP card. However, I still don't know where to define (within pfSense) that I want to shutdown pfSense when the battery is less than 10%.

                              1 Reply Last reply Reply Quote 0
                              • stephenw10S
                                stephenw10 Netgate Administrator
                                last edited by

                                You would have to do that in the advanced options. Normally it will start to shutdown when the UPS indicated it's battery charge is low but you can override when this set using the 'ignorelb' variable in ups.conf it appears.
                                Again the default values worked for me when I used this last. But that may not be the case for your UPS.

                                Steve

                                I 1 Reply Last reply Reply Quote 0
                                • I
                                  Inxsible @stephenw10
                                  last edited by Inxsible

                                  @stephenw10 said in UPS configuration master/slave:

                                  You would have to do that in the advanced options. Normally it will start to shutdown when the UPS indicated it's battery charge is low but you can override when this set using the 'ignorelb' variable in ups.conf it appears.
                                  Again the default values worked for me when I used this last. But that may not be the case for your UPS.

                                  Steve

                                  Hi Steve,
                                  I read about the ignorelb parameter, but it seems that instead of checking the ONBATT event it compares the battery.charge to the battery.charge.low and the battery.runtime to the battery.runtime.low parameters.

                                  But I still don't understand where I would put in the code to explicitly call ```

                                  shutdown -h now
                                  

                                  ===

                                  or something similar

                                  1 Reply Last reply Reply Quote 0
                                  • stephenw10S
                                    stephenw10 Netgate Administrator
                                    last edited by

                                    As I said I never played with this last time I used it as the compiled in defaults were always sufficient.
                                    The shutdown command itself is preconfigured, it is run when the UPS battery level falls below battery.charge.low. That value is determined by the UPS but can be overridden by ignorelb as detailed.

                                    Steve

                                    1 Reply Last reply Reply Quote 0
                                    • I
                                      Inxsible
                                      last edited by

                                      @stephenw10 said in UPS configuration master/slave:

                                      .

                                      Ok. Thank you. I didn't know the command was preconfigured. Not much information out there about it. Or maybe my google-fu is weak.

                                      1 Reply Last reply Reply Quote 0
                                      • stephenw10S
                                        stephenw10 Netgate Administrator
                                        last edited by

                                        I agree, it's not obvious.
                                        You can see what the pfSense package is configuring in /usr/local/etc/nut/upsmon.conf
                                        Anything else is using the compiled in defaults.

                                        Steve

                                        1 Reply Last reply Reply Quote 0
                                        • First post
                                          Last post
                                        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.