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

NUT package (2.8.0 and below)

UPS Tools
128
1.2k
4.0m
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
    keyser Rebel Alliance @dennypage
    last edited by May 6, 2022, 8:45 PM

    @dennypage said in NUT package:

    @keyser You are more determined than I. I gave Zabbix a serious go a while back. It worked well in circumstances where an agent was available. However for SNMP devices, of which I have a large number, it required far too much work for me. I gave up after a couple of weeks. 🤕

    😆 Well it did take a little learning, But it’s actually rather simple and flexible. One just needs to understand the architecture.

    Love the no fuss of using the official appliances :-)

    1 Reply Last reply Reply Quote 0
    • F
      FileCity
      last edited by May 10, 2022, 12:17 AM

      Hi all, I've noticed a published NUT 2.8.0 package with a lot of improvements.
      Development has been more active this year with actually 2.8.1 started.
      Is an updated BSD version of this package on the way ?

      Thanks to let know if someone knows about it.

      D 1 Reply Last reply May 10, 2022, 6:41 AM Reply Quote 0
      • D
        dennypage @FileCity
        last edited by May 10, 2022, 6:41 AM

        @filecity said in NUT package:

        Hi all, I've noticed a published NUT 2.8.0 package with a lot of improvements.
        Development has been more active this year with actually 2.8.1 started.
        Is an updated BSD version of this package on the way ?

        It will probably be a few months. 2.8.0 represents 5+ years of changes, all rolled up into a single release. I expect that will take some time to stabilize.

        1 Reply Last reply Reply Quote 0
        • D dennypage referenced this topic on May 21, 2022, 8:12 PM
        • K
          kevindd992002
          last edited by May 23, 2022, 4:17 PM

          @dennypage

          So I replaced my tower UPS with a rackmounted APC Smart-UPS that has a Network Management Card. What is the best way to have a central "UPS server"? Should I point NUT (in pfsense) to the APC UPS using the remote snmp driver and make NUT the main server for everything? Or would it be beneficial to make NUT and other clients as slaves and make the APC UPS as a server itself?

          D 1 Reply Last reply May 23, 2022, 4:36 PM Reply Quote 0
          • D
            dennypage @kevindd992002
            last edited by May 23, 2022, 4:36 PM

            @kevindd992002 said in NUT package:

            So I replaced my tower UPS with a rackmounted APC Smart-UPS that has a Network Management Card. What is the best way to have a central "UPS server"? Should I point NUT (in pfsense) to the APC UPS using the remote snmp driver and make NUT the main server for everything? Or would it be beneficial to make NUT and other clients as slaves and make the APC UPS as a server itself?

            I have a Smart-UPS with an NMC2, and individual hosts speaking directly to the UPS via SNMP. I recommend this approach.

            Be sure to assign a fixed address for the UPS. If you running the DHCP server on pfSense, I would also recommend enabling the static ARP option for the UPS (for good measure).

            1 Reply Last reply Reply Quote 0
            • T
              tnowak
              last edited by Jun 24, 2022, 2:51 PM

              Hi. So I have this new UPS that has been added to NUT 3 months ago. I've tried nut-2.8.0 on RPi and it works fine. But I really like to have it handled by pfSense. Any changes on package upgrade to 2.8.0 in the near future?

              D 1 Reply Last reply Jun 24, 2022, 3:12 PM Reply Quote 0
              • D
                dennypage @tnowak
                last edited by Jun 24, 2022, 3:12 PM

                @tnowak What is the UPS and how does it physically connect? Have you confirmed that it does not actually work with 2.7?

                T 1 Reply Last reply Jun 24, 2022, 4:45 PM Reply Quote 0
                • T
                  tnowak @dennypage
                  last edited by tnowak Jun 24, 2022, 4:46 PM Jun 24, 2022, 4:45 PM

                  @dennypage That’s Ever Eco Pro CDS AVR 1200. It’s kind of new kid on the block. It uses usbhid-ups driver. I have tried 2.7 on both pfSense and RPi and it does not work. That UPS has been committed to nut driver 2-3 months ago according to GitHub source. It works fine in 2.8.

                  1 Reply Last reply Reply Quote 0
                  • D
                    dennypage
                    last edited by Jun 24, 2022, 6:54 PM

                    @tnowak I'll take a look

                    J 1 Reply Last reply Jul 9, 2022, 7:15 AM Reply Quote 0
                    • D dennypage referenced this topic on Jul 4, 2022, 3:42 PM
                    • J
                      JonathanLee @dennypage
                      last edited by JonathanLee Jul 9, 2022, 7:16 AM Jul 9, 2022, 7:15 AM

                      @dennypage can you please help? My UPS has Automatic Voltage Regulation. With the summer heat on the power grid I noticed the input voltage goes from 115-118 volts ac so it has been kicking in a lot more. I think I must have adjusted the original setting to auto correct for anything under 119 volts ac during set up on a older version of this package. However the package now I can not find where that setting to adjustment when AVR should run anymore. The battery this week is getting hammered with the local grid. Last month we had a brownout I had never seen one until this year in California. Our fans everything was slow motion. My HiFi system said low voltage on the screen even a couple weeks ago. I am running in older CP1200AVR made by Cyber Power. I can not remember if you could change the UPS settings from inside of my Netgate firewall or not. It restored 100 of the batter charge after the brownout. However is there anyway to adjust AVR settings from inside of NUT? Or am I imagining this?

                      Make sure to upvote

                      D 1 Reply Last reply Jul 9, 2022, 4:35 PM Reply Quote 0
                      • D
                        dennypage @JonathanLee
                        last edited by Jul 9, 2022, 4:35 PM

                        @jonathanlee You can adjust UPS settings via NUT, but you don't do it from within the GUI. To change UPS settings, use the upsrw command. Documentation is here. If you run upsrw without any options other than the UPS name, it will give you a list of variables that can be set.

                        J 2 Replies Last reply Jul 9, 2022, 4:37 PM Reply Quote 1
                        • J
                          JonathanLee @dennypage
                          last edited by Jul 9, 2022, 4:37 PM

                          @dennypage thank you this is exactly what I was looking for, the AVR settings I have set killed the battery with all the issues. It needs to be set to the normal 90 range again.

                          Make sure to upvote

                          1 Reply Last reply Reply Quote 0
                          • J
                            JonathanLee @dennypage
                            last edited by JonathanLee Jul 22, 2022, 2:14 AM Jul 22, 2022, 1:58 AM

                            @dennypage We got some fresh batteries from Batteries plus today :) It keeps saying access denied. Is there a way to add users on the pfsense? I tried it won't take the add user command also. upsd.users won't work. The clock also will not run. This is for a Cyberpower CP1200AVR running driver USB usbhid. I thought originally a version back I could change the settings in the GUI and that it also had a port number. This new version for 22.05 seems to be missing the other settings like the password and options.

                            login-to-view
                            (GUI View)

                            This thing saved me in a final once already. The power was out during a computer science final and this thing saved the day for the 5 mins it was out.

                            Make sure to upvote

                            D 1 Reply Last reply Jul 22, 2022, 6:36 AM Reply Quote 0
                            • D
                              dennypage @JonathanLee
                              last edited by Jul 22, 2022, 6:36 AM

                              @jonathanlee said in NUT package:

                              We got some fresh batteries from Batteries plus today :) It keeps saying access denied. Is there a way to add users on the pfsense? I tried it won't take the add user command also. upsd.users won't work. The clock also will not run. ... I thought originally a version back I could change the settings in the GUI and that it also had a port number. This new version for 22.05 seems to be missing the other settings like the password and options.

                              I don't understand many things here. Can you clarify what "access denied" refers to? What does "clock also will not run" mean? What port number do you refer to?

                              Currently, no new version of the NUT package has been pushed for 22.05. There is a PR pending to update to 2.8.X, but the current version is still 2.7.4_10. Same as 22.01.

                              J 1 Reply Last reply Jul 22, 2022, 3:48 PM Reply Quote 0
                              • GertjanG Gertjan referenced this topic on Jul 22, 2022, 8:45 AM
                              • GertjanG Gertjan referenced this topic on Jul 22, 2022, 8:45 AM
                              • J
                                JonathanLee @dennypage
                                last edited by JonathanLee Jul 22, 2022, 3:55 PM Jul 22, 2022, 3:48 PM

                                @dennypage thanks for all you do and the reply.
                                When I use the upsrw command with arguments to change items variables with = it displays access denied with my username and password I originally configured.

                                I did configure a username and password for this package before however all those options are no longer listed inside of Pfsense.

                                login-to-view

                                (Image: upsrw command I am talking about "ran without any arguments")

                                The clock I am referring to is the "runtime clock" for the UPS it stops and no longer continues inside the firewall.

                                login-to-view

                                (Image: Runtime is not functional stays the same at 1:24:00 never changes)

                                The port number I am talking about would be how you access the firewall inside of a web browser url for example when I originally installed NUT it had me configure a username and password for the UPS and had a port for the Network use outside of the firewall. I think it's 3493 or something. So for example if I access the firewall with https://192.168.1.1:3493 I should be able to see the GUI for NUT.

                                login-to-view

                                (Image: NUT being accessing with URL outside of firewall as seen with other users on the web I would like to be able to do this)

                                I am trying to access the URL for just the UPS similar to squids URL specific port.

                                login-to-view

                                (Image: Squid's URL specific access uses port 7445)

                                login-to-view

                                (Image: USP load also stopped working it does work in 22.05 right after this package is freshly installed after it just displays zeros for me and does not change again)

                                login-to-view

                                (Image: recent logs for UPS)

                                Make sure to upvote

                                D 1 Reply Last reply Jul 22, 2022, 8:07 PM Reply Quote 0
                                • D
                                  dennypage @JonathanLee
                                  last edited by dennypage Jul 24, 2022, 5:14 PM Jul 22, 2022, 8:07 PM

                                  @jonathanlee said in NUT package:

                                  @dennypage thanks for all you do and the reply.
                                  When I use the upsrw command with arguments to change items variables with = it displays access denied with my username and password I originally configured.

                                  I did configure a username and password for this package before however all those options are no longer listed inside of Pfsense.

                                  There is no specific input field for a username/password. Never has been. You may be thinking of the "Additional configuration lines for upsd.users" section in the Advanced settings. You could have added a user in there for supporting remote monitoring. But that user would not be able to perform administration tasks such as writing variables in the UPS.

                                  The admin password for NUT is not configurable. It is randomly generated for security. You can find it by looking in /usr/local/etc/nut/upsd.users.

                                  The clock I am referring to is the "runtime clock" for the UPS it stops and no longer continues inside the firewall.
                                  ...
                                  (Image: Runtime is not functional stays the same at 1:24:00 never changes)

                                  Runtime is not the amount of time the UPS has been running. Runtime is the amount of time the UPS can power the load if mains are off. In other words, if power fails, your UPS is currently capable of sustaining the system for 1 hour and 24 minutes.

                                  The port number I am talking about would be how you access the firewall inside of a web browser url for example when I originally installed NUT it had me configure a username and password for the UPS and had a port for the Network use outside of the firewall. I think it's 3493 or something. So for example if I access the firewall with https://192.168.1.1:3493 I should be able to see the GUI for NUT.

                                  The NUT cgi GUI has never been part of the pfSense package. You must be thinking of a different system or package.

                                  The two available NUT GUIs are the main status/detail page (Services->UPS->UPS Status), and the UPS Status widget available for install on the dashboard page (Status->Dashboard). Both of these are part of the main pfSense UI when the package is installed. There is no separate port.

                                  1 Reply Last reply Reply Quote 1
                                  • D
                                    DannyBoy2k
                                    last edited by Jul 30, 2022, 11:52 AM

                                    So, I confess that, after I'd initially setup NUT, I'd been content with that fact that I could see UPS status and that it would probably function as intended in a power outage situation. We rarely lose power here and, when we do, it usually comes back in a few minutes, so I'd never hit an extended outage period before. However, I did hit that situation a few weeks ago and realized my pfsense (Netgate 3100) did not shutdown correctly.

                                    I'd only just these past few days been able to truly play around with it to see what might be going on. I tried running upsmon -c fsd to simulate an outage and found the system shutdown the UPS in about 10 seconds, well before pfsense could actually shutdown. Here is what I see from the console when I run that command:

                                    [22.05-RELEASE][root@pfSense.localdomain]/root: upsmon -c fsd
                                    Network UPS Tools upsmon 2.7.4
                                    [22.05-RELEASE][root@pfSense.localdomain]/root:                 
                                    Netgate pfSense Plus is now shutting down ...
                                    
                                    Network UPS Tools upsmon 2.7.4
                                    kill: No such process
                                    UPS: ups (master) (power value 1)
                                    Using power down flag file /etc/killpower
                                    Power down flag is set
                                    Network UPS Tools - UPS driver controller 2.7.4
                                    Network UPS Tools - Generic HID driver 0.41 (2.7.4)
                                    USB communication driver 0.33
                                    Using subdriver: CyberPower HID 0.4
                                    Initiating UPS shutdown
                                    pflog0: promiscuous mode disabled
                                    ugen1.2: <CPS CP685AVRa> at usbus1 (disconnected)
                                    

                                    When it says "Netgate pfSense Plus is now shutting down", the UPS power turns off within 10 seconds and I see nothing in the logs about pfsense actually shutting down. It just goes from normal system messages to rebooting and I see it having to repair the file system (the repair messages don't seem to actually be in the system.log):

                                    Jul 30 07:30:47 pfSense kernel: Root mount waiting for: CAM
                                    Jul 30 07:30:47 pfSense kernel: Root mount waiting for: CAM
                                    Jul 30 07:30:47 pfSense kernel: mountroot: waiting for device /dev/diskid/DISK-0E32776As2a...
                                    Jul 30 07:30:47 pfSense kernel: WARNING: / was not properly dismounted
                                    Jul 30 07:30:47 pfSense kernel: random: unblocking device.
                                    

                                    Thoughts as to why pfSense is not actually initiating a shutdown and the UPS kill command is being sent so soon?

                                    Thanks,
                                    Dan

                                    1 Reply Last reply Reply Quote 0
                                    • D
                                      dennypage
                                      last edited by Jul 30, 2022, 5:01 PM

                                      I would recommend for shutdown testing that you connect your NUT master (pfSense in this case) directly to power rather than through the UPS. This is to guarantee that you have complete logs and to avoid potential corruption to your your file system.

                                      Now, re-run your test and time how long it takes for the shutdown to happen. Pay particular attention to the time between the OS shutdown completion and the actual power cut.

                                      The UPS must be configured to have sufficient delay between the kill command and the actual load shut off. Often, the default value (usually in the 10-20 seconds) is insufficient for the operating system shutdown to complete and needs to be increased.

                                      With higher end UPSs you can usually configure this value via upsrw. Look for a "ups.delay.shutdown" or "load.off.delay" parameter.

                                      With other UPSs the off delay has to be set every time the ups starts up. Particularly if you're using USBHID-UPS, then it's it's almost certain that will need to set the value "offdelay" in the driver configuration.

                                      D 1 Reply Last reply Jul 30, 2022, 5:36 PM Reply Quote 0
                                      • D
                                        DannyBoy2k @dennypage
                                        last edited by DannyBoy2k Jul 30, 2022, 6:21 PM Jul 30, 2022, 5:36 PM

                                        @dennypage Thank you very much for the feedback. Based on what you described, I think I might have misunderstood when the UPS power off command is issued. Based on this documentation on the NUT site:

                                        6.  The upsmon primary:
                                        
                                            generates a NOTIFY_SHUTDOWN event
                                            waits FINALDELAY seconds — typically 5
                                            creates the POWERDOWNFLAG file in its local filesystem —  usually /etc/killpower
                                            calls the SHUTDOWNCMD 
                                        
                                        7. On most systems, init takes over, kills your processes, syncs and unmounts some filesystems, and remounts some read-only.
                                        8. init then runs your shutdown script. This checks for the POWERDOWNFLAG, finds it, and tells the UPS driver(s) to power off the load by sending commands to the connected UPS device(s) they manage.
                                        9. All the systems lose power.
                                        10. Time passes. The power returns, and the UPS switches back on.
                                        11. All systems reboot and go back to work. 
                                        

                                        I had assumed that the power off command would not be issued until pfSense had performed most of its shutdown, but that wasn't the case at all.

                                        I did in fact try this by pulling the plug as well with an artificially higher battery.charge.low setting and experienced the same rapid power off before pfSense even began shutting down.

                                        If the power off command is being issued before pfSense even begins a shutdown sequence, I understand what you are saying about needing to increase the ups.delay.shutdown. I see that my UPS (CP685AVR) allows setting this via upsrw. I'll try playing around with that this evening after the household heads to bed. Don't think they'd appreciate losing Internet.

                                        Thanks,
                                        Dan

                                        1 Reply Last reply Reply Quote 0
                                        • D
                                          DannyBoy2k
                                          last edited by Jul 30, 2022, 7:00 PM

                                          @dennypage - just a quick follow-up. I tried to upsrw way of setting the ups.delay.shutdown, and, as you suggested, that didn't stick, so I set the offdelay and ondelay in the additional driver args section. I still won't be testing a full off scenario with the new settings until this evening so the family doesn't lose connectivity, though.

                                          In the interim, would you be able to comment on my observations of the UPS power off command being sent immediately rather than after pfSense has had init shut everything down as per the NUT documentation I copied in the post above? Is that just due to the way NUT is being controlled under pfSense?

                                          The way the NUT documentation describes is, the UPS driver shouldn't tell UPS to power off the load until after all the processes have shutdown and disks have been unmounted or remounted read-only.

                                          Thanks,
                                          Dan

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