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.2m 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.
    • Q
      q54e3w
      last edited by

      My pfsense server is running NUT package and I also have a separate ESXi host with NUT installed. I want to shut down the VMs and the ESXI host before pfsense shutdowns to ensure network services remain up to prevent problems closing down the VMs cleanly. How can I delay pfsense powering down until esxi has completed shutting down?
      I have a APC SMX UPS attached via AP9631 network card.

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

        @q54e3w:

        How can I delay pfsense powering down until esxi has completed shutting down?

        The HOSTSYNC variable controls how long the master will wait for slaves to initiate their shutdown. You can find information on this in the ups.conf man page.

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

          Thank you - I'll give it a try.

          I've noticed the following errors appearing in my logs, any idea why this would be?

          
          ...
          Feb 18 11:01:52	snmp-ups	44002	dstate_setflags: base variable (battery.runtime.low) is immutable
          Feb 18 11:01:20	snmp-ups	44002	dstate_setflags: base variable (battery.runtime.low) is immutable
          Feb 18 11:00:48	snmp-ups	44002	dstate_setflags: base variable (battery.runtime.low) is immutable
          ...
          
          

          I have the following code

          extra arguments

          
          ignorelb
          override.battery.charge.warning = 50
          override.battery.charge.low = 30
          override.battery.runtime.low = 1200
          
          

          upsmon.conf

          
          HOSTSYNC 600
          
          

          upsd.conf

          
          LISTEN 192.168.10.1
          
          

          upsd.users

          
          [remoteuser]
          password = mypassword
          upsmon slave
          
          

          the settings appear to be being applied correctly….

          
          upsc ups@localhost
          ambient.1.humidity.alarm.high: 60.00
          ambient.1.humidity.alarm.low: 30.00
          ambient.1.temperature.alarm.high: 40.00
          ambient.1.temperature.alarm.low: 10.00
          ambient.humidity: 39.00
          ambient.temperature: 15.0
          battery.charge: 100.00
          battery.charge.low: 30
          battery.charge.warning: 50
          battery.date: 11/15/2017
          battery.packs: 1.00
          battery.runtime: 4428.00
          battery.runtime.low: 1200
          battery.voltage: 54.20
          device.mfr: APC
          device.model: Smart-UPS X 1500
          device.type: ups
          driver.flag.ignorelb: enabled
          driver.name: snmp-ups
          driver.parameter.pollinterval: 2
          driver.parameter.port: 192.168.10.50
          driver.parameter.synchronous: no
          driver.version: 2.7.4
          driver.version.data: apcc MIB 1.2
          driver.version.internal: 0.97
          input.frequency: 60.00
          input.sensitivity: high
          input.transfer.high: 127
          input.transfer.low: 106
          input.transfer.reason: selfTest
          input.voltage: 122.20
          input.voltage.maximum: 123.20
          input.voltage.minimum: 121.30
          output.current: 4.80
          output.frequency: 60.00
          output.voltage: 122.20
          output.voltage.nominal: 120
          ups.delay.shutdown: 20
          ups.delay.start: 10
          ups.firmware: UPS 09.1 (ID20)
          ups.id: UPS
          ups.load: 48.30
          ups.mfr: APC
          ups.mfr.date: 06/30/2012
          ups.model: Smart-UPS X 1500
          ups.status: OL
          ups.temperature: 18.60
          ups.test.date: 02/14/2018
          ups.test.result: Ok
          
          1 Reply Last reply Reply Quote 0
          • dennypageD
            dennypage
            last edited by

            @q54e3w:

            Thank you - I'll give it a try.

            I've noticed the following errors appearing in my logs, any idea why this would be?

            
            ...
            Feb 18 11:01:52	snmp-ups	44002	dstate_setflags: base variable (battery.runtime.low) is immutable
            Feb 18 11:01:20	snmp-ups	44002	dstate_setflags: base variable (battery.runtime.low) is immutable
            Feb 18 11:00:48	snmp-ups	44002	dstate_setflags: base variable (battery.runtime.low) is immutable
            ...
            
            

            I believe it means that the variable is marked read-only in the SNMP MIB. For more information on this, I would suggest checking the nut users list.

            FWIW, if it were me I would just remove the setting of runtime and use charge %. You don’t need both.

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

              pfsense 2.4.2-RELEASE-p1 (amd64)
              nut 2.7.4_5

              Polling an APC AP9631 on the LAN via SNMP.

              When I reboot the appliance, UPS status shows as down. Log has a bunch of these:

              Feb 19 21:40:27 upsmon 66529 Poll UPS [office-UPS] failed - Driver not connected
              Feb 19 21:42:22 upsmon 67668 Startup successful
              Feb 19 21:42:23 upsd 68233 listening on ::1 port 3493
              Feb 19 21:42:23 upsd 68233 listening on 127.0.0.1 port 3493
              Feb 19 21:42:23 upsd 68233 Can't connect to UPS [office-UPS] (snmp-ups-office-UPS): No such file or directory
              Feb 19 21:42:23 upsd 68498 Startup successful
              Feb 19 21:42:24 snmp-ups 68710 Startup successful

              Now when I go to restart the service via the GUI In Services -> UPS, it starts up perfectly right away.

              apcupsd was installed but I removed it when switching to NUT.

              I tried using snmp v1 instead of v3 thinking I screwed up my v3 credentials but that doesn't seem to be the issue. Even with snmpv1 it wont come up after a reboot until I manually intervene.

              I tried some of the retry and delay parameters in the additional parameters for ups.conf but they also didn't help with this

              
              maxretry=3
              retrydelay=10
              pollinterval=5
              snmp_retries=10
              snmp_timeout=2
              pollfreq=10
              
              1 Reply Last reply Reply Quote 0
              • dennypageD
                dennypage
                last edited by

                Please give the following a try:

                Get rid of pollfreq and pollinterval.

                Set these variables in the Extra Arguments to driver section:

                
                snmp_timeout=2
                snmp_retries=10
                
                

                Set these variables in the Advanced section for ups.conf:

                
                retrydelay=30
                maxretry=20
                
                

                Now reboot the box. When the box comes up, go to the UPS status page. [Do not attempt to start the service manually] If the UPS shows as needing attention, wait for the page to refresh automatically. If it doesn't auto refresh, after a couple minutes refresh the page manually. Does the UPS show as running? Or is it still down?

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

                  @dennypage:

                  Please give the following a try:

                  Get rid of pollfreq and pollinterval.

                  Set these variables in the Extra Arguments to driver section:

                  
                  snmp_timeout=2
                  snmp_retries=10
                  
                  

                  Set these variables in the Advanced section for ups.conf:

                  
                  retrydelay=30
                  maxretry=20
                  
                  

                  Now reboot the box. When the box comes up, go to the UPS status page. [Do not attempt to start the service manually] If the UPS shows as needing attention, wait for the page to refresh automatically. If it doesn't auto refresh, after a couple minutes refresh the page manually. Does the UPS show as running? Or is it still down?

                  These settings work perfectly!

                  I am now back on SNMPv3 and NUT is performing as expected, across reboots and all. Thank you!

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

                    That's good news. Now that it's working, you can probably tune the variables down quite a bit. In particular, the settings in Extra Arguments can likely be returned to their default values of 1 & 5. Or simply deleted.

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

                      @dennypage:

                      That's good news. Now that it's working, you can probably tune the variables down quite a bit. In particular, the settings in Extra Arguments can likely be returned to their default values of 1 & 5. Or simply deleted.

                      I think actually found a bug (with the AP9631, fw 6.5.0).

                      I just deployed a second AP9631 out of the box. Factory reset, flashed 6.5.0, factory reset again, set up SNMPv3 and had the same issues I described before where NUT cannot communicate.

                      I have now noticed that if I have SNMPv1 DISABLED, NUT will fail to connect via SNMPv3 no matter what extra settings I provide. Simply turning on SNMPv1 in the AP9631 (fw 6.5.0) immediately lets them communicate. Very strange. Further testing is needed.

                      I have replicated this on the previous installation where I can break the SNMPv3 communication between NUT and the AP9631 by disabling SNMPv1, don't even need to reboot.

                      this_fixes_it.JPG
                      this_fixes_it.JPG_thumb
                      this_breaks_it.JPG
                      this_breaks_it.JPG_thumb

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

                        @spambait:

                        I just deployed a second AP9631 out of the box. Factory reset, flashed 6.5.0, factory reset again, set up SNMPv3 and had the same issues I described before where NUT cannot communicate.

                        I have now noticed that if I have SNMPv1 DISABLED, NUT will fail to connect via SNMPv3 no matter what extra settings I provide. Simply turning on SNMPv1 in the AP9631 (fw 6.5.0) immediately lets them communicate. Very strange. Further testing is needed.

                        I have replicated this on the previous installation where I can break the SNMPv3 communication between NUT and the AP9631 by disabling SNMPv1, don't even need to reboot.

                        It sounds like SNMPv3 may not be properly configured/functioning in NUT. Can you post the contents of /usr/local/etc/nut/ups.conf please?

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

                          @dennypage:

                          It sounds like SNMPv3 may not be properly configured/functioning in NUT. Can you post the contents of /usr/local/etc/nut/ups.conf please?

                          I am going to find an SNMPv3 client and try replicate this in a moment. If a different v3 client fails in the same way the issue is with AP9631.

                          If it doesn't then there may indeed be a NUT issue. Maybe it has some routine to check SNMPv1 availability before anything else, even if only SNMPv3 is needed.

                          I realize the credentials are in there but it's a sandbox setup so this is not really a concern. My full, unedited /usr/local/etc/nut/ups.conf:

                          retrydelay=30
                          maxretry=20
                          snmp_version=v3
                          privProtocol=AES
                          authProtocol=SHA
                          secName=pfSense
                          authPassword=VtwHzSj6XQlmp9OFFa28NJcUL93qq5zZ4
                          privPassword=TpWsICXWm4CeKtwUehtvcBpDnBW0KZCC
                          
                          [S10-AP9631]
                          driver=snmp-ups
                          port=172.16.10.5
                          snmp_timeout=2
                          snmp_retries=10
                          
                          1 Reply Last reply Reply Quote 0
                          • dennypageD
                            dennypage
                            last edited by

                            SNMP parameters are part of the UPS specification. As such, they go in the "Extra Arguments to driver" rather than in the "Additional configuration lines for ups.conf" section. The advanced section is only for Global Directives (see ups.conf), and anything that is not recognized as a global directive is ignored by NUT. I know it's confusing, but it's how NUT's configuration works. Anything that comes from the driver man page (snmp-ups in your case) goes into Extra Arguments to driver.

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

                              @dennypage:

                              SNMP parameters are part of the UPS specification. As such, they go in the "Extra Arguments to driver" rather than in the "Additional configuration lines for ups.conf" section. The advanced section is only for Global Directives (see ups.conf), and anything that is not recognized as a global directive is ignored by NUT. I know it's confusing, but it's how NUT's configuration works. Anything that comes from the driver man page (snmp-ups in your case) goes into Extra Arguments to driver.

                              That results in

                              
                              [S10-AP9631]
                              driver=snmp-ups
                              port=172.16.10.5
                              snmp_timeout=2
                              snmp_retries=10
                              snmp_version=v3
                              privProtocol=AES
                              authProtocol=SHA
                              secLevel=authPriv
                              secName=pfSense
                              authPassword=VtwHzSj6XQlmp9OFFa28NJcUL93qq5zZ4
                              privPassword=TpWsICXWm4CeKtwUehtvcBpDnBW0KZCC
                              

                              Edit: So it seems it was using SNMPv1 all along due to my mis-configuration resulting in the SNMPv3 stuff being ignored. There is no bug. Now that I have the correct structure in ups.conf it is indeed trying to connect SNMPv3 but it is not authenticating. The AP9631's built in baby IDS keeps sending me notifications now that there are failed SNMPv3 authentications from the pfSense IP.

                              I will switch her back to SNMPv1 for now and troubleshoot my SNMPv3 setup with qtmib

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

                                That makes sense. For what it's worth, most people use a read-only SNMPv1 group for UPS monitoring. There isn't any sensitive information in the stream.

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

                                  @dennypage:

                                  That makes sense. For what it's worth, most people use a read-only SNMPv1 group for UPS monitoring. There isn't any sensitive information in the stream.

                                  The docu said a write community is needed to facilitate shutdowns. I wanted the UPS and NUT to coordinate that NUT will shut down pfSense when there's not much runtime left and then tell the UPS to shut off the outlet in x minutes and come back up when AC power is restored and battery has at least y % charge.

                                  Otherwise pfSense will just shut down and stay down until someone presses the power button or the BIOS power on time is reached.

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

                                    @spambait:

                                    The docu said a write community is needed to facilitate shutdowns. I wanted the UPS and NUT to coordinate that NUT will shut down pfSense when there's not much runtime left and then tell the UPS to shut off the outlet in x minutes and come back up when AC power is restored and battery has at least y % charge.

                                    Ah, yes. Needing write permission to kill power makes sense. Note that the pfSense NUT package version 2.7.4_5 does not support issuing the final power kill order. This will come with NUT package 2.7.4_6 which requires pfSense 2.4.3.

                                    1 Reply Last reply Reply Quote 0
                                    • xx_robot_xxX
                                      xx_robot_xx
                                      last edited by

                                      Hello,

                                      How do you configure power-kill after shutdown? I have pfsense 2.4.3 and latest version of nut..

                                      pfSense Newbie

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

                                        Power kill is enabled automatically with pfSense 2.4.3 and 2.7.4_6 of the NUT package. No configuration necessary.

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

                                          Hello,

                                          I have a TrippLite Smart 1300VA unit connected via USB.  dmesg does show it connected.  This model is also one listed in NUT to use the USB driver (not the legacy TrippLite driver).  I got readings from it very briefly last night when setting it up, but also a bunch of messages in the log about the data being stale.  This was on pfSense 2.4.1.

                                          Now it doesn't work at all.  I upgraded to the latest NUT package.  No dice.  I upgraded pfSense to 2.4.3… no dice.

                                          All I get is this in the status logs:
                                          Apr 4 14:57:20 upsd 97125 User monuser@::1 logged into UPS [main]
                                          Apr 4 14:57:20 upsmon 60509 Poll UPS [main] failed - Driver not connected
                                          Apr 4 14:57:20 upsmon 60509 Communications with UPS main lost
                                          Apr 4 14:57:25 upsmon 60509 Poll UPS [main] failed - Driver not connected
                                          Apr 4 14:57:25 upsmon 60509 UPS main is unavailable
                                          Apr 4 14:57:30 upsmon 60509 Poll UPS [main] failed - Driver not connected
                                          Apr 4 14:57:35 upsmon 60509 Poll UPS [main] failed - Driver not connected

                                          Like I said, system sees it, here's the USB stuff pulled from dmesg:
                                          dmesg | grep usb
                                          usbus0: EHCI version 1.0
                                          usbus0 on ehci0
                                          usbus0: 480Mbps High Speed USB v2.0
                                          usbus1: EHCI version 1.0
                                          usbus1 on ehci1
                                          usbus1: 480Mbps High Speed USB v2.0
                                          ugen0.1: <intel ehci="" root="" hub="">at usbus0
                                          ugen1.1: <intel ehci="" root="" hub="">at usbus1
                                          uhub0: <intel 1="" 9="" ehci="" root="" hub,="" class="" 0,="" rev="" 2.00="" 1.00,="" addr="">on usbus0
                                          uhub1: <intel 1="" 9="" ehci="" root="" hub,="" class="" 0,="" rev="" 2.00="" 1.00,="" addr="">on usbus1
                                          ugen1.2: <vendor 0x8087="" product="" 0x0024="">at usbus1
                                          uhub2: <vendor 2="" 9="" 0x8087="" product="" 0x0024,="" class="" 0,="" rev="" 2.00="" 0.00,="" addr="">on usbus1
                                          ugen0.2: <vendor 0x8087="" product="" 0x0024="">at usbus0
                                          uhub3: <vendor 2="" 9="" 0x8087="" product="" 0x0024,="" class="" 0,="" rev="" 2.00="" 0.00,="" addr="">on usbus0
                                          ugen0.3: <tripp lite="" tripp="" ups="">at usbus0
                                          uhid0: <tripp 0="" 3="" lite="" tripp="" ups,="" class="" 0,="" rev="" 1.10="" 0.02,="" addr="">on usbus0
                                          usbus0: EHCI version 1.0
                                          usbus0 on ehci0
                                          usbus0: 480Mbps High Speed USB v2.0
                                          usbus1: EHCI version 1.0
                                          usbus1 on ehci1
                                          usbus1: 480Mbps High Speed USB v2.0
                                          ugen1.1: <intel ehci="" root="" hub="">at usbus1
                                          ugen0.1: <intel ehci="" root="" hub="">at usbus0
                                          uhub0: <intel 1="" 9="" ehci="" root="" hub,="" class="" 0,="" rev="" 2.00="" 1.00,="" addr="">on usbus1
                                          uhub1: <intel 1="" 9="" ehci="" root="" hub,="" class="" 0,="" rev="" 2.00="" 1.00,="" addr="">on usbus0
                                          ugen0.2: <vendor 0x8087="" product="" 0x0024="">at usbus0
                                          uhub2: <vendor 2="" 9="" 0x8087="" product="" 0x0024,="" class="" 0,="" rev="" 2.00="" 0.00,="" addr="">on usbus0
                                          ugen1.2: <vendor 0x8087="" product="" 0x0024="">at usbus1
                                          uhub3: <vendor 2="" 9="" 0x8087="" product="" 0x0024,="" class="" 0,="" rev="" 2.00="" 0.00,="" addr="">on usbus1
                                          ugen0.3: <vendor 0x09ae="" product="" 0x3016="">at usbus0
                                          uhid0: <vendor 0="" 3="" 0x09ae="" product="" 0x3016,="" class="" 0,="" rev="" 1.10="" 0.02,="" addr="">on usbus0
                                          usbus0: EHCI version 1.0
                                          usbus0 on ehci0
                                          usbus0: 480Mbps High Speed USB v2.0
                                          usbus1: EHCI version 1.0
                                          usbus1 on ehci1
                                          usbus1: 480Mbps High Speed USB v2.0
                                          ugen1.1: <intel ehci="" root="" hub="">at usbus1
                                          ugen0.1: <intel ehci="" root="" hub="">at usbus0
                                          uhub0: <intel 1="" 9="" ehci="" root="" hub,="" class="" 0,="" rev="" 2.00="" 1.00,="" addr="">on usbus1
                                          uhub1: <intel 1="" 9="" ehci="" root="" hub,="" class="" 0,="" rev="" 2.00="" 1.00,="" addr="">on usbus0
                                          ugen1.2: <vendor 0x8087="" product="" 0x0024="">at usbus1
                                          uhub2: <vendor 2="" 9="" 0x8087="" product="" 0x0024,="" class="" 0,="" rev="" 2.00="" 0.00,="" addr="">on usbus1
                                          ugen0.2: <vendor 0x8087="" product="" 0x0024="">at usbus0
                                          uhub3: <vendor 2="" 9="" 0x8087="" product="" 0x0024,="" class="" 0,="" rev="" 2.00="" 0.00,="" addr="">on usbus0
                                          ugen0.3: <tripp lite="" tripp="" ups="">at usbus0
                                          uhid0: <tripp 0="" 3="" lite="" tripp="" ups,="" class="" 0,="" rev="" 1.10="" 0.02,="" addr="">on usbus0

                                          Anyone know how I can get this to work?
                                          pfSense has been rebooted twice now.  Once for the 2.4.3 upgrade.  And another time after I removed NUT package and reinstalled NUT package.  NUT is version 2.7.4_6.

                                          Thanks!</tripp></tripp></vendor></vendor></vendor></vendor></intel></intel></intel></intel></vendor></vendor></vendor></vendor></vendor></vendor></intel></intel></intel></intel></tripp></tripp></vendor></vendor></vendor></vendor></intel></intel></intel></intel>

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

                                            @kjstech:

                                            I have a TrippLite Smart 1300VA unit connected via USB.  dmesg does show it connected.  This model is also one listed in NUT to use the USB driver (not the legacy TrippLite driver).

                                            Please run "usbconfig dump_device_desc" and post the output. Also, can you post the contents of /usr/local/etc/nut/ups.conf please? And lastly, the exact model number of the UPS.

                                            Btw, where did you see the note about using the usbhid-ups vs. the tripplite_usb driver? I didn't find a Tripp Lite 1300VA model in the NUT HCL…

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