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

    NUT Package (2.8.1 and above)

    Scheduled Pinned Locked Moved UPS Tools
    296 Posts 41 Posters 158.5k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • dennypageD
      dennypage @hspindel
      last edited by

      @hspindel said in NUT Package (2.8.1 and above):

      I'm using a Synology DS1522 container for Home Assistant. It doesn't appear to have any of these settings - it just set things up automagically when I installed it.

      If you don't have those settings, then I assume you are not using the hass add-on. What then are you using? And how are you configuring it?

      As an aside, if you have HomeAssistant running in a container on your Synology, why are you running NUT inside the container? I assume it is not for shutting down the container which would be handled by the Synology. Are you running HA automation based on the UPS values?

      H 2 Replies Last reply Reply Quote 0
      • H
        hspindel @dennypage
        last edited by

        @dennypage said in NUT Package (2.8.1 and above):

        @hspindel said in NUT Package (2.8.1 and above):

        I'm using a Synology DS1522 container for Home Assistant. It doesn't appear to have any of these settings - it just set things up automagically when I installed it.

        If you don't have those settings, then I assume you are not using the hass add-on. What then are you using? And how are you configuring it?

        Within Home Assistant, one has the option to select Settings/Devices and Services/Add Integration. From the Add Integration page, one can search for NUT. Upon selecting NUT, Home Assistant pops up a dialog box to "Connect to the NUT server" which wants host, poirt, username, and password. There are no configuration options offered, and nothing I've tried in the dialog box gets a response other than "Failed to Connect."

        As an aside, if you have HomeAssistant running in a container on your Synology, why are you running NUT inside the container? I assume it is not for shutting down the container which would be handled by the Synology. Are you running HA automation based on the UPS values?

        AFAIK (and I could be confused) I am not trying to run NUT inside the container, just the Home Assistant NUT client.

        I have using Home Assistant to shut down two other Synologies (APC units). The UPSes for those Synologies are connected to a Windows machine and a Linux machine. Windows and Linux are running apcupsd, which is not understood by Synology. So Home Assistant is configured to watch apcupsd and send a shutdown message to the relevant Synology.

        Another UPS (an Eaton) is connected to pfSense. So I was trying to configure Home Assistant to pay attention to the NUT server on pfSense and operate similarly to the way the APC/Synologies work with Home Assistant.

        If I can't get that to work, my next try would be to get the Synology as a NUT client to pay direct attention to the NUT server on pfSense. I have read that Synology's non-standard implementation of NUT makes this problematic, but I can search for a known working configuration.

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

          @dennypage

          I guess the whole Home Assistant thing is a fuggediboutit now.

          I was able to get the Synology to directly connect to the NUT server on pfSense.

          Since all I care about is powering down the Synology correctly in the event of a power failure, I'm good now.

          Thank you for your help.

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

            @dennypage Thank you for your quick response, much appreciated.

            When I installed the UPS some weeks ago, I did struggle when I tried to use the additional settings entries in the pfSense Nut UI. As I mentioned, I ended up saving only the UPS Type, UPS name, notifications, and Remote IP address or hostname. After that I manually edited the conf files and the service started successfully.

            Fast forward 12 days and I stated getting notifications of comms failure to the UPS. The conf files seemed to have reverted to default,, so I restored the files and all started correctly and I made a post above that you responded to.

            In order to answer your question correctly, I went back in and reconfigured the UPS through the UI - which is a very much preferred way of doing it. I am not sure what I did differently - but I was successful getting the UPS connected via the UI settings this time (YAY!). The entries I made below were (details changed to protect the innocent)PostUpload1.txt

            I am also unsure of the difference between the entry in upsmon.conf which nominates "primary", and the upsd.users file that nominates "master".

            I am not using pfSense to relay UPS status to any other machine, as my Windows and Linux servers directly connect to the UPS themselves, and my monitoring system (Zabbix) also directly connects using snmp.

            Appreciate any suggestions or explanations,
            Regards
            Simon

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

              @hspindel said in NUT Package (2.8.1 and above):

              I have using Home Assistant to shut down two other Synologies (APC units). The UPSes for those Synologies are connected to a Windows machine and a Linux machine. Windows and Linux are running apcupsd, which is not understood by Synology. So Home Assistant is configured to watch apcupsd and send a shutdown message to the relevant Synology.

              This is kinda convoluted, and sounds fragile to me. I think using NUT directly on all the systems would be a better choice. NUT has a shutdown interlock for secondaries that will be lost by using HA. FWIW, NUT does support being a client of apcupsd, but there is no way to configure this on Synology.

              @hspindel said in NUT Package (2.8.1 and above):

              If I can't get that to work, my next try would be to get the Synology as a NUT client to pay direct attention to the NUT server on pfSense. I have read that Synology's non-standard implementation of NUT makes this problematic, but I can search for a known working configuration.

              Synology does use a very non-standard configuration for NUT, but what you are talking about is easily accomplished. The only restriction is that you must use default values for ups name, username and password.

              See post #2 in this thread, Notes on remote access to NUT for details on setting up remote access, and see Synology setup details in the Notes on Synology section at the end of the post.

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

                @simon_hp said in NUT Package (2.8.1 and above):

                I am also unsure of the difference between the entry in upsmon.conf which nominates "primary", and the upsd.users file that nominates "master".

                In 2.7 and below, NUT used the terms "master" and "slave". In NUT 2.8+, the terms "primary" and "secondary" were added, but are fully interchangeable with the prior terms.

                1 Reply Last reply Reply Quote 0
                • R
                  robertofelix @pfpv
                  last edited by

                  @pfpv said in NUT Package (2.8.1 and above):

                  administrative

                  Hey guys, I faced this very same issue twice, very annoying indeed. In my situation, I don't want a graceful shutdown for my pfSense.
                  I setup my box to come back when the power is back. With a graceful shutdown that wouldn't happen, correct me if I'm wrong.

                  Anyways, to avoid the NUT to shutdown my pfSense I did the following

                  Edited the file /usr/local/etc/nut/upsmon.conf removing the following lines

                  SHUTDOWNCMD "/sbin/shutdown -p +0"
                  POWERDOWNFLAG /etc/killpower
                  

                  Then, you can just restart the service. I belive that does the job, but again, correct me if I'm wrong. I want NUT just to keep monitoring my UPS which is attached to my NAS. I don't want my pfSense goes down when I have a power failure.

                  dennypageD GertjanG 2 Replies Last reply Reply Quote 0
                  • dennypageD
                    dennypage @robertofelix
                    last edited by

                    @robertofelix said in NUT Package (2.8.1 and above):

                    I don't want a graceful shutdown for my pfSense.
                    I setup my box to come back when the power is back. With a graceful shutdown that wouldn't happen, correct me if I'm wrong.

                    Yes, that is wrong. You have an incorrect BIOS setting. Change the Power setting from 'Last State' to 'Power On'.

                    R 1 Reply Last reply Reply Quote 0
                    • R
                      robertofelix @dennypage
                      last edited by

                      @dennypage You're right. I changed that setting to 'Power On'.
                      Now, I believe if the NUT package misbehaves, the box will shut down, but it will power on back by itself, is that right?

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

                        @robertofelix said in NUT Package (2.8.1 and above):

                        You're right. I changed that setting to 'Power On'.
                        Now, I believe if the NUT package misbehaves, the box will shut down, but it will power on back by itself, is that right?

                        The behavior of that bios setting is that the host will boot whenever power is applied to the box.

                        When NUT executes a shutdown, one of the very last things it does is to instruct the UPS to cut power after a sort delay. So following the return of mains, when the UPS brings power back on, the host will boot automatically.

                        1 Reply Last reply Reply Quote 1
                        • GertjanG
                          Gertjan @robertofelix
                          last edited by

                          @robertofelix said in NUT Package (2.8.1 and above):

                          Edited the file /usr/local/etc/nut/upsmon.conf removing the following lines

                          ... and the next time nut (re) starts, that file, as the other 'nut' config files, will get re generated.
                          It's the core functionality of pfSense : one GUI to create one or more config file(s). From is one source, for every process, the needed config files are created and set up with the GUI settings.
                          If you want to have control yourself over the config files, go for a native FreeBSD, and install the needed packages manually, and now you've control, by editing all these files yourself 😊

                          You probably want to know that this file exists : /usr/local/pkg/nut/nut.inc
                          Look what you find at 255 😊

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

                          R 1 Reply Last reply Reply Quote 0
                          • whoami TMW
                            whoami TM
                            last edited by

                            After migrating from a SG-4860 to a XG-7100 I think I'm starting to narrow down my disconnect issue.

                            I've even gone as far as replacing the battery in the UPS.

                            Sometime over the last few updates my APC UPS stopped reporting ONLINE/CHARGED and now reports ONLINE/DISCHARGING

                            I've tried setting
                            onlinedischarge_log_throttle_sec=num

                            Set the minimum frequency (in seconds) at which warnings would be emitted for an otherwise not handled OL+DISCHRG device status combination. Negative values disable sequentially repeated messages (when this state appears and persists).

                            in Extra Arguments to driver field for usbhid but it prevents NUT from connecting to the UPS.

                            dennypageD 1 Reply Last reply Reply Quote 0
                            • R
                              robertofelix @Gertjan
                              last edited by robertofelix

                              @Gertjan said in NUT Package (2.8.1 and above):

                              You probably want to know that this file exists : /usr/local/pkg/nut/nut.inc

                              Yup, you're right, I rebooted and the config is back. I don't know if people using Opnsense are also facing this issue, maybe?
                              Anyways, good tip about that line 255. That helps.

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

                                @whoami-TM said in NUT Package (2.8.1 and above):

                                I've tried setting
                                onlinedischarge_log_throttle_sec=num

                                I don't believe that is implemented yet. To my knowledge, that's planned for the next release of NUT.

                                demD 1 Reply Last reply Reply Quote 0
                                • demD
                                  dem @dennypage
                                  last edited by

                                  Speaking of onlinedischarge, we had several power flickers yesterday and with the latest NUT package I get a message like this for every flicker:

                                  Dec 24 16:25:22 router usbhid-ups[31461]: ups_status_set: seems that UPS [CP1500PFCLCD] is in OL+DISCHRG state now. Is it calibrating or do you perhaps want to set 'onlinedischarge' option? Some UPS models (e.g. CyberPower UT series) emit OL+DISCHRG when offline.
                                  

                                  There was also a brief outage which was detected correctly:

                                  Dec 24 12:52:22 router upsmon[30759]: UPS CP1500PFCLCD on battery
                                  Dec 24 12:52:27 router upsmon[30759]: UPS CP1500PFCLCD on line power
                                  

                                  The onlinedischarge messages seem harmless so I guess I'll just ignore them.

                                  1 Reply Last reply Reply Quote 0
                                  • dennypageD dennypage referenced this topic on
                                  • H
                                    ha11oga11o
                                    last edited by

                                    With pfSense 2.7.0 and nut 2.8.2 i still have huge problems with Riello 2200.

                                    Dec 27 18:33:38 	riello_usb 	43008 	Communication with UPS is lost: status read failed!
                                    Dec 27 18:33:35 	riello_usb 	43008 	Communication with UPS is lost: status read failed!
                                    Dec 27 18:33:34 	upsmon 	33505 	Poll UPS [RielloSEP2200] failed - Data stale
                                    Dec 27 18:33:33 	riello_usb 	43008 	Communication with UPS is lost: status read failed!
                                    Dec 27 18:33:31 	riello_usb 	43008 	Communication with UPS is lost: status read failed!
                                    Dec 27 18:33:29 	riello_usb 	43008 	Communication with UPS is lost: status read failed!
                                    Dec 27 18:33:29 	upsmon 	33505 	Poll UPS [RielloSEP2200] failed - Data stale
                                    Dec 27 18:33:27 	riello_usb 	43008 	Communication with UPS is lost: status read failed!
                                    Dec 27 18:33:25 	riello_usb 	43008 	Communication with UPS is lost: status read failed!
                                    Dec 27 18:33:24 	upsmon 	33505 	Poll UPS [RielloSEP2200] failed - Data stale
                                    Dec 27 18:33:23 	riello_usb 	43008 	Communication with UPS is lost: status read failed!
                                    Dec 27 18:33:21 	riello_usb 	43008 	Communication with UPS is lost: status read failed!
                                    Dec 27 18:33:19 	riello_usb 	43008 	Communication with UPS is lost: status read failed!
                                    Dec 27 18:33:19 	upsmon 	33505 	Poll UPS [RielloSEP2200] failed - Data stale
                                    Dec 27 18:33:17 	riello_usb 	43008 	Communication with UPS is lost: status read failed!
                                    Dec 27 18:33:15 	riello_usb 	43008 	Communication with UPS is lost: status read failed!
                                    Dec 27 18:33:14 	upsmon 	33505 	Poll UPS [RielloSEP2200] failed - Data stale
                                    Dec 27 18:33:13 	riello_usb 	43008 	Communication with UPS is lost: status read failed!
                                    Dec 27 18:33:11 	riello_usb 	43008 	Communication with UPS is lost: status read failed!
                                    Dec 27 18:33:09 	riello_usb 	43008 	Communication with UPS is lost: status read failed!
                                    Dec 27 18:33:09 	upsmon 	33505 	Poll UPS [RielloSEP2200] failed - Data stale
                                    Dec 27 18:33:07 	riello_usb 	43008 	Communication with UPS is lost: status read failed! 
                                    

                                    Only stopping and starting nut service brings it back for some time. Restart not helping. I check hardware, it works fine on windows machine.

                                    Thnx

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

                                      @ha11oga11o said in NUT Package (2.8.1 and above):

                                      With pfSense 2.7.0 and nut 2.8.2 i still have huge problems with Riello 2200.

                                      Something is off with the version numbers here. pfSense-pkg-nut version 2.8.2 requires pfSense version 23.09/2.7.1 or above. Are you sure you are not running pfSense-pkg-nut version 2.8.0?

                                      Edit: In the other thread you started, it appears that you haven't updated anything since Nov 10th. The pattern you are describing is characteristic of version 2.8.0. Did you go through any of the later posts in that thread? @Unoptanio indicates success with the Riello using version 2.8.2 of the pfSense-pkg-nut on pfsense version 2.7.1.

                                      H N 2 Replies Last reply Reply Quote 0
                                      • dennypageD
                                        dennypage
                                        last edited by

                                        For those of you that are on amd64 based systems (Intel or AMD), and are severely affected by the shutdown on calibration/self-test issue, attached are replacement versions of upsmon and usbhid-ups that you can use until the update is published.

                                        Note that these files are for amd64 systems only. I do not have a build/test system for arm. Sorry!

                                        upsmon.gz

                                        usbhid-ups.gz

                                        P M H 3 Replies Last reply Reply Quote 1
                                        • H
                                          ha11oga11o @dennypage
                                          last edited by ha11oga11o

                                          @dennypage

                                          I am really sorry! i Made typo mistake. Actually system is

                                          2.7.2-RELEASE (amd64)
                                          built on Fri Dec 8 21:55:00 CET 2023
                                          FreeBSD 14.0-CURRENT

                                          nut package 2.8.2

                                          and error is still persists on this setup. This is latest log, and i found it online this morning.

                                          Dec 27 18:42:48 	upsmon 	57881 	UPS RielloSEP2200 on line power
                                          Dec 27 18:42:43 	upsmon 	57881 	UPS RielloSEP2200: on bypass (powered, not protecting)
                                          Dec 27 18:42:43 	upsmon 	57881 	Communications with UPS RielloSEP2200 established
                                          Dec 27 18:42:43 	upsd 	61706 	User local-monitor@127.0.0.1 logged into UPS [RielloSEP2200]
                                          Dec 27 18:42:41 	upsd 	61706 	Connected to UPS [RielloSEP2200]: riello_usb-RielloSEP2200
                                          Dec 27 18:42:41 	riello_usb 	67935 	Startup successful
                                          Dec 27 18:42:39 	upsd 	61706 	Startup successful
                                          Dec 27 18:42:39 	upsd 	61406 	Found 1 UPS defined in ups.conf
                                          Dec 27 18:42:39 	upsd 	61406 	Can't connect to UPS [RielloSEP2200] (riello_usb-RielloSEP2200): No such file or directory
                                          Dec 27 18:42:39 	upsd 	61406 	listening on ::1 port 3493
                                          Dec 27 18:42:39 	upsd 	61406 	listening on 127.0.0.1 port 3493
                                          Dec 27 18:42:38 	upsmon 	57881 	Communications with UPS RielloSEP2200 lost
                                          Dec 27 18:42:38 	upsmon 	57881 	UPS [RielloSEP2200]: connect failed: Connection failure: Connection refused
                                          Dec 27 18:42:38 	upsmon 	57329 	Startup successful
                                          Dec 27 18:42:38 	riello_usb 	43008 	Signal 15: exiting
                                          Dec 27 18:42:38 	upsd 	34960 	Signal 15: exiting
                                          Dec 27 18:42:38 	upsd 	34960 	mainloop: Interrupted system call
                                          Dec 27 18:42:38 	upsd 	34960 	User local-monitor@127.0.0.1 logged out from UPS [RielloSEP2200]
                                          Dec 27 18:42:38 	upsmon 	33505 	Signal 15: exiting
                                          Dec 27 18:42:37 	upsmon 	33505 	Poll UPS [RielloSEP2200] failed - Data stale
                                          Dec 27 18:42:37 	riello_usb 	43008 	Communication with UPS is lost: status read failed!
                                          Dec 27 18:42:35 	riello_usb 	43008 	Communication with UPS is lost: status read failed!
                                          Dec 27 18:42:33 	riello_usb 	43008 	Communication with UPS is lost: status read failed!
                                          Dec 27 18:42:32 	upsmon 	33505 	Poll UPS [RielloSEP2200] failed - Data stale
                                          Dec 27 18:42:31 	riello_usb 	43008 	Communication with UPS is lost: status read failed!
                                          Dec 27 18:42:29 	riello_usb 	43008 	Communication with UPS is lost: status read failed!
                                          Dec 27 18:42:27 	upsmon 	33505 	Poll UPS [RielloSEP2200] failed - Data stale
                                          Dec 27 18:42:27 	riello_usb 	43008 	Communication with UPS is lost: status read failed!
                                          Dec 27 18:42:24 	riello_usb 	43008 	Communication with UPS is lost: status read failed!
                                          Dec 27 18:42:22 	riello_usb 	43008 	Communication with UPS is lost: status read failed!
                                          Dec 27 18:42:22 	upsmon 	33505 	Poll UPS [RielloSEP2200] failed - Data stale 
                                          

                                          Thanks and sorry again.

                                          Speaking of the devil, just while i was writing this it lost connection.

                                          Dec 28 12:24:12 	riello_usb 	24097 	Communication with UPS is lost: status read failed!
                                          Dec 28 12:24:12 	upsmon 	8652 	Poll UPS [RielloSEP2200] failed - Data stale
                                          Dec 28 12:24:10 	riello_usb 	24097 	Communication with UPS is lost: status read failed!
                                          Dec 28 12:24:08 	riello_usb 	24097 	Communication with UPS is lost: status read failed!
                                          Dec 28 12:24:07 	upsmon 	8652 	Poll UPS [RielloSEP2200] failed - Data stale
                                          Dec 28 12:24:06 	riello_usb 	24097 	Communication with UPS is lost: status read failed!
                                          Dec 28 12:24:04 	riello_usb 	24097 	Communication with UPS is lost: status read failed!
                                          Dec 28 12:24:02 	riello_usb 	24097 	Communication with UPS is lost: status read failed!
                                          Dec 28 12:24:02 	upsmon 	8652 	Poll UPS [RielloSEP2200] failed - Data stale
                                          Dec 28 12:24:00 	riello_usb 	24097 	Communication with UPS is lost: status read failed!
                                          Dec 28 12:23:58 	riello_usb 	24097 	Communication with UPS is lost: status read failed!
                                          Dec 28 12:23:57 	upsmon 	8652 	Poll UPS [RielloSEP2200] failed - Data stale
                                          Dec 28 12:23:56 	riello_usb 	24097 	Communication with UPS is lost: status read failed! 
                                          
                                          dennypageD 1 Reply Last reply Reply Quote 0
                                          • M
                                            msurg
                                            last edited by

                                            Hello,

                                            With Pfsense 2.7.0 CE I could get UPS status with the following config.

                                            UPS Type: Local USB

                                            Driver: nutdrv_qx

                                            Extra Arguments to drive:
                                            port=auto
                                            vendorid="0001"
                                            productid="0000"
                                            langid_fix=0x409
                                            protocol="megatec"
                                            subdriver="hunnox"
                                            novendor
                                            noscanlangid

                                            UPS is Makelsan. Link below

                                            https://www.makelsan.com.tr/en/ups/urundetay/lion-serisi-650---2200-va/index-500.html

                                            After upgrading Pfsense to 2.7.2 I don't get UPS status. It says "Failed to retrieve status".

                                            Nothing changed. Only upgraded from 2.7.0 CE to 2.7.2 CE.

                                            Any help will be appreciated.

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