Netgate Discussion Forum
    • 版面
    • 最新
    • 標籤
    • 熱門
    • 使用者
    • 搜尋
    • 註冊
    • 登入

    NUT Package (2.8.1 and above)

    已排程 已置頂 已鎖定 已移動 UPS Tools
    296 貼文 41 Posters 176.6k 瀏覽
    正在載入更多貼文
    • 從舊到新
    • 從新到舊
    • 最多點贊
    回覆
    • 在新貼文中回覆
    登入後回覆
    此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
    • dennypageD
      dennypage @hbastasic
      最後由 編輯

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

      Should i use the replacement files?

      Up to you. If it were my system, I would.

      H 1 條回覆 最後回覆 回覆 引用 0
      • P
        pfguy2018 @NinthWave
        最後由 編輯

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

        • Move the files in appropriate directories and make sure to have appropriate file permission or CHMOD 755
          @dennypage said in NUT Package (2.8.1 and above):

        [23.09.1-RELEASE][root@fw]/root: ls -l /usr/local/sbin/upsmon* /usr/local/libexec/nut/usbhid-ups*
        -rwxr-xr-x 1 root wheel 333728 Dec 27 10:14 /usr/local/libexec/nut/usbhid-ups
        -rwxr-xr-x 1 root wheel 287088 Nov 1 00:57 /usr/local/libexec/nut/usbhid-ups.org
        -rwxr-xr-x 1 root wheel 87760 Dec 27 10:13 /usr/local/sbin/upsmon
        -rwxr-xr-x 1 root wheel 68904 Nov 1 00:57 /usr/local/sbin/upsmon.org
        [23.09.1-RELEASE][root@fw]/root:

        • Restart service and voilà

        I have been waiting for the "official" patch to be released, but am experiencing frequent shutdowns as a result of this issue, so I would like to update manually. But I am not at all versed in how to accomplish the 2 steps outlined above ("Move the files in appropriate directories and make sure to have appropriate file permission or CHMOD 755") (I have been able to download and extract the archives). Would it be possible for someone to provide the specific commands needed, and where exactly to enter them in pfSense, to accomplish these steps?

        Thanks in advance!

        P 1 條回覆 最後回覆 回覆 引用 0
        • H
          hbastasic @dennypage
          最後由 編輯

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

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

          Should i use the replacement files?

          Up to you. If it were my system, I would.

          Thanks @dennypage for prompt reply, replaced the files, NUT started and everything works ok. Now just have to wait for the APC's next battery test.

          btw, is there a way to invoke a battery test from pfSense, shell command or something?

          P 1 條回覆 最後回覆 回覆 引用 0
          • P
            pfpv @hbastasic
            最後由 pfpv 編輯

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

            is there a way to invoke a battery test from pfSense, shell command or something?

            Usually you can initiate it by pressing the physical power button on the UPS for 10 seconds or until the UPS switches to battery mode indicating the test has started. This is kind of dangerous. If you release the button earlier the UPS will turn off. This can happen unintentionally - if the button is wearing off or if you flinch. Some info: https://www.apc.com/us/en/faqs/FA405317/

            I also found this from 2019, I don't know if it still works:

            @dennypage said in NUT package (2.8.0 and below):

            You can initiate a battery test via nut, but you will have to use the command line. Log into the system and use

            upscmd -l ups
            

            to see what commands are available. Look for commands that begin "test.battery..." Start with a quick test if available, then proceed to a deep test.

            WARNING if the battery is defective, running these tests can cause the ups to cut power to the load (your pfSense box). Use at your own risk!

            H 1 條回覆 最後回覆 回覆 引用 1
            • H
              hbastasic @pfpv
              最後由 編輯

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

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

              is there a way to invoke a battery test from pfSense, shell command or something?

              Usually you can initiate it by pressing the physical power button on the UPS for 10 seconds or until the UPS switches to battery mode indicating the test has started. This is kind of dangerous. If you release the button earlier the UPS will turn off. This can happen unintentionally - if the button is wearing off or if you flinch. I also found this from 2019, I don't know if it still works:

              well, thanks, forgot to check the manual, APC FAQ, although they mention only SmartUPS line nothing on BackUPS

              @dennypage said in NUT package (2.8.0 and below):

              You can initiate a battery test via nut, but you will have to use the command line. Log into the system and use

              upscmd -l ups
              

              to see what commands are available. Look for commands that begin "test.battery..." Start with a quick test if available, then proceed to a deep test.

              WARNING if the battery is defective, running these tests can cause the ups to cut power to the load (your pfSense box). Use at your own risk!

              command line seems more convenient, thanks for this find, waiting for wife's all clear to start screwing with internet ...

              P 1 條回覆 最後回覆 回覆 引用 0
              • P
                pfpv @hbastasic
                最後由 編輯

                @hbastasic, find a manual for your particular model. I found this for two random APC Back-UPS's:

                • Press and hold the POWER ON/OFF button for 4 to 8 seconds to initiate the UPS Self Test.
                • During On Line Mode, a longer press of the POWER button until three beeps are heard will perform a manual battery self-test. Then, the LED will flash and UPS will enter self-test mode. Note: This will happen only when battery is fully charged in On Line Mode.
                H 1 條回覆 最後回覆 回覆 引用 0
                • P
                  pfguy2018 @pfguy2018
                  最後由 編輯

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

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

                  • Move the files in appropriate directories and make sure to have appropriate file permission or CHMOD 755
                    @dennypage said in NUT Package (2.8.1 and above):

                  [23.09.1-RELEASE][root@fw]/root: ls -l /usr/local/sbin/upsmon* /usr/local/libexec/nut/usbhid-ups*
                  -rwxr-xr-x 1 root wheel 333728 Dec 27 10:14 /usr/local/libexec/nut/usbhid-ups
                  -rwxr-xr-x 1 root wheel 287088 Nov 1 00:57 /usr/local/libexec/nut/usbhid-ups.org
                  -rwxr-xr-x 1 root wheel 87760 Dec 27 10:13 /usr/local/sbin/upsmon
                  -rwxr-xr-x 1 root wheel 68904 Nov 1 00:57 /usr/local/sbin/upsmon.org
                  [23.09.1-RELEASE][root@fw]/root:

                  • Restart service and voilà

                  I have been waiting for the "official" patch to be released, but am experiencing frequent shutdowns as a result of this issue, so I would like to update manually. But I am not at all versed in how to accomplish the 2 steps outlined above ("Move the files in appropriate directories and make sure to have appropriate file permission or CHMOD 755") (I have been able to download and extract the archives). Would it be possible for someone to provide the specific commands needed, and where exactly to enter them in pfSense, to accomplish these steps?

                  Thanks in advance!

                  I have tried to figure out how to do this. I think I have moved the files into the correc directories, but I have no idea how to run "CHMOD 755" and now NUT won't start. Can someone please walk me through this?

                  1 條回覆 最後回覆 回覆 引用 0
                  • H
                    hbastasic @pfpv
                    最後由 編輯

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

                    @hbastasic, find a manual for your particular model. I found this for two random APC Back-UPS's:

                    • Press and hold the POWER ON/OFF button for 4 to 8 seconds to initiate the UPS Self Test.
                    • During On Line Mode, a longer press of the POWER button until three beeps are heard will perform a manual battery self-test. Then, the LED will flash and UPS will enter self-test mode. Note: This will happen only when battery is fully charged in On Line Mode.

                    yep, found it, thanks
                    RTFM is still current, and somehow comforting or ... shaming

                    will report after self-test, just for reference

                    1 條回覆 最後回覆 回覆 引用 0
                    • E
                      endy66
                      最後由 編輯

                      Short question about client / slave logins.
                      I have two different client machines I wanna read the UPS values. UPS is ofc connected to pfSense and works.
                      So for a longer time I already had a client entry withing the "Additional configuration lines for upsd.users" field:

                      [client-xx1]
                      password = mypass
                      upsmon slave

                      Now for better log reading, I've added a second entry, for my second client

                      [client-xx2]
                      password = mypass
                      upsmon slave

                      I'm able to connect, however I can't see that this second client has connected from within the system logs in my pfSense. Does someone know why that is?

                      dennypageD 1 條回覆 最後回覆 回覆 引用 0
                      • P pfguy2018 referenced this topic on
                      • dennypageD
                        dennypage @endy66
                        最後由 編輯

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

                        Now for better log reading, I've added a second entry, for my second client
                        ...
                        I'm able to connect, however I can't see that this second client has connected from within the system logs in my pfSense. Does someone know why that is?

                        No idea. Are you sure it is connecting with the username you expect? FWIW, you can distinguish client by IP address. Do you see a connection from the IP address you expect?

                        E 1 條回覆 最後回覆 回覆 引用 0
                        • E
                          endy66 @dennypage
                          最後由 編輯

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

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

                          Now for better log reading, I've added a second entry, for my second client
                          ...
                          I'm able to connect, however I can't see that this second client has connected from within the system logs in my pfSense. Does someone know why that is?

                          No idea. Are you sure it is connecting with the username you expect? FWIW, you can distinguish client by IP address. Do you see a connection from the IP address you expect?

                          After a few restarts of the NUT service on my pfSense it's there in the log. However the second login doesn't have an explicit IP address.

                          upsd	81154	User client-xx1@192.168.1.xx logged into UPS [CyberPower_USV]
                          upsd	81154	User client-xx2@::1 logged into UPS [CyberPower_USV]
                          
                          dennypageD 1 條回覆 最後回覆 回覆 引用 0
                          • dennypageD
                            dennypage @endy66
                            最後由 編輯

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

                            After a few restarts of the NUT service on my pfSense it's there in the log. However the second login doesn't have an explicit IP address.

                            upsd 81154 User client-xx1@192.168.1.xx logged into UPS [CyberPower_USV]
                            upsd 81154 User client-xx2@::1 logged into UPS [CyberPower_USV]

                            "::1" is an IP address. It's the IPv6 version of localhost, equivalent to 127.0.0.1 in IPv4.

                            E 1 條回覆 最後回覆 回覆 引用 0
                            • E
                              endy66 @dennypage
                              最後由 編輯

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

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

                              After a few restarts of the NUT service on my pfSense it's there in the log. However the second login doesn't have an explicit IP address.

                              upsd 81154 User client-xx1@192.168.1.xx logged into UPS [CyberPower_USV]
                              upsd 81154 User client-xx2@::1 logged into UPS [CyberPower_USV]

                              "::1" is an IP address. It's the IPv6 version of localhost, equivalent to 127.0.0.1 in IPv4.

                              Hm this is weird because this user is connecting from a different host, so shouldn't it be anything other than a "localhost" address?

                              dennypageD 1 條回覆 最後回覆 回覆 引用 0
                              • dennypageD
                                dennypage @endy66
                                最後由 編輯

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

                                Hm this is weird because this user is connecting from a different host, so shouldn't it be anything other than a "localhost" address?

                                Referring to post #2 in this thread, how are you allowing remote connections? Are you using option 1 (NAT/Port forward)? Or are you using option 2 (LISTEN)?

                                E 1 條回覆 最後回覆 回覆 引用 0
                                • E
                                  endy66 @dennypage
                                  最後由 編輯

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

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

                                  Hm this is weird because this user is connecting from a different host, so shouldn't it be anything other than a "localhost" address?

                                  Referring to post #2 in this thread, how are you allowing remote connections? Are you using option 1 (NAT/Port forward)? Or are you using option 2 (LISTEN)?

                                  I'm using option 2 (LISTEN).

                                  dennypageD 1 條回覆 最後回覆 回覆 引用 0
                                  • dennypageD
                                    dennypage @endy66
                                    最後由 編輯

                                    @endy66 Please post the contents of these files:

                                    /usr/local/etc/nut/upsmon.conf
                                    /usr/local/etc/nut/upsd.conf
                                    /usr/local/etc/nut/upsd.users
                                    
                                    E 1 條回覆 最後回覆 回覆 引用 0
                                    • E
                                      endy66 @dennypage
                                      最後由 endy66 編輯

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

                                      @endy66 Please post the contents of these files:

                                      /usr/local/etc/nut/upsmon.conf
                                      /usr/local/etc/nut/upsd.conf
                                      /usr/local/etc/nut/upsd.users
                                      

                                      Here's the content of these 3 files. Passwords are masked. Monitor password of the upsmon.conf matches the one from the [admin] section of the upsd.users.

                                      upsmon.conf

                                      MONITOR CyberPower_USV 1 local-monitor *************** master
                                      SHUTDOWNCMD "/sbin/shutdown -p +0"
                                      POWERDOWNFLAG /etc/killpower
                                      

                                      upsd.conf

                                      LISTEN 127.0.0.1
                                      LISTEN ::1
                                      
                                      
                                      LISTEN 192.168.1.1
                                      

                                      upsd.users

                                      [admin]
                                      password=***************
                                      actions=set
                                      instcmds=all
                                      [local-monitor]
                                      password=***************
                                      upsmon master
                                      
                                      
                                      [client-xx1]
                                      password = ***************
                                      upsmon slave
                                      
                                      [client-xx2]
                                      password = ***************
                                      upsmon slave
                                      
                                      dennypageD 1 條回覆 最後回覆 回覆 引用 0
                                      • dennypageD
                                        dennypage @endy66
                                        最後由 編輯

                                        @endy66 And the output of

                                        netstat -a -n | grep 3493
                                        

                                        please.

                                        E 1 條回覆 最後回覆 回覆 引用 0
                                        • E
                                          endy66 @dennypage
                                          最後由 編輯

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

                                          @endy66 And the output of

                                          netstat -a -n | grep 3493
                                          

                                          please.

                                          netstat -a -n | grep 3493
                                          tcp4       0      0 192.168.1.1.3493       192.168.1.8.33624      ESTABLISHED
                                          tcp6       0      0 ::1.3493               ::1.2785               ESTABLISHED
                                          tcp6       0      0 ::1.2785               ::1.3493               ESTABLISHED
                                          tcp4       0      0 192.168.1.1.3493       *.*                    LISTEN
                                          tcp6       0      0 ::1.3493               *.*                    LISTEN
                                          tcp4       0      0 127.0.0.1.3493         *.*                    LISTEN
                                          
                                          dennypageD 1 條回覆 最後回覆 回覆 引用 0
                                          • dennypageD
                                            dennypage @endy66
                                            最後由 編輯

                                            @endy66 In the output I see one local connection and one remote connection.

                                            The local connection will be upsmon, and is the one that is on ::1.2785 -> ::1.3493. This will be user local-monitor. You can easily confirm this with

                                            sockstat -c | grep 3493
                                            

                                            The local upsmon connection should generate a log entry like this,

                                            Feb  1 08:01:20 fw upsd[45590]: User local-monitor@::1 logged into UPS [CyberPower_USV]
                                            

                                            however you did not show such a log entry. Given that you clearly have a local upsmon connection, there absolutely should be a corresponding log entry.

                                            The remote connection is on 192.168.1.8.33624 -> 192.168.1.1.3493. This presumably is one of your client-xx users.

                                            In sort, your config files are good. Your netstat output is good, with one remote connection [there is no second remote connection]. The only thing is that I cannot reconcile your configuration files and netstat output with the log entries that you posted.

                                            Is it possible that you made configuration changes between when the logs were taken and when the config files / netstat output were taken?

                                            E 1 條回覆 最後回覆 回覆 引用 0
                                            • 第一個貼文
                                              最後的貼文
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.