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

    NUT package (2.8.0 and below)

    Scheduled Pinned Locked Moved UPS Tools
    1.2k Posts 128 Posters 4.3m 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
      last edited by

      @jg3:

      Is it possible to have the NUT daemon monitor and manage two UPSes?

      There is no way to do this in the UI. Sorry.

      1 Reply Last reply Reply Quote 0
      • B
        bulldog5
        last edited by

        @dennypage:

        @bulldog5:

        Driver Extra Args:

        port = /dev/ugen0.6
        ignorelb
        override.battery.charge.low = 50
        override.battery.runtime.low = 600

        The ups is at 58% load, or approximately 610 watts. Expected runtime of 14-15 min according to Cyber. So the shutdown should be triggered approximately 5 min after mains go offline.

        One of the notes in the nut documentation on ignorelb is that some UPSs generate a LB indication almost immediately after loss of mains. In the context of general Cyberpower flakiness, I can see this happening either from loss of mains, high/low transfer, or maybe even a UPS initiated self test. Even though it would not initiate a shutdown with your configuration, nut would still generate a notification if the UPS sent a LB alert. Is it possible this is happening?

        In terms of timing, did the load level change around the time of the upgrade? Or Driver Extra arguments?

        Not sure i'm following completely.  As far as I know, the main is never lost, i never get any switch alerts, and never see any power surge/ flicker etc if that's what you're asking?  The only thing that changed a while back was a 8port POE switch added to the load.  Don't see how going from 52% load to 58% should say LOWBATT?  Just had an alert come out now about 10minutes ago, checked the UPS immediately and its 100% charge.  Driver Args and all config stayed the same.  Is there something i can tweak / change  to try to eliminate this.

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

          @bulldog5:

          As far as I know, the main is never lost, i never get any switch alerts, and never see any power surge/ flicker etc if that's what you're asking?

          Yep. Or load surges, mains frequency change, UPS initiated self tests, etc.

          In general, I doubt that nut is "making up" the event, and believe that the Cyberpower is actually issuing a LB signal which nut is dutifully logging. You can get definitive verification by running usbdump to capture all the traffic involving the ups, but I'm not sure it's worth it to delve this deeply though. :)

          The ups model doesn't have a modifiable battery.charge.low, so I don't know of anything you can tweak with nut. You might search/ask in the nut users mailing list, but I expect that they will view it as a UPS problem. About the only other diagnostic recommendation I can think of is to change the load characteristics and see if it affects the issue. Temporarily removing the PoE switch perhaps.

          Sorry I don't have a better recommendation.

          1 Reply Last reply Reply Quote 0
          • B
            bulldog5
            last edited by

            @dennypage:

            @bulldog5:

            As far as I know, the main is never lost, i never get any switch alerts, and never see any power surge/ flicker etc if that's what you're asking?

            Yep. Or load surges, mains frequency change, UPS initiated self tests, etc.

            In general, I doubt that nut is "making up" the event, and believe that the Cyberpower is actually issuing a LB signal which nut is dutifully logging. You can get definitive verification by running usbdump to capture all the traffic involving the ups, but I'm not sure it's worth it to delve this deeply though. :)

            The ups model doesn't have a modifiable battery.charge.low, so I don't know of anything you can tweak with nut. You might search/ask in the nut users mailing list, but I expect that they will view it as a UPS problem. About the only other diagnostic recommendation I can think of is to change the load characteristics and see if it affects the issue. Temporarily removing the PoE switch perhaps.

            Sorry I don't have a better recommendation.

            Alright, appreciate the help.  the UPS still has warranty, I just dunno exactly how to pick that battle with CP, they will say its WOD because self test passes.  Fact of matter is, I've almost had this UPS for a year with flawless operation, and now this just started July 9th and coincidence or not with the upgrade.  It would be a shame if I can't run 58% load on a UPS, i would think 80% would be where you don't exceed.

            I called CyberPower support, and of course, they just brush it off as a NUT issue since the battery never drops charge so its not really low.  He mentioned something about if your runtime goes below a certain value which can be specified if using "their power software" it would set an error.  Is there something equivalent in NUT?  Looking at the output again, i can change the battery.charge.low and .warning. I set charge.low = 40 and charge.warning = 50.  battery.runtime.low is set at 600, so load would need to increase to the point where runtime drops below 600?  It currently sits around 840.

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

              @bulldog5:

              Looking at the output again, i can change the battery.charge.low and .warning. I set charge.low = 40 and charge.warning = 50.  battery.runtime.low is set at 600, so load would need to increase to the point where runtime drops below 600?  It currently sits around 840.

              Yes, you do want the warning to happen before the low. With your runtime number and low setting, you will actually initiate shutdown ~4 minutes after loosing mains.

              I would tend to set all of them a little lower than what you have, but it depends upon your situation. I.E. how long it takes your systems to shut down. On my general purpose systems I use:

              override.battery.charge.warning = 25
                      override.battery.charge.low = 20
                      override.battery.runtime.low = 300

              The reason I set these variables is because I have several servers that can take 2-3 minutes to perform a clean shutdown. Certainly longer than the 60 seconds or so warning I get from the LB signal.

              For the firewall I use more aggressive values because pfSense shuts down quickly:

              override.battery.charge.warning = 25
                      override.battery.charge.low = 10
                      override.battery.runtime.low = 180

              Truth be told, the LB signal on the UPS probably does a fine job here, and these settings are really not necessary. I just set them out of habit.

              Your mileage may vary.

              1 Reply Last reply Reply Quote 0
              • B
                bulldog5
                last edited by

                I plugged the UPS into a 2K12 server and installed CPs PowerPanel software, let it run for few days and didn't get any LOWBATT messages, then plugged it into my FreeNAS server which is using driver 2.7.3, internal driver .39. and no LOWBATT messages.  Here is the output running on the FreeNAS box.  So, something is not the same after the upgrade on pfsense because i dont see the LOWBATT message on 2 other boxes.  Going to try mirroring the freenas NUT configs, (being doubtful that will matter) then going to have to find some time to reinstall pfsense to 2.3.2 and go from there).

                battery.charge: 100
                battery.charge.low: 10
                battery.charge.warning: 20
                battery.mfr.date: CPS
                battery.runtime: 960
                battery.runtime.low: 300
                battery.type: PbAcid
                battery.voltage: 24.0
                battery.voltage.nominal: 24
                device.mfr: CPS
                device.model: OR1500PFCRT2U
                device.type: ups
                driver.name: usbhid-ups
                driver.parameter.pollfreq: 30
                driver.parameter.pollinterval: 2
                driver.parameter.port: /dev/ugen0.6
                driver.parameter.synchronous: no
                driver.version: 2.7.3
                driver.version.data: CyberPower HID 0.4
                driver.version.internal: 0.39
                input.transfer.high: 139
                input.transfer.low: 88
                input.voltage: 120.0
                input.voltage.nominal: 120
                output.voltage: 120.0
                ups.beeper.status: enabled
                ups.delay.shutdown: 20
                ups.delay.start: 30
                ups.load: 57
                ups.mfr: CPS
                ups.model: OR1500PFCRT2U
                ups.productid: 0601
                ups.realpower.nominal: 900
                ups.status: OL
                ups.test.result: Done and passed
                ups.timer.shutdown: -60
                ups.timer.start: -60
                ups.vendorid: 0764

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

                  @bulldog5:

                  I plugged the UPS into a 2K12 server and installed CPs PowerPanel software, let it run for few days and didn't get any LOWBATT messages, then plugged it into my FreeNAS server which is using driver 2.7.3, internal driver .39. and no LOWBATT messages.

                  So, something is not the same after the upgrade on pfsense because i dont see the LOWBATT message on 2 other boxes.  Going to try mirroring the freenas NUT configs, (being doubtful that will matter) then going to have to find some time to reinstall pfsense to 2.3.2 and go from there).

                  When you put it back on the pfSense box did the LOWBATT messages immediately return?

                  1 Reply Last reply Reply Quote 0
                  • B
                    bulldog5
                    last edited by

                    @dennypage:

                    @bulldog5:

                    I plugged the UPS into a 2K12 server and installed CPs PowerPanel software, let it run for few days and didn't get any LOWBATT messages, then plugged it into my FreeNAS server which is using driver 2.7.3, internal driver .39. and no LOWBATT messages.

                    So, something is not the same after the upgrade on pfsense because i dont see the LOWBATT message on 2 other boxes.  Going to try mirroring the freenas NUT configs, (being doubtful that will matter) then going to have to find some time to reinstall pfsense to 2.3.2 and go from there).

                    When you put it back on the pfSense box did the LOWBATT messages immediately return?

                    No

                    1 Reply Last reply Reply Quote 0
                    • C
                      cuco
                      last edited by

                      Hi

                      I tried to "add" my UPS to my pfSense installation with the nut-package as well. Configured it with "Remote NUT server" and it shows me the load, the remaining runtime, sends me emails and so on. But it doesn't shutdown pfsense.

                      upsc on the remote nut server gives me:

                      battery.charge: 100.0
                      battery.charge.low: 20
                      battery.date: 2011-05-06
                      battery.runtime: 540.0
                      battery.runtime.low: 240
                      battery.voltage: 13.7
                      battery.voltage.nominal: 12.0
                      device.mfr: APC
                      device.model: Back-UPS RS 550GI
                      device.serial: 3B1119X20852
                      device.type: ups
                      driver.name: apcupsd-ups
                      driver.parameter.pollinterval: 2
                      driver.parameter.port: localhost
                      driver.parameter.synchronous: no
                      driver.version: 2.7.4
                      driver.version.internal: 0.04
                      input.sensitivity: H
                      input.transfer.high: 276.0
                      input.transfer.low: 176.0
                      input.transfer.reason: Low line voltage
                      input.voltage: 223.0
                      input.voltage.nominal: 230
                      ups.date: 2017-08-05
                      ups.firmware: 857.L3 .I USB FW:L3
                      ups.id: t-usv
                      ups.load: 27.0
                      ups.mfr: APC
                      ups.model: Back-UPS RS 550GI
                      ups.realpower.nominal: 330.0
                      ups.serial: 3B1119X20852
                      ups.status: OL
                      ups.test.result: NO
                      ups.time: 22:12:53
                      
                      

                      pfSense shows the same.

                      When the power fails (I plugged out the mains) I get this E-Mail:

                      Sat, 05 Aug 2017 03:05:33 +0200

                      UPS br550gi@t-usv.lan.xxxx.eu on battery

                      When the battery runtime goes below 4 mins (240 secs) like configured in the UPS I get this:

                      Sat, 05 Aug 2017 03:10:21 +0200

                      UPS br550gi@t-usv.lan.xxxx.eu battery is low

                      But nothing more happened. I waited about 2 more minutes, but pfSense didn't shut down and then I reconnected the mains.

                      What may I have done wrong?

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

                        I don't think you are doing anything wrong per se. By default, the nut slave (pfSense) isn't going to initiate a shutdown until the master server declares a low battery condition. This is different than a low battery warning.

                        When the master declares a low battery condition, it will send a notification to all the slaves indicating that there is a pending loss of power. The slaves will each disconnect from the master and then initiate their own shutdown. Once all the slaves have disconnected, the master will initiate its own shutdown.

                        If you want to override how the master determines when to declare a low battery condition, see the section on "ignorelb" in the ups.conf man page.

                        1 Reply Last reply Reply Quote 0
                        • B
                          bdf0506
                          last edited by

                          @bdf0506:

                          @dennypage:

                          I have. The power kill logic is gone from the base os level. Still searching to find out when and why.

                          Ah, interesting. Sounds like it isn't an issue with my specific setup and it is a bug affecting anyone trying to use that functionality in the NUT package. Looking forward to seeing a fix for this whenever one can be found.

                          Hi, I wanted to see if there has been any progress on fixing this issue? Thanks.

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

                            @bdf0506:

                            Hi, I wanted to see if there has been any progress on fixing this issue? Thanks.

                            Still working on it. Progress, but not ready for release yet. Should be this month.

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

                              @bulldog5:

                              @dennypage:

                              @bulldog5:

                              I plugged the UPS into a 2K12 server and installed CPs PowerPanel software, let it run for few days and didn't get any LOWBATT messages, then plugged it into my FreeNAS server which is using driver 2.7.3, internal driver .39. and no LOWBATT messages.

                              So, something is not the same after the upgrade on pfsense because i dont see the LOWBATT message on 2 other boxes.  Going to try mirroring the freenas NUT configs, (being doubtful that will matter) then going to have to find some time to reinstall pfsense to 2.3.2 and go from there).

                              When you put it back on the pfSense box did the LOWBATT messages immediately return?

                              No

                              Bulldog, did your issue get resolved?

                              1 Reply Last reply Reply Quote 0
                              • C
                                cuco
                                last edited by

                                @dennypage:

                                I don't think you are doing anything wrong per se. By default, the nut slave (pfSense) isn't going to initiate a shutdown until the master server declares a low battery condition. This is different than a low battery warning.

                                When the master declares a low battery condition, it will send a notification to all the slaves indicating that there is a pending loss of power. The slaves will each disconnect from the master and then initiate their own shutdown. Once all the slaves have disconnected, the master will initiate its own shutdown.

                                If you want to override how the master determines when to declare a low battery condition, see the section on "ignorelb" in the ups.conf man page.

                                After doing more research I found out, that not only my pfSense-Box wasn't shutting down. It was just the first one I tried. So there seemed to be a problem inside of nut, not inside of your plugin.

                                So I did more research, did deeper looks into the code and found a bug in the nut-driver. Posted the issue on GitHub: https://github.com/networkupstools/nut/issues/460 then I fixed it: https://github.com/networkupstools/nut/pull/461/commits/b82b9cf3b4695f3171b6250af431a6a3f7fc81c4 and did a pull request: https://github.com/networkupstools/nut/pull/461
                                It then has been reviewed and merged into nut https://github.com/networkupstools/nut/commit/bc6ca11be42281e6d7f36dc6cf2860c2fe950f66

                                And now my problem is gone :) So: You were right, I wasn't doing anything wrong per se.

                                But thank you for your hint with "ignorelb" as this will help me with another problem when using apcupsd and nut at the same time :)

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

                                  @cuco:

                                  So I did more research, did deeper looks into the code and found a bug in the nut-driver. Posted the issue on GitHub: https://github.com/networkupstools/nut/issues/460 then I fixed it: https://github.com/networkupstools/nut/pull/461/commits/b82b9cf3b4695f3171b6250af431a6a3f7fc81c4 and did a pull request: https://github.com/networkupstools/nut/pull/461
                                  It then has been reviewed and merged into nut https://github.com/networkupstools/nut/commit/bc6ca11be42281e6d7f36dc6cf2860c2fe950f66

                                  Awesome!

                                  1 Reply Last reply Reply Quote 0
                                  • B
                                    bulldog5
                                    last edited by

                                    @dennypage:

                                    @bulldog5:

                                    @dennypage:

                                    @bulldog5:

                                    I plugged the UPS into a 2K12 server and installed CPs PowerPanel software, let it run for few days and didn't get any LOWBATT messages, then plugged it into my FreeNAS server which is using driver 2.7.3, internal driver .39. and no LOWBATT messages.

                                    So, something is not the same after the upgrade on pfsense because i dont see the LOWBATT message on 2 other boxes.  Going to try mirroring the freenas NUT configs, (being doubtful that will matter) then going to have to find some time to reinstall pfsense to 2.3.2 and go from there).

                                    When you put it back on the pfSense box did the LOWBATT messages immediately return?

                                    No

                                    Bulldog, did your issue get resolved?

                                    Hi, it seems that adjusting the following has kept it quiet. Thanks again.
                                    battery.charge.low: 20
                                    battery.charge.warning: 25

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

                                      @bulldog5:

                                      Hi, it seems that adjusting the following has kept it quiet. Thanks again.
                                      battery.charge.low: 20
                                      battery.charge.warning: 25

                                      Cool. You are quite welcome. Thanks for letting me know.

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

                                        Just FYI, the PR for the dummy driver has gone in. The shutdown issue will have to be addressed in a follow-on release. This issue will need an enhancement in the core so it may have to wait until 2.4 is release.

                                        1 Reply Last reply Reply Quote 0
                                        • W
                                          wishyou
                                          last edited by

                                          @dennypage:

                                          I have. The power kill logic is gone from the base os level. Still searching to find out when and why.

                                          Being a long time NUT user with pfSense this made me curious. Is this a new problem recently?
                                          I've been adding stuff to rc.shutdown for "ages" to get proper shutdown-killpower-restart loops with a couple of APC serial ups-es:

                                          
                                          #Final shutdown stuff, UPS
                                          if /usr/local/sbin/upsmon -K; then
                                          
                                              # Warning message
                                          	echo "POWERDOWNFLAG detected - Power cycling the UPS loads..."
                                          
                                              # Do shutdown
                                              /usr/local/sbin/upsdrvctl shutdown
                                          
                                              #Might be needed for power races
                                              # /bin/sleep 180
                                              # /sbin/reboot
                                          fi
                                          
                                          
                                          1 Reply Last reply Reply Quote 0
                                          • dennypageD
                                            dennypage
                                            last edited by

                                            The problem pre dates the current generation of the NUT package, but I'm not sure how far back it goes.

                                            What needs to be done is pretty much the same thing you are doing with your patch to rc.shutdown, except that I need to genericize it so that it can be used with other packages such as apcupsd.

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