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.
    • dennypageD
      dennypage
      last edited by

      @bulldog5:

      One other question I had, I've been seeing every 2hours or so COMMBAD  COMMOK within 5second polls.  I'm using the default usbhid driver.  Have you seen this happen before?

      I've not experienced this specific issue personally, but I have had some strange issues with CyberPower units. It could be the result of either a UPS issue or a USB issue. First thing I would check would be the physicals: good USB cable, direct connection with no hub, etc. Assuming that you are satisfied with the hardware connection, my only other suggestion would be to try increasing the pollinterval (ups.conf) to 5 or 10 seconds to see if that helps.

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

        Its a brand new unit, literally just hooked it up yesterday. USB cable everything is good. It will be fine for hours. then it does a single UPS lost, UPS established.

        (no tty) at 16:36 CDT…

        Communications with UPS ups lost

        (no tty) at 16:36 CDT...

        Communications with UPS ups established

        1 Reply Last reply Reply Quote 0
        • A
          AR15USR
          last edited by

          @bulldog5:

          Its a brand new unit, literally just hooked it up yesterday. USB cable everything is good. It will be fine for hours. then it does a single UPS lost, UPS established.

          (no tty) at 16:36 CDT…

          Communications with UPS ups lost

          (no tty) at 16:36 CDT...

          Communications with UPS ups established

          I get this same thing, when I switch usb ports it stops doing it. I think its a usb2 vs 3 thing, at least on mine..


          2.6.0-RELEASE

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

            Hello

            Nice nice feature with this plugin

            When battery is low the NUT service does send a signal ?
            Or I have something to do ?

            Thanks for help

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

              When the UPS enters a low battery state NUT initiates a shutdown.

              1 Reply Last reply Reply Quote 0
              • M
                McFuzz
                last edited by

                Hello!

                Is there a tutorial to get email notifications to work? I have the checkbox ticked, but when I tested by putting the UPS on battery power (yanking power cord), it did not produce any notifications… I had it all working before upgrading to 2.3.2_1 and NUT upgrading to 2.4.7_2... but seems like things are a whole lot different now.

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

                  Have you sucessfully tested emails in System Advanced / Notifications / E-Mail following the upgrade?

                  1 Reply Last reply Reply Quote 0
                  • M
                    McFuzz
                    last edited by

                    @dennypage:

                    Have you sucessfully tested emails in System Advanced / Notifications / E-Mail following the upgrade?

                    Yes I have - and indeed they are coming through. I have not done any additional configurations in the UPS Settings -> Advanced Settings section… am I supposed to configure anything there aside from ticking the checkbox?

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

                      You did a save of the NUT settings after ticking the checkbox, yes?

                      Please post the contents of /usr/local/etc/nut/upsmon.conf.

                      1 Reply Last reply Reply Quote 0
                      • M
                        McFuzz
                        last edited by

                        @dennypage:

                        You did a save of the NUT settings after ticking the checkbox, yes?

                        Please post the contents of /usr/local/etc/nut/upsmon.conf.

                        Yup - I did.

                        Here are the contents of upsmon.conf - I did not modify it yet; want to first get the defaults working:

                        
                        MONITOR BX1300G 1 monuser a620bdded832fb08439a master
                        SHUTDOWNCMD "/sbin/shutdown -p +0"
                        POWERDOWNFLAG /etc/killpower
                        NOTIFYCMD /usr/local/pkg/nut/nut_email.php
                        NOTIFYFLAG ONLINE   SYSLOG+WALL+EXEC
                        NOTIFYFLAG ONBATT   SYSLOG+WALL+EXEC
                        NOTIFYFLAG LOWBATT  SYSLOG+WALL+EXEC
                        NOTIFYFLAG FSD	  SYSLOG+WALL+EXEC
                        NOTIFYFLAG COMMOK   SYSLOG+WALL+EXEC
                        NOTIFYFLAG COMMBAD  SYSLOG+WALL+EXEC
                        NOTIFYFLAG SHUTDOWN SYSLOG+WALL+EXEC
                        NOTIFYFLAG REPLBATT SYSLOG+WALL+EXEC
                        NOTIFYFLAG NOCOMM   SYSLOG+WALL+EXEC
                        NOTIFYFLAG NOPARENT SYSLOG+WALL+EXEC
                        
                        

                        Naturally, I browsed through nut_email.php and noticed that it is referencing to a file called notices.inc:

                        
                        require_once("notices.inc");
                        
                        

                        However - can't find that file anywhere…

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

                          @McFuzz:

                          Naturally, I browsed through nut_email.php and noticed that it is referencing to a file called notices.inc:

                          
                          require_once("notices.inc");
                          
                          

                          However - can't find that file anywhere…

                          You should find this as /etc/inc/notices.inc.

                          The contents of upsmon.conf look fine. Please run the following:

                          echo "hello" | /usr/local/pkg/nut/nut_email.php
                          

                          What happens?

                          1 Reply Last reply Reply Quote 0
                          • M
                            McFuzz
                            last edited by

                            @dennypage:

                            @McFuzz:

                            Naturally, I browsed through nut_email.php and noticed that it is referencing to a file called notices.inc:

                            
                            require_once("notices.inc");
                            
                            

                            However - can't find that file anywhere…

                            You should find this as /etc/inc/notices.inc.

                            The contents of upsmon.conf look fine. Please run the following:

                            echo "hello" | /usr/local/pkg/nut/nut_email.php
                            

                            What happens?

                            Yup - notices.inc is in /etc/inc

                            Attempted to execute the command - all I got was an email that simply had a timestamp; nothing else… was I supposed to see "hello" in the body?

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

                              Sorry, my bad. It should have been:

                              /usr/local/pkg/nut/nut_email.php hello
                              

                              And yes, the content of the email should be like this:

                              Fri, 07 Oct 2016 00:09:55 -0700
                              hello
                              

                              If you receive this, it means that your email notifications are working.

                              1 Reply Last reply Reply Quote 0
                              • M
                                McFuzz
                                last edited by

                                @dennypage:

                                Sorry, my bad. It should have been:

                                /usr/local/pkg/nut/nut_email.php hello
                                

                                And yes, the content of the email should be like this:

                                Fri, 07 Oct 2016 00:09:55 -0700
                                hello
                                

                                If you receive this, it means that your email notifications are working.

                                Yup - that worked; got an email with "hello" in it.

                                So what's wrong with the automatic notifications? :(

                                I just tried it again (saved the settings, for a good measure) - yanked the power off the UPS so it goes on battery power… got the notification within the shell session, but no email :(

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

                                  Assuming that your email notifications are working…

                                  When you pulled the cord, how long did you wait? If you were logged into pfSense, did you see a wall announcement?

                                  When you go to Services / UPS / Status with the cord pulled, what do you see?

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

                                    Are you affected by this bug?

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

                                    1 Reply Last reply Reply Quote 0
                                    • M
                                      McFuzz
                                      last edited by

                                      @dennypage:

                                      Assuming that your email notifications are working…

                                      When you pulled the cord, how long did you wait? If you were logged into pfSense, did you see a wall announcement?

                                      When you go to Services / UPS / Status with the cord pulled, what do you see?

                                      I just gave it another shot:

                                      • Disconnected power
                                      • pfsense shell session indicated the UPS being on battery
                                      • UI dashboard as well as Services -> UPS both indicated the UPS needed attention (and showed it discharging)
                                      • Waited a minute and plugged back in
                                      • Shell session indicated the UPS was back on line power practically right away
                                      • UI dashboard reflected power restoration and shows the UPS as charging.
                                      1 Reply Last reply Reply Quote 0
                                      • M
                                        McFuzz
                                        last edited by

                                        @dennypage:

                                        Are you affected by this bug?

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

                                        Hooray! That worked!!!!!

                                        Thank you :)

                                        So yeah - I guess I am affected :x

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

                                          You're welcome. I'm glad it worked for you.

                                          1 Reply Last reply Reply Quote 0
                                          • E
                                            endy66
                                            last edited by

                                            Since yesterday, i have also an brand new UPS, one from CyberPower. I installed the nut package and everything is working as expected. Thanks to this thread, i could set the override.battery.charge.low to shutdown my pfsense earlier.
                                            But now i have one question, i don't know, if this is the rigt Forum to ask this: I want to shutdown a Linux/Debian Server, which should get the data from the pfsense. So i have added in the upsd.users inside the box of the nut Settings the following:

                                            
                                            [client]
                                            password = mypass
                                            upsmon slave
                                            
                                            

                                            And in the upsd.conf box

                                            
                                            LISTEN 192.168.1.1
                                            
                                            

                                            On the Server i installed the nut-Client package (apt-get install nut-Client). With this command

                                            
                                            upsc CyberPower_USV@192.168.1.1
                                            
                                            

                                            i can get all the data from the pfsense (UPS)

                                            But how can i make, that the Server also shuts down, when the pfsense box is shutting down?

                                            EDIT// Everything is working now, i had to set the MODE=netclient on the Server.

                                            But i found a Problem with the override values. As i said above, i have set the following to the additional ups.conf field in pfSense:

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

                                            BUT These values are added on top of the ups.conf file, which means in my case, they are ignored. When i edit the ups.conf manually from ssh / Shell, and set thes override values at the bottom of the file and restart the daemon, the everything works and also the Monitoring in pfsense Show the new values. Is this a bug? Problem is, after reboot or restart the daemon, These values are not the anymore…

                                            Best Regards

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