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.1m 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.
    • K
      kevindd992002
      last edited by

      I think I really need to implement the Ups.delay.start now. Where do you put it though? I tried putting in the extra arguments to driver section and the service won't start afterwards.

      1 Reply Last reply Reply Quote 0
      • K
        kevindd992002
        last edited by kevindd992002

        output of upsrw ups:

        [outlet.desc]
        Outlet description
        Type: STRING
        Maximum length: 20
        Value: Main Outlet
        
        [output.voltage.nominal]
        Nominal output voltage (V)
        Type: ENUM
        Option: "200"
        Option: "208"
        Option: "220"
        Option: "230" SELECTED
        Option: "240"
        
        [ups.delay.shutdown]
        Interval to wait after shutdown with delay command (seconds)
        Type: STRING
        Maximum length: 10
        Value: 20
        
        [ups.start.battery]
        Allow to start UPS from battery
        Type: STRING
        Maximum length: 5
        Value: yes
        
        

        So does that mean that the ups.delay.start variable is not available for my ups? If so, any other idea how to get around the issue then?

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

          @kevindd992002 said in NUT package:

          I wanted to specifically understand the 12:27:59 AM event though and I hope you can share your ideas too. If I understand correctly, they're saying that when a UPS comes back on after a power blackout and is still in charging/low battery mode, the NAS detects that low battery condition and will go to a 2nd safe shutdown mode even though there is no FSD signal sent by NUT? If so, then that really isn't good.

          This makes good sense to me. A low battery condition indicates that power could be removed at any time. In general, you don't want the system to be attempting recovery of RAID in a situation such as this.

          On a separate note, you have some disk issues as well. I'm not sure it's a good choice to dismiss discard Synology's advice so casually. If you want a stable NAS, you should stick with enterprise drives. This is one of those "you get what you pay for" situations.

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

            @kevindd992002 said in NUT package:

            So does that mean that the ups.delay.start variable is not available for my ups? If so, any other idea how to get around the issue then?

            It's not available via NUT. It could be controllable via some other method on your UPS.

            That your UPS is restarting while still having a low battery is somewhat problematic. You may wish to discuss this with the UPS manufacturer.

            1 Reply Last reply Reply Quote 0
            • ?
              A Former User
              last edited by

              Failed to install nut on my SG-3100 today due to net-snmp can't make temp file.

              >>> Installing pfSense-pkg-nut... 
              Updating pfSense-core repository catalogue...
              pfSense-core repository is up to date.
              Updating pfSense repository catalogue...
              pfSense repository is up to date.
              All repositories are up to date.
              Checking integrity... done (0 conflicting)
              The following 4 package(s) will be affected (of 0 checked):
              
              New packages to be INSTALLED:
              	pfSense-pkg-nut: 2.7.4_7 [pfSense]
              	nut: 2.7.4_13 [pfSense]
              	neon: 0.30.2_4 [pfSense]
              	net-snmp: 5.7.3_20,1 [pfSense]
              
              Number of packages to be installed: 4
              
              The process will require 15 MiB more space.
              [1/4] Installing neon-0.30.2_4...
              [1/4] Extracting neon-0.30.2_4: .......... done
              [2/4] Installing net-snmp-5.7.3_20,1...
              [2/4] Extracting net-snmp-5.7.3_20,1: ......
              pkg-static: Fail to create temporary file: /usr/local/lib/perl5/site_perl/mach/5.30/.SNMP.pm.DbwkOhQlQnQU:Input/output error
              [2/4] Extracting net-snmp-5.7.3_20,1... done
              Failed
              
              dennypageD 1 Reply Last reply Reply Quote 0
              • dennypageD
                dennypage @A Former User
                last edited by

                @sauce That looks like a generic package install problem, failing during install of net-snmp. You might re-try the install, perhaps following a reboot, and if it fails again follow up in the general pfSense packages forum.

                ? 1 Reply Last reply Reply Quote 0
                • ?
                  A Former User @dennypage
                  last edited by

                  @dennypage rebooting pfsense fix the installation of nut . Thank you for your help.

                  1 Reply Last reply Reply Quote 0
                  • S
                    Sir_SSV
                    last edited by Sir_SSV

                    I'm having a bit of a problem with nut and pfSense.

                    I want to have pfSense shut down when low battery is at 30%. I tried at the default 20% (Eaton 5px) and I found it just did not leave enough time for pfSense to gracefully shut down.

                    I have configured nut as per below:

                    nut.png

                    However, in my logs I get the error "dstate_setflags: base variable (battery.charge.low) is immutable". It is literally flooding my system logs.

                    Am I doing something wrong? Nut seems to ignore the ignorelb command and is still waiting until low battery gets to 20% (as reported by the ups).

                    I have also placed the below arguments in the ups.conf section to no avail. However, there were no error messages in the system logs.

                    community = private
                    ignorelb
                    override.battery.charge.low = 30

                    I'm guessing I am doing something wrong but can't work it out. If it helps I am running an Eaton 5px with network-ms card

                    GertjanG dennypageD 2 Replies Last reply Reply Quote 0
                    • GertjanG
                      Gertjan @Sir_SSV
                      last edited by

                      @Sir_SSV said in NUT package:

                      20 % - it just did not leave enough time for pfSense to gracefully shut down.

                      pfSense shuts down relatively fast.
                      "20 %" should leave you with 30 seconds or so, probably far more.
                      If non, the battery isn't in good shape. Or the UPS overloaded. Which decreases battery life / shape.

                      I advise you to check out the NUT support forum.

                      No "help me" PM's please. Use the forum, the community will thank you.
                      Edit : and where are the logs ??

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

                        @Sir_SSV Few quick comments

                        The "ignorelb" option literally means that you want to ignore a low battery condition signaled by the UPS. Unless your UPS sends a low battery indication immediately upon going to battery, this probably isn't something you want.

                        battery.charge.low is a value managed in the UPS. You are trying to set it, and don't have SNMP privs to do so. This probably isn't something you want either.

                        SNMP is polled at 30 seconds. This means there is an up to 30 second delay before nut knows it is on battery, and up to 30 seconds before nut knows that the battery is low.

                        In general, if you want to shut down sooner it's better to look at runtime remaining than battery charge.

                        1 Reply Last reply Reply Quote 0
                        • S
                          Sir_SSV @Gertjan
                          last edited by Sir_SSV

                          @Gertjan said in NUT package:

                          @Sir_SSV said in NUT package:

                          20 % - it just did not leave enough time for pfSense to gracefully shut down.

                          pfSense shuts down relatively fast.
                          "20 %" should leave you with 30 seconds or so, probably far more.
                          If non, the battery isn't in good shape. Or the UPS overloaded. Which decreases battery life / shape.

                          I advise you to check out the NUT support forum.

                          The ups is new, only had it for approx 1 month. It is not overloaded, have pfSense, freenas and a couple unifi switches.

                          @dennypage said in NUT package:

                          @Sir_SSV Few quick comments

                          The "ignorelb" option literally means that you want to ignore a low battery condition signaled by the UPS. Unless your UPS sends a low battery indication immediately upon going to battery, this probably isn't something you want.

                          battery.charge.low is a value managed in the UPS. You are trying to set it, and don't have SNMP privs to do so. This probably isn't something you want either.

                          SNMP is polled at 30 seconds. This means there is an up to 30 second delay before nut knows it is on battery, and up to 30 seconds before nut knows that the battery is low.

                          In general, if you want to shut down sooner it's better to look at runtime remaining than battery charge.

                          Thanks. Should I set the default polling time to a lower value?

                          How would I go about setting a runtime remaining configuration in nut?

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

                            @Sir_SSV said in NUT package:

                            Should I set the default polling time to a lower value?

                            How would I go about setting a runtime remaining configuration in nut?

                            As to the NUT config, it all depends upon how much runtime the UPS has in general, and how much runtime is remaining when the UPS signals a low battery situation. If the UPS has 3 or more minutes of runtime when entering low battery, I would simply let the UPS handle things. If it has less, you may want to shorten the pollfreq.

                            Given that you have a snmp management card, you likely have a good deal of configuration available in the UPS to control when low battery state is entered. The UPS is generally a better place to drive decisions than in the NUT configuration.

                            1 Reply Last reply Reply Quote 0
                            • Q
                              q54e3w
                              last edited by

                              I recall my Eaton 5PX throw OB (on battery) and LB (low battery) at the same time, even with a large runtime remaining. In your UPS configuration you can configure the shutdown timers as Denny mentioned. Heres my 5px shutdown parameters.

                              If at 20% your UPS is failing to shutdown pfSense its likely your batteries are toast. Even new UPS can sit on shelves for sometime so worth testing before putting into production use.

                              5pxshutdown.png

                              S 1 Reply Last reply Reply Quote 1
                              • S
                                Sir_SSV @q54e3w
                                last edited by

                                @q54e3w said in NUT package:

                                I recall my Eaton 5PX throw OB (on battery) and LB (low battery) at the same time, even with a large runtime remaining. In your UPS configuration you can configure the shutdown timers as Denny mentioned. Heres my 5px shutdown parameters.

                                If at 20% your UPS is failing to shutdown pfSense its likely your batteries are toast. Even new UPS can sit on shelves for sometime so worth testing before putting into production use.

                                5pxshutdown.png

                                Thank you for the screen shot.

                                Under on battery, the values of 1800 seconds and 20% does that mean both of those values have to be met before the ups Initiated a shuts down?

                                If I wanted pfSense to shut down at 30% battery, would I pull the mains and see time remaining at 30% and input that value in to remaining time and shut down duration?

                                Q 1 Reply Last reply Reply Quote 0
                                • Q
                                  q54e3w @Sir_SSV
                                  last edited by q54e3w

                                  @Sir_SSV Been quite some time since I set this up so memory may be fuzzy but i recall its a 'OR' not 'AND'. You could stick 30% in percentage field and a small number in the time and it should shutdown (or flag LB & OB) at 30%.
                                  Set it to 95% or something to test with to save running batteries up and down.

                                  EDIT: I just checked the manual and TL;DR

                                  The first shutdown criteria initiates the restart of the shutdown sequence.

                                  • If remaining time is under (0 to 99999 seconds, 180 by default) is the minimum remaining backup time
                                    from which the shutdown sequence is launched.
                                  • If battery capacity is under (0 to 100%); this value cannot be less than that of the UPS and is the
                                    minimum remaining battery capacity level from which the shutdown sequence is launched.
                                  • Shutdown after (0 to 99999 minutes, not validated by default) is the operating time in minutes left for
                                    users after a switch to backup before starting the shutdown sequence.
                                  • Shutdown duration (120 seconds by default) is the time required for complete shutdown of systems
                                    when a switch to backup time is long enough to trigger the shutdown sequences. It is calculated
                                    automatically at the maximum of Shutdown duration of subscribed clients but can be modified in the
                                    Advanced mode.
                                  • If battery capacity exceeds Minimum battery level to reach before restarting the UPS after utility
                                    restoration
                                  S 1 Reply Last reply Reply Quote 1
                                  • S
                                    Sir_SSV @q54e3w
                                    last edited by

                                    @q54e3w said in NUT package:

                                    @Sir_SSV Been quite some time since I set this up so memory may be fuzzy but i recall its a 'OR' not 'AND'. You could stick 30% in percentage field and a small number in the time and it should shutdown (or flag LB & OB) at 30%.
                                    Set it to 95% or something to test with to save running batteries up and down.

                                    EDIT: I just checked the manual and TL;DR

                                    The first shutdown criteria initiates the restart of the shutdown sequence.

                                    • If remaining time is under (0 to 99999 seconds, 180 by default) is the minimum remaining backup time
                                      from which the shutdown sequence is launched.
                                    • If battery capacity is under (0 to 100%); this value cannot be less than that of the UPS and is the
                                      minimum remaining battery capacity level from which the shutdown sequence is launched.
                                    • Shutdown after (0 to 99999 minutes, not validated by default) is the operating time in minutes left for
                                      users after a switch to backup before starting the shutdown sequence.
                                    • Shutdown duration (120 seconds by default) is the time required for complete shutdown of systems
                                      when a switch to backup time is long enough to trigger the shutdown sequences. It is calculated
                                      automatically at the maximum of Shutdown duration of subscribed clients but can be modified in the
                                      Advanced mode.
                                    • If battery capacity exceeds Minimum battery level to reach before restarting the UPS after utility
                                      restoration

                                    At the moment, FreeNAS shuts down after it has been on battery for 5 mins (configured via FreeNAS).

                                    I would like pfSense to shut down when battery is approx 30% and the ups to shut down when it hits the low battery state of 20%

                                    Will have to play with a few of these values. I read through the ussr manual prior but damn it confused me!

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

                                      @Sir_SSV said in NUT package:

                                      At the moment, FreeNAS shuts down after it has been on battery for 5 mins (configured via FreeNAS).

                                      I would like pfSense to shut down when battery is approx 30% and the ups to shut down when it hits the low battery state of 20%

                                      Staggering shutdowns like this may not be what you want. The problem comes when a system has initiated shutdown, but the mains return before the UPS enters a low battery state. Without a low battery state, the UPS will not cut / restore the load, and there will be nothing to trigger a restart of the system. It’s often better to configure the UPS and then let it manage shutdown.

                                      S 1 Reply Last reply Reply Quote 0
                                      • S
                                        Sir_SSV @dennypage
                                        last edited by

                                        @dennypage said in NUT package:

                                        @Sir_SSV said in NUT package:

                                        At the moment, FreeNAS shuts down after it has been on battery for 5 mins (configured via FreeNAS).

                                        I would like pfSense to shut down when battery is approx 30% and the ups to shut down when it hits the low battery state of 20%

                                        Staggering shutdowns like this may not be what you want. The problem comes when a system has initiated shutdown, but the mains return before the UPS enters a low battery state. Without a low battery state, the UPS will not cut / restore the load, and there will be nothing to trigger a restart of the system. It’s often better to configure the UPS and then let it manage shutdown.

                                        During my testing over the weekend, this is what I noticed.

                                        I have since scheduled a shut down of both FreeNAS and pfSense close to the low battery of the ups (20%).

                                        1 Reply Last reply Reply Quote 0
                                        • S
                                          Sir_SSV
                                          last edited by

                                          I'm having a bit of trouble with the nut daemon starting when pfSense restarts from a complete shut down.

                                          I found an earlier post and tried entering the below:

                                          Extra arguments:
                                          snmp_retries = 10
                                          snmp_timeout = 2

                                          Get the error in System Logs

                                          Poll UPS [Eaton] failed - Driver not connected

                                          Removed the above Extra Arguments and entered the below:

                                          ups.conf:
                                          retrydelay = 30
                                          maxretry = 20

                                          Get the error in System Logs

                                          Data for UPS [Eaton] is stale - check driver
                                          UPS [Eaton] data is no longer stale

                                          and it repeats the above error constantly until the service is stopped/restarted.

                                          Once pfSense starts, if I manually stop and restart the service everything works ok!

                                          Is there something I am doing incorrectly?

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

                                            @Sir_SSV Please see posts here and here

                                            Make sure that the UPS is configured to use a static IP address, and that you are addressing the UPS by IP address and not by DNS name.

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