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

    UPS master via USB

    General pfSense Questions
    6
    18
    1.9k
    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.
    • RyanMR
      RyanM
      last edited by

      I am running 2.4.4 of pfSense.

      I have a UPS connected to my pfSense router using a USB cable. I did have some trouble with this and opened ticket #9849 on this. That said, I found a work-around to get my UPS to be identified by pfSense/NUT.

      I have pfSense and another server connected to the UPS. The other server supports NUT. I would like a setup very similar to what is discussed in UPS configuration master/slave, except I am not using an ethernet connection to manage my UPS, rather I am using USB. What I have not seen is how to configure pfSense to act as the "Master" with NUT. Do I need to do anything? Or by virtue of connecting the UPS to pfSense via the USB cable is it implied that it is the master?

      Also, how would I configure pfSense to wait until the UPS is down to 5-10% before shutting down? Will I get email notifications if the power goes out? Can I get a notification if the battery power drops below 50% (in case the batteries start going bad)? Or does NUT also monitor battery health and will notify me?

      Thanks.

      1 Reply Last reply Reply Quote 0
      • RyanMR
        RyanM
        last edited by

        Is this in the right forum?

        1 Reply Last reply Reply Quote 0
        • RyanMR
          RyanM
          last edited by

          FWIW, I figured this out. I had to navigate to Services > UPS. Then select the UPS Settings tab. From the settings page, click the "Display Advanced" button.

          In upsmon.conf add the following:

          RUN_AS_USER root
          

          This is a work-around to sending email notifications. See post #642812 in the NUT package thread.

          In ups.conf add the following:

          user = root
          

          This will cause upsdrvctl to run as root.

          In upsd.conf add the following:

          LISTEN 127.0.0.1
          LISTEN 192.168.10.1
          

          This will cause the UPS daemon to listen on localhost as well as my LAN IP so that a "slave" can connect to it.

          1 Reply Last reply Reply Quote 1
          • J
            Joe_Papa
            last edited by Joe_Papa

            I know this is a thread necro, but I just had to tell you that your comments here totally solved my problem with my Eaton 9130 connection to pfSense through USB. Thank you very much. I used the same commands you recommend here and magically it started working.

            Thank you for sharing.

            P.S. Did you figure out how to configure notifications and shutdown behavior?

            RyanMR 1 Reply Last reply Reply Quote 0
            • RyanMR
              RyanM @Joe_Papa
              last edited by

              @Joe_Papa said in UPS master via USB:

              I know this is a thread necro, but I just had to tell you that your comments here totally solved my problem with my Eaton 9130 connection to pfSense through USB. Thank you very much. I used the same commands you recommend here and magically it started working.

              Thank you for sharing.

              P.S. Did you figure out how to configure notifications and shutdown behavior?

              Glad it helped @Joe_Papa.

              Regarding your question at the end, I do get the notification emails from the UPS service. I think all I had to do was setup "E-Mail" under System > Advanced > Notifications.

              I haven't tested a loss of power. I need to do this. However, my situation is different than yours. My UPS is powering my pfSense router and a FreeNAS server. This is also for home use, so 24/7 availability is not my concern. I added the UPS to ensure I protected against data loss on my FreeNAS server in the event of power loss. The majority of my power outages are very short (often just 1-2 seconds), and this happens 1/2 dozen times a year. So my UPS can protect against that.

              My pfSense router draws almost no power (fan-less mini-pc). My FreeNAS server is a rather large SuperMicro 2U rackmount server with dual 920w power supplies.

              pfSense reports that my UPS load is usually around 25% and it can run at that load for a little over 23min.

              I have my FreeNAS server configured to shut down if power is lost for more than 30 seconds. If that happens, I would expect the load of my UPS to be significantly lower, and thus the runtime to be significantly longer. I never looked into the auto-shutdown of my router because I would prefer it to stay up until power is restored.

              Maybe this is foolishness on my part, but I don't know any better.

              I suppose I should shutdown my FreeNAS server at some point and check what the load is on the UPS and what the runtime would be. I would expect it to be at least several hours, but I really don't know.

              1 Reply Last reply Reply Quote 0
              • J
                Joe_Papa
                last edited by

                Thanks Ryan. Do you know how to set your VMs up so they will power down gracefully?

                I don't have many power outages, but probably 2 or so a year and I want my VMs and hardware to shut down in an orderly manner. I would probably set each of my VMs to power down in a priority order with the pfSense router being last and then the server shutting down completely. Then restarting once power is restored...

                I don't know where to start with this...

                provelsP RyanMR 2 Replies Last reply Reply Quote 0
                • provelsP
                  provels @Joe_Papa
                  last edited by

                  @Joe_Papa
                  I use Hyper-V, and I think the host will shut the guests down gracefully. I have my host's BIOS to power up on power return and the VMs to start automatically.

                  Peder

                  MAIN - pfSense+ 24.11-RELEASE - Adlink MXE-5401, i7, 16 GB RAM, 64 GB SSD. 500 GB HDD for SyslogNG
                  BACKUP - pfSense+ 23.01-RELEASE - Hyper-V Virtual Machine, Gen 1, 2 v-CPUs, 3 GB RAM, 8GB VHDX (Dynamic)

                  1 Reply Last reply Reply Quote 0
                  • RyanMR
                    RyanM @Joe_Papa
                    last edited by

                    @Joe_Papa said in UPS master via USB:

                    Thanks Ryan. Do you know how to set your VMs up so they will power down gracefully?

                    I don't have many power outages, but probably 2 or so a year and I want my VMs and hardware to shut down in an orderly manner. I would probably set each of my VMs to power down in a priority order with the pfSense router being last and then the server shutting down completely. Then restarting once power is restored...

                    I don't know where to start with this...

                    I have 1 bhyve VM on my FreeNAS server and then several IOCage jails. I haven't really looked into it, but I am hopeful that FreeNAS sends the shutdown signal to the jails and VM before shutting itself down.

                    I can't really help you without more information. Is your pfSense on its own machine? Or is it virtualized? If VM, what virtualization are you running and what is the host OS?

                    1 Reply Last reply Reply Quote 0
                    • J
                      Joe_Papa
                      last edited by

                      My pfSense is virtualized in ESXi on my HP ML350 G6 server.

                      So I need to figure out how to manage graceful shutdowns of 3+ VMs and then the physical server.

                      And then gracefully restart after the power event is over too... One thing at a time though. :)

                      1 Reply Last reply Reply Quote 0
                      • J
                        Joe_Papa
                        last edited by

                        Ok. I figured out how to configure ESXi to prioritize the VM shutdowns and timing. It had to be done with the vSphere Client instead of the web client. Weird that the web client doesn't have the same functionality as the very out-of-date vSphere Client, but whatever.

                        Now I'm trying to figure out how to trigger the server shutdown based on the PSU state.

                        I have NUT installed on my pfSense VM which allows monitoring of the PSU, but it doesn't seem to have any functionality built in for actually triggering the server... Or perhaps I just don't know how to do it. I'll keep looking.

                        B 1 Reply Last reply Reply Quote 0
                        • C
                          chrcoluk
                          last edited by

                          I didn't need to do this so I am curious why some people need to do it and others do not, I am using NUT as mater connected via USB.

                          pfSense CE 2.7.2

                          1 Reply Last reply Reply Quote 0
                          • B
                            biggsy @Joe_Papa
                            last edited by

                            @Joe_Papa

                            I figured out how to configure ESXi to prioritize the VM shutdowns and timing. It had to be done with the vSphere Client instead of the web client.

                            Web client: Manage > System tab > Autostart

                            J 1 Reply Last reply Reply Quote 0
                            • J
                              Joe_Papa @biggsy
                              last edited by

                              @biggsy ESXi Manage-Autostart pic.JPG

                              That's all that I see from that menu... None of the options from the vSphere Client are there... Here's what I see from the vSphere Client.

                              vShpere Configuration-VM Startup Shutdown pic.JPG

                              B 1 Reply Last reply Reply Quote 0
                              • B
                                biggsy @Joe_Papa
                                last edited by

                                @Joe_Papa

                                What version of ESXi is that?

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

                                  The screenshot shows 6.0.0. ๐Ÿ˜‰

                                  Which I will point out is too old for FreeBSD 11 and hence pfSense 2.4. VMWare requires 6.5 or higher for compatibility.

                                  Steve

                                  B C 2 Replies Last reply Reply Quote 0
                                  • B
                                    biggsy @stephenw10
                                    last edited by

                                    @stephenw10 said:

                                    The screenshot shows 6.0.0.

                                    ๐Ÿ™„ It does. Thanks, Steve.

                                    That build number is from June 2017. Definitely time to upgrade.

                                    1 Reply Last reply Reply Quote 0
                                    • C
                                      chrcoluk @stephenw10
                                      last edited by

                                      @stephenw10 said in UPS master via USB:

                                      The screenshot shows 6.0.0. ๐Ÿ˜‰

                                      Which I will point out is too old for FreeBSD 11 and hence pfSense 2.4. VMWare requires 6.5 or higher for compatibility.

                                      Steve

                                      Interesting, I am running one of my VM's using exi 6.0 on FreeBSD 12 (im not updating host anymore as is planned migration to proxmox).

                                      Even more interesting the VM itself is on 5.5 VM version.

                                      Do you have any ideas of the compatibility problems?

                                      pfSense CE 2.7.2

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

                                        YMMV! But we have seen odd behaviour like inexplicable crashes and problems routing traffic etc. Usually with more complex setups like HA with nodes in separate hosts.

                                        See:
                                        https://www.vmware.com/resources/compatibility/search.php?deviceCategory=software&details=1&operatingSystems=232&productNames=15&osBits=64

                                        Steve

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