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

    Auto update check, checks for updates to base system + packages and sends email alerts

    Scheduled Pinned Locked Moved Problems Installing or Upgrading pfSense Software
    87 Posts 22 Posters 34.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.
    • GertjanG
      Gertjan @DominikHoffmann
      last edited by

      @DominikHoffmann

      AFAIK, the script uses the same PHP lines that shows this :

      a63f4760-13e9-402d-b47e-87589bf07124-image.png

      I can't remember if I had received a mail from pfSense about "23.09.1" is available .... I' not sure, and already wiped notification mails from last month.
      edit : that a negative : 23.09.1 was last week ( ! ) : that means no mail from this script about "23.09.1". That's new, indeed. Something changed in the packet handling ? Not that I wasn't aware, as I've also the RSS feed mailing me if a new Netgate pfSense blog post is posted :
      c3d86de4-45c7-4b42-ae71-02abcc2a9bb3-image.png

      ... the forum and github are also good indicators ;)

      For me it's the other way around : I can't select the "Previous Stable version 23.09" :

      957f9e2c-1c01-43db-92b3-664aa2a3b5cb-image.png

      which is a don't care for me, as, if needed, I'll do the ZFS-magic-click and I'm back into "23.09" after reboot.

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

      1 Reply Last reply Reply Quote 0
      • stephenw10S
        stephenw10 Netgate Administrator
        last edited by

        It's because the upgrade scheme has changed. Previously we pushed the updated repo pkg and it changed the default pkg repo to the new branch. That then allowed the update check to see the new version and show it on the dashboard. But it also meant that users who didn't see it or ignored it and then tried to install pkgs could end up with bad pkgs and a broken install. We added numerous things to prevent this but none were infallible.
        In the the new upgrade scheme pfSense can check for release updates in all configured branches. That means we can show 23.09.1 as an available upgrade without switching the selected repo branch. When you click on the upgrade you have to select the new repo branch from the drop down to upgrade to it. You have to opt-in.

        But that also means that this script doesn't see that update since it only checks for available pkg upgrades in the current branch.

        It would need to run pfSense-upgrade -C to see available upgrades for all branches which i9s what the dashboard check now does.

        Steve

        luckman212L 1 Reply Last reply Reply Quote 0
        • luckman212L
          luckman212 LAYER 8 @stephenw10
          last edited by

          I'm in the process of upgrading my systems to 23.09.1 and will update this script shortly (if it's possible) to handle the new update mechanism.

          D GertjanG wgstarksW 5 Replies Last reply Reply Quote 2
          • D
            DominikHoffmann @luckman212
            last edited by

            This post is deleted!
            1 Reply Last reply Reply Quote 0
            • D
              DominikHoffmann @luckman212
              last edited by

              @luckman212: Looking forward to the update! Would you include a reply in this thread, when you’re done with that?

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

                @luckman212 said in Auto update check, checks for updates to base system + packages and sends email alerts:

                to handle the new update mechanism.

                It did tell me (mail) that the 'curl' package was available, a coupe of days ago. So, for me, it works ©

                Also : if the pfSense GUI doesn't show others pfSense version, like : Current ..., Previous .... or Development ... then this script can't do more neither.

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

                1 Reply Last reply Reply Quote 0
                • stephenw10S
                  stephenw10 Netgate Administrator
                  last edited by

                  The dashboard uses the new -C switch for pfSense upgrade to check all configured branches for newer release versions.

                  1 Reply Last reply Reply Quote 0
                  • D DominikHoffmann referenced this topic on
                  • GertjanG Gertjan referenced this topic on
                  • GertjanG Gertjan referenced this topic on
                  • stephenw10S stephenw10 referenced this topic on
                  • D
                    DominikHoffmann @luckman212
                    last edited by

                    @luckman212 said in Auto update check, checks for updates to base system + packages and sends email alerts:

                    I'm in the process of upgrading my systems to 23.09.1 and will update this script shortly (if it's possible) to handle the new update mechanism.

                    Hi! Did you ever get around to updating your script?

                    D 1 Reply Last reply Reply Quote 0
                    • JonathanLeeJ
                      JonathanLee
                      last edited by

                      What a gem of a thread!!!

                      Make sure to upvote

                      1 Reply Last reply Reply Quote 0
                      • JonathanLeeJ
                        JonathanLee @luckman212
                        last edited by

                        @luckman212 said in Auto update check, checks for updates to base system + packages and sends email alerts:

                        /usr/local/bin/php -q /root/pkg_check.php

                        Thank you

                        Make sure to upvote

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

                          @JonathanLee said in Auto update check, checks for updates to base system + packages and sends email alerts:

                          @luckman212 said in Auto update check, checks for updates to base system + packages and sends email alerts:

                          /usr/local/bin/php -q /root/pkg_check.php

                          Thank you

                          That's the command you paste into a cron task.

                          99fd6a4a-7257-466b-bbeb-650b2b1897bd-image.png

                          "cron" itself is a pfSense package :

                          601b4be5-844c-40ff-84ca-40abd0c2cb52-image.png

                          it permits you to show the already present cron tasks, and add your own.

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

                          JonathanLeeJ 1 Reply Last reply Reply Quote 1
                          • GertjanG Gertjan referenced this topic on
                          • JonathanLeeJ
                            JonathanLee @Gertjan
                            last edited by

                            @Gertjan :) first message

                            Screenshot 2024-07-18 at 11.12.03.png

                            Make sure to upvote

                            1 Reply Last reply Reply Quote 1
                            • JonathanLeeJ JonathanLee referenced this topic on
                            • provelsP provels referenced this topic on
                            • wgstarksW wgstarks referenced this topic on
                            • slmS
                              slm @luckman212
                              last edited by

                              @luckman212 Confirmed that if you change notify_via_smtp($msg); to notify_all_remote($msg); it will pick up the configuration of Slack and send the notification $msg property to Slack as well.

                              infra-alerts (Channel) - Lâmôlabs - Slack 2024-08-04 11-37-47.png

                              slmS 1 Reply Last reply Reply Quote 0
                              • slmS
                                slm @slm
                                last edited by

                                Incidentally...

                                WRT the Slack Bot/App setup I followed the example shown here - Slack Bot OAuth Access Token, and merely copied the Slack details into the Slack section under Systems -> Advanced -> Notifications. For the API Key it's the xoxb-... key for the Slack app.

                                1 Reply Last reply Reply Quote 0
                                • GertjanG Gertjan referenced this topic on
                                • D
                                  dereitz @DominikHoffmann
                                  last edited by

                                  @DominikHoffmann not sure if you've tried the existing script, but it works as is with email. No changes required for me. Cheers!

                                  1 Reply Last reply Reply Quote 0
                                  • wgstarksW
                                    wgstarks
                                    last edited by

                                    Should this script also send notifications for package updates? I noticed a few days ago that I had several package updates waiting to be installed but never got a notification. I used to get them but I believe Netgate has made some changes to Package Manager so not sure if its possible to get notifications anymore regarding updates?

                                    Box: SG-4200

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

                                      @wgstarks said in Auto update check, checks for updates to base system + packages and sends email alerts:

                                      Should this script also send notifications for package updates?

                                      Both pfSense packages, visible under System > Package Manage r>Installed Packages and non pfSense 'FreeBSD) packages (from the Netgate / pfSense repository) will send you a message / notification / mail.

                                      Examples of both are shown above. Check out what @slm and @JonathanLee showed.

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

                                      wgstarksW 1 Reply Last reply Reply Quote 1
                                      • wgstarksW
                                        wgstarks @Gertjan
                                        last edited by

                                        @Gertjan
                                        I think I need another cup of coffee this morning.😁
                                        The post should have said system patches not packages. Should I get notifications for new system patches?

                                        Box: SG-4200

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

                                          @wgstarks said in Auto update check, checks for updates to base system + packages and sends email alerts:

                                          Should I get notifications for new system patches?

                                          When new patches for the "System_Patches" are created, they are included in the "System_Patches" pfSense package. This will bump the version number. You see this as a new package, "System_Patches" avaible for you.

                                          Upgrade it, and have a look at the new patch or patches, and apply that interest you, or, by default, apply them all.

                                          c9b34a12-f2f0-4329-9190-924eef73e200-image.png

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

                                          wgstarksW 1 Reply Last reply Reply Quote 2
                                          • wgstarksW
                                            wgstarks @Gertjan
                                            last edited by

                                            @Gertjan
                                            Looks like I need to do some troubleshooting when I get home. When I try to run the command

                                            /usr/local/bin/php -q /root/pkg_check.php
                                            

                                            I get this-

                                            Could not open input file: /root/pkg_check.php
                                            

                                            Box: SG-4200

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