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.
    • M
      mattlach
      last edited by

      @dennypage:

      @mattlach:

      I thought it was broken at first, because I kept going to "Services -> NUT" and I kept getting an nginx error, didn't realize that it had moved to "Services -> UPS"

      Is there any way to remove the old "Services -> NUT" menu entry?  It seems stuck there.

      If you are comfortable editing the config file, you can remove the old menu section. It looks like this:

      <menu>
                              <name>NUT</name>
                              <tooltiptext>Set Network UPS Tools settings.</tooltiptext>
                             Services
                              <url>/ups_status.php</url>
                     </menu>

      Be very careful editing the config file, and back up the config first.

      Thank you,

      I have no problem editing xml config files (though the pfsense version of vi is awful), but where is the file?

      Or is it more appropriate to save a backup config to my workstation, edit the config, and then upload the edited version?

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

        @mattlach:

        I have no problem editing xml config files (though the pfsense version of vi is awful), but where is the file?

        Or is it more appropriate to save a backup config to my workstation, edit the config, and then upload the edited version?

        You can download/edit/upload if you are okay with a firewall reboot. Alternatively, you can ssh in and use viconfig.

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

          mattlach, did you get your issue resolved?

          1 Reply Last reply Reply Quote 0
          • L
            LinuxTracker
            last edited by

            Just a note I was getting "Driver not connected" errors that wouldn't go away until I rebooted.
            Works fine now.

            Backstory:
            After install, Nut picked up an old (and correct) config - Local USB & usbhid.

            It kept failing w/ the following errors:
            Poll UPS [APC] failed - Driver not connected
            Can't connect to UPS [APC] (usbhid-ups-APC): No such file or directory.

            I followed every suggestion here and other BSD (ie: NAS) threads.

            None of that helped but a reboot put everything right.
            I still appreciate everyone's input though.

            Below is just for ref:

            Original config:

                            <nut><config><type>local_usb</type>
                                            <name>APC</name>
                                            <email></email>
                                            <usb_driver>usbhid-ups</usb_driver>
                                            <upsmon_conf><extra_args></extra_args></upsmon_conf></config></nut> 
            
            

            Current (working) config:

            		 <nut><config><type>local_usb</type>
            				<name>APC</name>
            				<email></email>
            				<usb_driver>usbhid-ups</usb_driver>
            				<upsmon_conf>UlVOX0FTX1VTRVIgcm9vdA==</upsmon_conf>
            				 <extra_args></extra_args></config></nut> 
            
            

            2.3.2-RELEASE (amd64)
            Intel Xeon CPU X3430 @ 2.40GHz
            4GB RAM
            APC Back-UPS NS1250 (BN1250G)

            Output of usbconfig dump_device_desc

            ugen1.4: <back-ups bn1250g="" fw867.l5="" .d="" usb="" fwl5="" american="" power="" conversion="">at usbus1, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (2mA)
            
              bLength = 0x0012
              bDescriptorType = 0x0001
              bcdUSB = 0x0200
              bDeviceClass = 0x0000  <probed by="" interface="" class="">bDeviceSubClass = 0x0000
              bDeviceProtocol = 0x0000
              bMaxPacketSize0 = 0x0040
              idVendor = 0x051d
              idProduct = 0x0002
              bcdDevice = 0x0090
              iManufacturer = 0x0001  <american power="" conversion="">iProduct = 0x0002  <back-ups bn1250g="" fw:867.l5="" .d="" usb="" fw:l5="">iSerialNumber = 0x0003  <xxxxxxxxxxx >bNumConfigurations = 0x0001</xxxxxxxxxxx ></back-ups></american></probed></back-ups> 
            
            1 Reply Last reply Reply Quote 0
            • dennypageD
              dennypage
              last edited by

              @LinuxTracker:

              After install, Nut picked up an old (and correct) config - Local USB & usbhid.

              It kept failing w/ the following errors:
              Poll UPS [APC] failed - Driver not connected
              Can't connect to UPS [APC] (usbhid-ups-APC): No such file or directory.

              Original config:

                              <nut><config><type>local_usb</type>
                                              <name>APC</name>
                                              <email></email>
                                              <usb_driver>usbhid-ups</usb_driver>
                                              <upsmon_conf><extra_args></extra_args></upsmon_conf></config></nut> 
              
              

              Current (working) config:

              		 <nut><config><type>local_usb</type>
              				<name>APC</name>
              				<email></email>
              				<usb_driver>usbhid-ups</usb_driver>
              				<upsmon_conf>UlVOX0FTX1VTRVIgcm9vdA==</upsmon_conf>
              				 <extra_args></extra_args></config></nut> 
              
              

              Do you mean to say that you install a new version of the NUT package? Both configs you posted are are from the new version of the package. Neither is from the old package.

              From a UPS driver point of view, the two configs are identical. The addition of RUN_AS_USER in upsmon_conf has no effect on the driver (usbhid-ups). It's only use is have the monitor (upsmon) run as root in order to work around an issue sending email with a TLS connection, which you are not using. Unless you are planning to use email with a TLS connection, you should remove this directive.

              1 Reply Last reply Reply Quote 0
              • L
                LinuxTracker
                last edited by

                @dennypage:

                Do you mean to say that you install a new version of the NUT package? Both configs you posted are are from the new version of the package. Neither is from the old package.

                It went like this.
                I installed Nut from the package manager. After install, Nut said it found an old config and would use that.
                That's when I started getting the driver errors.  I did some poking around, checked out the Nut section of config.xml.  That's what I posted as my original config.

                Today, I went into a config.xml backup from June and the Nut config section there is in the older format.

                		 <nut><config><monitor><powerdown><allowaddr><allowuser>fakeuser</allowuser>
                				<allowpass>fakepass</allowpass>
                				<name>APC</name>
                				<driver>usbhid-ups00</driver>
                				<port>auto</port>
                				 <upstype><cable><snmpname><snmpaddr><snmpcommunity><snmpversion>v2c</snmpversion>
                				<snmpmib>ietf</snmpmib>
                				 <snmpfreq><snmpdisabletransfer><remotename><remoteaddr><remoteuser>fakeuser</remoteuser>
                				<remotepass>fakepass</remotepass></remoteaddr></remotename></snmpdisabletransfer></snmpfreq></snmpcommunity></snmpaddr></snmpname></cable></upstype></allowaddr></powerdown></monitor></config></nut> 
                
                

                I'm assuming the new ver of Nut rewrote my config, sometime after install.

                @dennypage:

                From a UPS driver point of view, the two configs are identical. The addition of RUN_AS_USER in upsmon_conf has no effect on the driver (usbhid-ups). It's only use is have the monitor (upsmon) run as root in order to work around an issue sending email with a TLS connection, which you are not using. Unless you are planning to use email with a TLS connection, you should remove this directive.

                Okay. I tried that after reading a github post about perm issues w/ Nut & was ready to throw spaghetti at the wall.
                (ref: https://github.com/rockstor/rockstor-core/issues/1073)

                I'll get rid of RUN_AS_USER.
                Thanks for the input.

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

                  @LinuxTracker:

                  After install, Nut said it found an old config and would use that.
                  …
                  I'm assuming the new ver of Nut rewrote my config, sometime after install.

                  It wrote the new config when you pressed the save button on the Settings page. This is also when the service starts.

                  1 Reply Last reply Reply Quote 0
                  • R
                    runjmc
                    last edited by

                    I noticed the APC UPS plugged in via USB seems to stay connected for a few days then shows up as offline. I can reload the service and still doesn't work but if I physically unplug it and plug it back it works again.

                    usbconfig dump_device_desc

                    Online

                    ugen0.4: <back-ups 1250="" ns="" lcd="" fw846.h2="" .d="" usb="" fwh2="" american="" power="" conversion="">at usbus0, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON (2mA)

                    bLength = 0x0012
                      bDescriptorType = 0x0001
                      bcdUSB = 0x0110
                      bDeviceClass = 0x0000  <probed by="" interface="" class="">bDeviceSubClass = 0x0000
                      bDeviceProtocol = 0x0000
                      bMaxPacketSize0 = 0x0008
                      idVendor = 0x051d
                      idProduct = 0x0002
                      bcdDevice = 0x0101
                      iManufacturer = 0x0003  <american power="" conversion="">iProduct = 0x0001  <back-ups 1250="" ns="" lcd="" fw:846.h2="" .d="" usb="" fw:h2="">iSerialNumber = 0x0002  <3B0902X11627  >
                      bNumConfigurations = 0x0001

                    Offline

                    ugen0.4: <back-ups 1250="" ns="" lcd="" fw846.h2="" .d="" usb="" fwh2="" american="" power="" conversion="">at usbus0, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON (2mA)

                    bLength = 0x0012
                      bDescriptorType = 0x0001
                      bcdUSB = 0x0110
                      bDeviceClass = 0x0000  <probed by="" interface="" class="">bDeviceSubClass = 0x0000
                      bDeviceProtocol = 0x0000
                      bMaxPacketSize0 = 0x0008
                      idVendor = 0x051d
                      idProduct = 0x0002
                      bcdDevice = 0x0101
                      iManufacturer = 0x0003  <retrieving string="" failed="">iProduct = 0x0001  <retrieving string="" failed="">iSerialNumber = 0x0002  <retrieving string="" failed="">bNumConfigurations = 0x0001</retrieving></retrieving></retrieving></probed></back-ups></back-ups></american></probed></back-ups>

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

                      Not sure what to tell you about this one. It sure looks like a USB connectivity issue. Is there a USB hub or anything you can remove? Another USB connector on the MB you can try? Another cable perhaps?

                      Yes, I'm shooting in the dark here. :)

                      1 Reply Last reply Reply Quote 0
                      • R
                        runjmc
                        last edited by

                        It could be a issue with vmware passthrough.. Ill try another port and see if I have the same issues with a windows vm.

                        Thanks

                        1 Reply Last reply Reply Quote 0
                        • F
                          frozensteel
                          last edited by

                          Hey Dennypage,

                          I just switched from an older server to a newer server.  Older server was running Pfsense 2.3.1 running a much older version of NUT.  Backed up the configuration file, installed Pfsense 2.3.2 and restored the configuration file.  I then installed the NUT package (Which is now 2.7.4_2) and now the service runs, and the UPS option is under the services menu, but the NUT option is still under the services menu.  Is this option supposed to work?  All it gives me is "404 Not Found nginx".  The UPS tab also doesn't have the fancy bar graphics the older NUT package has.  Is this supposed to be under the NUT tab?  How do I fix it?

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

                            I'm looking at how to automatically remove the old Services / NUT menu item. In the interim, this tells you how to do it manually:

                            https://forum.pfsense.org/index.php?topic=115349.msg650408#msg650408

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

                              @frozensteel:

                              The UPS tab also doesn't have the fancy bar graphics the older NUT package has.

                              Both the old and the new NUT package have the same two bar graphs, UPS Load and Battery charge.

                              In the new package, you will find them on the status page (Services / UPS / Status). This page also shows full detail of what is reported by the NUT driver for the UPS. There is also a UPS Status widget for the dashboard which provides a abbreviated status listing including the two bar graphs.

                              1 Reply Last reply Reply Quote 0
                              • F
                                frozensteel
                                last edited by

                                So I did what you said and removed the following:

                                
                                <menu>
                                
                                <menu>
                                			<name>NUT</name>
                                			<tooltiptext>Set Network UPS Tools settings.</tooltiptext>
                                			Services
                                			<url>/ups_status.php</url>
                                </menu>
                                
                                Restored only the package information (since my configuration has changed since this configuration file was used) and it worked like a charm.
                                
                                However, this is the output I get from UPS Status:
                                
                                ![](https://s22.postimg.org/7ll45jiap/ups_status.png)
                                
                                I wish it looked like the older version which was like this:
                                
                                ![](https://doc.pfsense.org/images/0/0d/Nut-status-example.png)</menu>
                                
                                
                                1 Reply Last reply Reply Quote 0
                                • dennypageD
                                  dennypage
                                  last edited by

                                  The reason that you are not seeing bar graphs for load and charge is because they are not being reported for your UPS. The fields battery.charge and ups.load are missing from the UPS Detail section.

                                  Best guess is that you want a different mib. I would try explicitly setting the ietf mib and see what it shows.

                                  https://forum.pfsense.org/index.php?topic=115349.msg649477#msg649477

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

                                    Another indication that something may be wrong with the mib is that your UPS has a runtime of 136 hours. :)

                                    1 Reply Last reply Reply Quote 0
                                    • F
                                      frozensteel
                                      last edited by

                                      Man do I want to buy you a beer!  Added mibs=ietf to the "Extra Arguments to driver" field, saved it and BOOM!

                                      That about wraps up all the issues!

                                      Thanks :D

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

                                        @frozensteel:

                                        Man do I want to buy you a beer!  Added mibs=ietf to the "Extra Arguments to driver" field, saved it and BOOM!

                                        Thanks :D

                                        You are quite welcome. Glad it's working for you. While disappointing, 136 minutes of runtime is much more realistic than 136 hours.

                                        How about a whiskey instead?

                                        :)

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

                                          Hi dennypage,

                                          I'm having an issue with  NUT on pfSense 2.3.2 and newest NUT pkg 2.7.4_2.  My UPS is detected and displays the graphs just fine using the usbhid driver.  I have my pfSense box set as Local USB master.  My other freeNas server will connect to it just fine as a Slave.  When I pull the wall plug.  I see the WALL message "ups on bat" but it never initiates the shutdown command on the pfSense box itself, the remote NUT slave will get the shutdown command.  If i plug the UPS into my Freenas box and set that as a master, and pfsense as a slave it works as expected.  However I'd prefer pfsense being my Master control.

                                          Any ideas are appreciated, I've spent a couple hours pulling my hair out thinking it was something with upssched.conf or NOTIFYCMD.

                                          Thanks,

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

                                            When you say you pull the plug, are you leaving it pulled until the battery runs down?

                                            By default, NUT will not initiate a shutdown until the UPS unit reports that the battery is low. Most UPS will not report a low battery until 10% or so. Depending upon your battery runtime, this can be a while.

                                            I don't use FreeNAS, but I did take a quick look at their configuration. There is a configuration parameter titled "Shutdown mode" which if set to "UPS goes on battery" which will cause NUT to initiate a shutdown immediately when mains are lost. The other mode is "UPS reaches low battery" which is the default behavior of NUT and what the pfSense package uses. Given that most power disruptions are short term, this is generally desirable.

                                            You can of course change this configuration with the pfSense package by placing directives in the advanced section for ups.conf. Here is an example of something you might want to do:

                                            ignorelb
                                            override.battery.charge.low = 50
                                            override.battery.runtime.low = 600
                                            
                                            

                                            This would tell NUT to initiate a shutdown if the battery level falls below 50% or the runtime falls below 10 minutes.

                                            See the 'ignorelb' section in the ups.conf manual for details on this.

                                            With some UPS you can also change the low battery condition settings in the UPS itself. You can determine this by running

                                              upsrw <upsname></upsname> 
                                            

                                            If the UPS supports configuring these variables, you will see values for battery.charge.low and battery.runtime.low.

                                            See upsrw upsrw manual for details on using the upsrw command. Also see the forum post on running commands.

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