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

NUT notifications not working on pfsense+

Scheduled Pinned Locked Moved General pfSense Questions
50 Posts 5 Posters 22.1k 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.
  • D
    dennypage @Austin 0
    last edited by Apr 22, 2023, 5:28 PM

    @austin-0 While we're at it, we might as well just do this:

    grep notify_monitor /var/log/system.log
    

    This will include the prior attempts as well.

    1 Reply Last reply Reply Quote 0
    • A
      Austin 0
      last edited by Apr 22, 2023, 5:33 PM

      @dennypage

      Apr 22 12:29:23 WhatAreRoutes kernel: ugen1.2: <CPS ST Series> at usbus1
      Apr 22 12:29:25 WhatAreRoutes upsmon[2348]: Poll UPS [OfficeUPS] failed - Driver not connected
      Apr 22 12:29:30 WhatAreRoutes php-cgi[74564]: notify_monitor.php: Message sent to ----- OK
      Apr 22 12:29:30 WhatAreRoutes upsmon[2348]: Poll UPS [OfficeUPS] failed - Driver not connected
      Apr 22 12:29:30 WhatAreRoutes kernel: ugen1.2: <CPS ST Series> at usbus1 (disconnected)
      Apr 22 12:29:34 WhatAreRoutes kernel: ugen1.2: <CPS ST Series> at usbus1
      Apr 22 12:29:35 WhatAreRoutes upsmon[2348]: Poll UPS [OfficeUPS] failed - Driver not connected
      Apr 22 12:29:40 WhatAreRoutes upsmon[2348]: Poll UPS [OfficeUPS] failed - Driver not connected
      Apr 22 12:29:41 WhatAreRoutes php-cgi[74564]: notify_monitor.php: Message sent to ----- OK
      Apr 22 12:29:42 WhatAreRoutes kernel: ugen1.2: <CPS ST Series> at usbus1 (disconnected)
      

      I replaced the email address with ----- in the output for privacy reasons. It was the correct email though. I also did get the notification email when running this test.

      A D 2 Replies Last reply Apr 22, 2023, 5:36 PM Reply Quote 0
      • A
        Austin 0 @Austin 0
        last edited by Apr 22, 2023, 5:36 PM

        Actually now it is spamming the email with the "this is a test" message.

        A D 2 Replies Last reply Apr 22, 2023, 5:39 PM Reply Quote 0
        • D
          dennypage @Austin 0
          last edited by Apr 22, 2023, 5:38 PM

          @austin-0 said in NUT notifications not working on pfsense+:

          I also did get the notification email when running this test.

          Meaning you received a notification from NUT saying that the UPS was not available? There are two successful indications in there.

          A 1 Reply Last reply Apr 22, 2023, 5:41 PM Reply Quote 0
          • A
            Austin 0 @Austin 0
            last edited by Apr 22, 2023, 5:39 PM

            And it was failing to get the UPS status until reseated the cable, and restarted the nut service.

            1 Reply Last reply Reply Quote 0
            • A
              Austin 0 @dennypage
              last edited by Apr 22, 2023, 5:41 PM

              @dennypage Yes however last time we tried that I also got the notifications when running the command. I just don't get them when I disconnect the UPS, or it switches to battery.

              1 Reply Last reply Reply Quote 0
              • D
                dennypage @Austin 0
                last edited by Apr 22, 2023, 5:51 PM

                @austin-0 said in NUT notifications not working on pfsense+:

                Actually now it is spamming the email with the "this is a test" message.

                Ah... there we go. See this Redmine entry for a patch.

                A 1 Reply Last reply Apr 22, 2023, 5:55 PM Reply Quote 0
                • A
                  Austin 0 @dennypage
                  last edited by Apr 22, 2023, 5:55 PM

                  @dennypage Thank you. We are currently live streaming. So it's not a good time to be installing patches, but once that is done I will try out the patch.

                  D 1 Reply Last reply Apr 22, 2023, 6:01 PM Reply Quote 0
                  • D
                    dennypage @Austin 0
                    last edited by Apr 22, 2023, 6:01 PM

                    @austin-0 said in NUT notifications not working on pfsense+:

                    We are currently live streaming. So it's not a good time to be installing patches, but once that is done I will try out the patch.

                    After installing the patch, you may also need to remove the existing notification files. And if a process is hung processing notifications, either kill it or reboot pfSense.

                    A 1 Reply Last reply Apr 22, 2023, 6:48 PM Reply Quote 0
                    • A
                      Austin 0 @dennypage
                      last edited by Apr 22, 2023, 6:48 PM

                      @dennypage Okay so I have never done this before, but from what I can tell I correctly entered th commit ID, but it is telling me it is invalid. What am I doing wrong here?

                      fd0a6e2f-fa15-4d7c-af2c-35496a00ac55-image.png

                      D 1 Reply Last reply Apr 22, 2023, 6:52 PM Reply Quote 0
                      • D
                        dennypage @Austin 0
                        last edited by Apr 22, 2023, 6:52 PM

                        @austin-0 Not sure, but you can try it in URL format:

                        https://github.com/pfsense/pfsense/commit/c5faa351c1ef6d4555478a7f50b3a16ece7e0b2a.patch
                        
                        A 1 Reply Last reply Apr 22, 2023, 7:05 PM Reply Quote 0
                        • A
                          Austin 0 @dennypage
                          last edited by Apr 22, 2023, 7:05 PM

                          @dennypage Thank you. I was able to install the package, and then rebooted. Notifications are still not being emailed to me when I unplugged the USB cable to the UPS. I did get the notifications for the actual reboot.

                          D 1 Reply Last reply Apr 22, 2023, 7:19 PM Reply Quote 0
                          • D
                            dennypage @Austin 0
                            last edited by Apr 22, 2023, 7:19 PM

                            @austin-0 Can you post the grep output please?

                            grep notify_monitor /var/log/system.log
                            
                            A 1 Reply Last reply Apr 23, 2023, 12:58 AM Reply Quote 0
                            • A
                              Austin 0 @dennypage
                              last edited by Apr 23, 2023, 12:58 AM

                              @dennypage Well I am no longer there and someone turned off the computer I usually use to remote in. So I won't be able to do this until Friday or Saturday.

                              D 1 Reply Last reply Apr 23, 2023, 5:11 PM Reply Quote 0
                              • D
                                dennypage @Austin 0
                                last edited by Apr 23, 2023, 5:11 PM

                                @austin-0 Okay, I just tested that patch. The effect is that all non root notifications silently fail. I've reached out to @jimp in the Redmine discussion.

                                In the interim, it appears that the only way you will be able to make it work is to have NUT run as root. You can do this by adding the line

                                RUN_AS_USER root
                                

                                to the "Additional configuration lines for upsmon.conf" section in Services / UPS / Settings / Advanced settings.

                                P 1 Reply Last reply Apr 23, 2023, 7:27 PM Reply Quote 0
                                • P
                                  pdavis @dennypage
                                  last edited by Apr 23, 2023, 7:27 PM

                                  @dennypage I am not getting email notifications from NUT either, and hope you can point me in the right direction.

                                  I have a Cyberpower UPS plugged into my pfSense box with a UPS, and the UPS is recognized fine within the GUI. If it is on battery, I get an alert in the GUI, but do not get an email through the normal pfSense process.

                                  I added the additional configuration to run NUT as root, and rebooted, but that did not work. See below for my upsmon.conf and nut_email.php files, and please let me know what I am missing - thank you!

                                  Screenshot 2023-04-23 152354.png

                                  Screenshot 2023-04-23 152505.png

                                  P 1 Reply Last reply Apr 23, 2023, 7:40 PM Reply Quote 0
                                  • P
                                    pdavis @pdavis
                                    last edited by Apr 23, 2023, 7:40 PM

                                    @pdavis @dennypage Sorry, Denny, scratch that last request - I just got the emails following the change to have NUT send as root, so all set!

                                    Thank you

                                    D 1 Reply Last reply Apr 23, 2023, 7:42 PM Reply Quote 0
                                    • D
                                      dennypage @pdavis
                                      last edited by Apr 23, 2023, 7:42 PM

                                      @pdavis Glad you have it working. I'm hoping that the requirement to run as root is temporary.

                                      A 1 Reply Last reply Apr 23, 2023, 7:53 PM Reply Quote 1
                                      • A
                                        Austin 0 @dennypage
                                        last edited by Apr 23, 2023, 7:53 PM

                                        @dennypage Well hopefully this works for me as soon as I get a chance to test it. I am curious as to what the security impacts of running the process as root would be. Would it not be better to change the access to whatever file nut needs access to?

                                        D 1 Reply Last reply Apr 25, 2023, 12:23 AM Reply Quote 0
                                        • D
                                          dennypage @Austin 0
                                          last edited by Apr 25, 2023, 12:23 AM

                                          @austin-0, @pdavis I have a PR in which will restore notification functionality. You can find it here if you want to follow it, or if you just want to grab the revised version of nut_email.php.

                                          G P A 3 Replies Last reply Apr 25, 2023, 7:12 AM Reply Quote 1
                                          40 out of 50
                                          • First post
                                            40/50
                                            Last post
                                          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                                            This community forum collects and processes your personal information.
                                            consent.not_received