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

    NUT server and UPS general question

    Scheduled Pinned Locked Moved General pfSense Questions
    71 Posts 6 Posters 16.8k Views
    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.
    • dennypageD
      dennypage @netboy
      last edited by

      @netboy said in NUT server and UPS general question:

      It so happens, OMV has a NUT package and I installed it after making sure my UPS is connected to OMV using USB (checked lsusb to make sure the UPS shows up).

      Just about everyone has a NUT package. It's pretty universal.

      Have I got it right so far?

      I believe so.

      N 1 Reply Last reply Reply Quote 0
      • N
        netboy @dennypage
        last edited by

        @dennypage Thank you.... shall read more and figure it out

        1 Reply Last reply Reply Quote 0
        • N
          netboy @dennypage
          last edited by

          This post is deleted!
          1 Reply Last reply Reply Quote 0
          • N
            netboy @dennypage
            last edited by

            @dennypage said in NUT server and UPS general question:

            Server 1 would be the NUT Primary (NUT's new term--previously called master), and would perform the actual control of the UPS. Server 2 & 3 would be Secondaries (previously called slaves), and take their instruction from the Primary. When the Primary says "time to shut down" the Secondaries shut down and disconnect from the Primary, after which the Primary shuts down which kills UPS power.
            Note that you can still "monitor" the the Server 1 UPS using NUT on another host (Pi). You would configure it as a Secondary, but use a power value of 0 to indicated that you are not actually connected to the UPS on Server 1. You can use this approach to monitor all the other UPSs from the Pi as well.

            Very useful info....thanks

            N 1 Reply Last reply Reply Quote 0
            • N
              netboy @netboy
              last edited by netboy

              @netboy dennypage I got everything working....

              Now based on my success I would like to monitor the UPS attached to the Netgate router.

              I earlier installed apc package and it worked fine. I uninstalled the same and installed NUT.

              SSH into netgate and it reported the UPS.
              [22.05-RELEASE][admin@router2100.xxx.local]/root: usbconfig
              ugen0.1: <Marvell XHCI root HUB> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA)
              ugen1.1: <Marvell EHCI root HUB> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
              ugen1.2: <American Power Conversion Back-UPS ES 750G FW:841.I4 .D USB FW:I4> at usbus1, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON (2mA)

              My config on the NUT in netgate is as follows:

              5a7e9fdf-ed91-4dea-853c-fa1522b53a98-image.png

              However I am not having any success!!

              9f0d885f-b5d0-453d-ae30-9a47edd0d60a-image.png

              Any tips for troubleshooting?

              After some time in SSH I get this message:

              d40b2c50-d338-438b-a9ea-d0d4c9cb6332-image.png Broadcast Message from root@router2100.480.local
              (no tty) at 12:41 EST...

              UPS netgateUPS is unavailable

              dennypageD 1 Reply Last reply Reply Quote 0
              • dennypageD
                dennypage @netboy
                last edited by

                @netboy said in NUT server and UPS general question:

                Any tips for troubleshooting?

                Yes:

                1. Remove everything from the Advanced settings section and leave it empty. [FYI: The lines you have are in the wrong section; The USB driver doesn't take a port. Some UPSs don't like to be polled too frequently.] Later, you can add lines to the "Additional configuration lines for upsd.users" section to allow remote access, but even then leave all the other sections empty.

                2. If you haven't rebooted since you installed NUT, you need to do so. Alternatively, you can do an unplug and replug (see elsewhere in this thread), but the easiest thing to do is to reboot.

                N 1 Reply Last reply Reply Quote 0
                • N
                  netboy @dennypage
                  last edited by netboy

                  @dennypage Thanks
                  Followed your advice and it works now ....
                  e5aab3cc-5887-4a08-b410-e72de5115744-image.png
                  I added users to the upsd.users and "pointed" the hosts.conf and upsmon.conf on the raspberry pi.
                  The raspberry pi shows the drop down but when I select the one nothing shows up! Other drop down works like a charm.
                  Any other config I must change in netgate?

                  e0f5129c-0d32-4589-a5f4-42d477607868-image.png

                  The selection of "netgate UPS" does nothing and shows connection failure

                  dennypageD 1 Reply Last reply Reply Quote 0
                  • dennypageD
                    dennypage @netboy
                    last edited by

                    @netboy said in NUT server and UPS general question:

                    The selection of "netgate UPS" does nothing and shows connection failure

                    I note that in one location you have "netgateUPS" and in another you have "netgate UPS". FWIW, I recommend that you stay away from spaces in names.

                    N 1 Reply Last reply Reply Quote 0
                    • N
                      netboy @dennypage
                      last edited by netboy

                      @dennypage Hey dennypage the drop down shows the description as listed in Raspberry Pi hosts.conf

                      MONITOR netgateUPS@192.168.0.1 "Netgate UPS"

                      IMHO, I do not think this is the issue.

                      FYI, i have added the following user in netgate config:
                      [monslave]
                      password = {somepassword}
                      upsmon slave

                      Added the following in upsmon.conf in raspberry pi;

                      MONITOR netgateUPS@192.168.0.1 0 monslave {pswd for monslave} slave

                      dennypageD 1 Reply Last reply Reply Quote 0
                      • dennypageD
                        dennypage @netboy
                        last edited by

                        @netboy Please post your upsd.users and upsmon.conf from both systems.

                        N 1 Reply Last reply Reply Quote 0
                        • N
                          netboy @dennypage
                          last edited by netboy

                          @dennypage
                          Sure here we go...

                          Masked password as xxxx, yyyy and zzzz - BTW there are no spaces in my password:

                          netgate - upsd.users

                          [admin]
                          password = xxxxx
                          actions = set
                          actions = fsd
                          instcmds = ALL

                          [monmaster]
                          password = yyyyy
                          upsmon master

                          [monslave]
                          password = zzzzz
                          upsmon slave

                          pi- upsd.users

                          [admin]
                          password = nnnnnn
                          actions = set
                          actions = fsd
                          instcmds = ALL

                          [monmaster]
                          password = uuuuuuu
                          upsmon master

                          [monslave]
                          password = xxxxx
                          upsmon slave

                          netgate - upsmon.conf
                          blanks no entries

                          pi - upsmon.conf
                          MONITOR netgateUPS@192.168.0.1 0 monslave zzzzz slave

                          Am I missing MONITOR entries in upsmon.conf in netgate?

                          dennypageD 1 Reply Last reply Reply Quote 0
                          • dennypageD
                            dennypage @netboy
                            last edited by

                            @netboy said in NUT server and UPS general question:

                            netgate - upsmon.conf
                            blanks no entries

                            Based upon your prior screenshots, upsmon.conf on the pfSense system cannot be empty.

                            Also, please post ups.conf from both systems.

                            N 1 Reply Last reply Reply Quote 0
                            • N
                              netboy @dennypage
                              last edited by

                              @dennypage
                              I added the following to

                              netgate - upsmon.conf
                              MONITOR netgateUPS@localhost 1 monmaster yyyyy master

                              negate - ups.conf
                              blanks no entries

                              pi- ups.conf
                              [powerStrip]
                              driver = usbhid-ups
                              port = auto
                              vendorid = "051d"
                              productid = "0002"
                              desc = "APC BE600M1 600VA UPS"

                              dennypageD 1 Reply Last reply Reply Quote 0
                              • dennypageD
                                dennypage @netboy
                                last edited by

                                @netboy said in NUT server and UPS general question:

                                I added the following to
                                netgate - upsmon.conf
                                MONITOR netgateUPS@localhost 1 monmaster yyyyy master
                                negate - ups.conf
                                blanks no entries

                                Something is wrong. ups.conf cannot be empty, and you should not need to edit upsmon.conf.

                                Let's restart from the ground up and make sure we have a known, stable base.

                                Go to Services -> UPS -> Settings.

                                • Set "UPS Type" to "Local USB"
                                • Set "UPS Name" to "ups"
                                • Uncheck the "Enable notifications" box
                                • Set "Driver" to "usbhid".
                                • Clear any content in "Extra Arguments to driver"
                                • Clear any content in all sections of "Advanced sections"

                                After doing this, press save.

                                Then, log in via terminal and execute the following:

                                cat /usr/local/etc/nut/ups.conf
                                cat /usr/local/etc/nut/upsd.conf
                                cat /usr/local/etc/nut/upsd.users
                                cat /usr/local/etc/nut/upsmon.conf
                                

                                And post the complete output of each.

                                N 1 Reply Last reply Reply Quote 1
                                • N
                                  netboy @dennypage
                                  last edited by netboy

                                  @dennypage
                                  masked passwords

                                  [22.05-RELEASE][admin@router2100.tttt.local]/root: cat /usr/local/etc/nut/ups.conf
                                  [ups]
                                  driver=usbhid-ups
                                  port=auto
                                  [22.05-RELEASE][admin@router2100.tttt.local]/root: cat /usr/local/etc/nut/upsd.conf
                                  LISTEN 127.0.0.1
                                  LISTEN ::1
                                  [22.05-RELEASE][admin@router2100.tttt.local]/root: cat /usr/local/etc/nut/upsd.users
                                  [admin]
                                  password=xxxxx
                                  actions=set
                                  instcmds=all
                                  [local-monitor]
                                  password=xxxxx
                                  upsmon master
                                  [22.05-RELEASE][admin@router2100.tttt.local]/root: cat /usr/local/etc/nut/upsmon.conf
                                  MONITOR ups 1 local-monitor xxxxx master
                                  SHUTDOWNCMD "/sbin/shutdown -p +0"
                                  POWERDOWNFLAG /etc/killpower
                                  [22.05-RELEASE][admin@router2100.tttt.local]/root:

                                  dennypageD 1 Reply Last reply Reply Quote 0
                                  • dennypageD
                                    dennypage @netboy
                                    last edited by dennypage

                                    @netboy Okay, that looks much better.

                                    Now add this

                                    [monuser]
                                    password = secret
                                    upsmon slave
                                    

                                    to "Additional configuration lines for upsd.users" in the Advanced settings section.

                                    Now go to this post and follow the instructions to allow access to the NUT port from the LAN interface. I recommend that you choose option 1.

                                    Following that, you can confirm operation by going to the pi and executing the following command:

                                    upsc ups@192.168.0.1
                                    [Based on prior posts, I am assuming that 192.168.0.1 is the LAN IP address of your pfSense firewall]

                                    When you run the upsc command, you should see all the variables of your UPS displayed.

                                    Lastly, for the pi end, put this in upsmon.conf:

                                    MONITOR ups@192.168.0.1 0 monuser secret slave
                                    
                                    N 1 Reply Last reply Reply Quote 0
                                    • N
                                      netboy @dennypage
                                      last edited by

                                      @dennypage I guess the MONITOR must be like below (see bold) - correct - Probably you have a typo?

                                      MONITOR ups@192.168.0.1 0 monuser secret slave

                                      dennypageD N 2 Replies Last reply Reply Quote 0
                                      • dennypageD
                                        dennypage @netboy
                                        last edited by

                                        @netboy said in NUT server and UPS general question:

                                        I guess the MONITOR must be like below (see bold) - correct - Probably you have a typo?
                                        MONITOR ups@192.168.0.1 0 monuser secret slave

                                        You are correct. I copied and pasted from another example. Sorry about that.

                                        1 Reply Last reply Reply Quote 1
                                        • N
                                          netboy @netboy
                                          last edited by netboy

                                          @netboy SUCCESS!!!
                                          I had to make an entry in hosts.conf for pi

                                          MONITOR ups@192.168.0.1 "Netgate UPS"

                                          Worked. I sincerely thank you very much for all your help.

                                          78615beb-e3c2-490f-875b-1dd8a6701e5a-image.png

                                          40ab2772-3bf9-4ea7-b00d-1628d03d2e06-image.png

                                          2ee9ecff-1377-4705-931c-7944d892a69b-image.png

                                          N 1 Reply Last reply Reply Quote 0
                                          • N
                                            netboy @netboy
                                            last edited by

                                            @netboy Probably last question....

                                            I want to shutdown everything attached to ups in netgate only when "battery low" in ups - How do I configure this functionality

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