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 25.7k 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.
    • GrimsonG
      Grimson Banned @Raffi_
      last edited by

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

      I notice the email notification mentioned updating packages that are not in the package manager via pkg update.

      Probably those: https://forum.netgate.com/topic/140637/update-pfsense-packages-to-protect-against-nginx-libzmq4-and-curl-vulnerabilities you better update them.

      1 Reply Last reply Reply Quote 1
      • Raffi_R
        Raffi_
        last edited by

        @Grimson Thanks for the link. Yes, those were the exact updates which came up. I went ahead and updated them when I got the email notification thanks to the script. I'm on 2.4.4-p2. Wow they were major security updates I wouldn't have known about with this script. You learn something new everyday.

        Thanks for the help and education guys.
        Raffi

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

          @raffi_ The post you linked to was pretty old. Updating via console should be safe as long as you have not messed with the repos. It's basically the same process that occurs when you update via the GUI, as pkg is always used anyway.

          1 Reply Last reply Reply Quote 1
          • Raffi_R
            Raffi_
            last edited by

            @luckman212 Awesome, thanks for the explanation. You're being too modest :)
            I learned your script is not the same as the GUI update, it's actually better! The GUI didn't tell me about those vulnerabilities in the packages which required updating, but your script did.

            Raffi

            1 Reply Last reply Reply Quote 0
            • C
              counterfeit7845 @luckman212
              last edited by

              This post is deleted!
              1 Reply Last reply Reply Quote 0
              • O
                Overlord
                last edited by

                Nice plugin - has anybody made an Nagios or CheckMK plugin out of it?

                R 1 Reply Last reply Reply Quote 0
                • R
                  raidflex @Overlord
                  last edited by

                  Will this script work with the built in pushover notifications enabled or do I need to still use SMTP?

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

                    @raidflex Not the original one, but here's a quick modified version that should work, I haven't tested it so please give it a try.

                    R 1 Reply Last reply Reply Quote 2
                    • R
                      raidflex @luckman212
                      last edited by

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

                      @raidflex Not the original one, but here's a quick modified version that should work, I haven't tested it so please give it a try.

                      Looks to be working properly, thank you for the updated script!

                      1 Reply Last reply Reply Quote 0
                      • GertjanG Gertjan referenced this topic on
                      • GertjanG Gertjan referenced this topic on
                      • P
                        pyrodex
                        last edited by

                        I love this script but I modified it ever so slightly to notify all configured methods setup in pfSense. If you find the line "notify_via_smtp($msg);" and replace it with "notify_all_remote($msg);" it will send out notifications to ALL configured methods. I've tested this and it works well.

                        Thanks for all the hardwork!

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

                          @pyrodex Thanks for that contribution. I added it to the gist. One day I hope I can turn this into a proper package that has a GUI-configurable alert mode setting.

                          1 Reply Last reply Reply Quote 2
                          • GertjanG Gertjan referenced this topic on
                          • luckman212L luckman212 referenced this topic on
                          • luckman212L luckman212 referenced this topic on
                          • fireodoF fireodo referenced this topic on
                          • K khorton referenced this topic on
                          • D
                            DominikHoffmann
                            last edited by

                            Will this get wiped out from /root/ when a system update is installed?

                            GertjanG Raffi_R 2 Replies Last reply Reply Quote 0
                            • GertjanG
                              Gertjan @DominikHoffmann
                              last edited by

                              @DominikHoffmann

                              Fast answer :
                              Yes.
                              No.
                              Maybe.

                              Fill in the condition that will apply in the future' and then one of the 3 answers will be valid.

                              I'll explain : when you upgrade to "MFS" (Marvelous File System, the next file system version that will be sued after the current ZFS) then the drive partitions will get reset : that's a total content loss.
                              And when you drive dies : that's a Yes.

                              An usual (up until now) GUI or console upgrade/update : That's a No.
                              (IMHO : I will never presume this No for granted)

                              Maybe : Netgate can decide that /root/ will be cleaned out in the future. Call them for more precise answers.

                              But the question was wrong ^^ Nothing lasts forever.
                              So, all that counts is : how to get back to a known working situation in case of emergency ?

                              Easy.
                              Install the pfSense Notes package.
                              It's identical to the Notes app in your phone.

                              Copy paste in there the source of the script.
                              Copy also the setting for the cron package (and thus the reminder that cron package needs to be installed also).
                              A link to this forum post so you can find the online "manual" right away, if needed.

                              Btw : keep on using Notes for any setting changes that you might want to remember after xx days/months/years.

                              Now your set up for pretty any situation ๐Ÿ˜Š

                              Or use the Filer package. never used that one myself, but you can make backups with that package.

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

                              D 1 Reply Last reply Reply Quote 2
                              • GertjanG Gertjan referenced this topic on
                              • Raffi_R
                                Raffi_ @DominikHoffmann
                                last edited by

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

                                Will this get wiped out from /root/ when a system update is installed?

                                This has been working for me since day one when I first posted in this thread in 2019 and it is still working after all the system updates since then.

                                1 Reply Last reply Reply Quote 2
                                • D
                                  DominikHoffmann @Gertjan
                                  last edited by

                                  @Gertjan: Thanks! Using Notes like that is a great idea. I will implement that. I am already in the habit of saving a backed up configuration, which I rename to include the data an a few words describing the modification.

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

                                    Yes I would expect it to be kept across almost all updates.

                                    Yes the filer package allows you to keep that in the config so it would be restore after an upgrade even if it was removed. Unless the filer package itself is removed. ๐Ÿ˜‰

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

                                      I personally use System Patches to store files in. It's easy to manage, and I'm pretty sure it's not going away. ๐Ÿ˜‰

                                      FWIW, to my mind, the filer package is a bit sketchy. It wants to delete newlines from the end of files that it creates. Even if the lack of a newline isn't a problem for the particular type of file (loader.conf.local or ntp-boot-time-servers), it still drives me nuts because the checksums don't match. And the "Leave blank to load an existing file from file system" functionality has been broken for years.

                                      1 Reply Last reply Reply Quote 1
                                      • Raffi_R
                                        Raffi_
                                        last edited by

                                        I always learn something new on here. I didn't realize there were so many ways to skin the same cat in terms of file level backups. I have been using the backup package for backing up my script. I didn't see that one mentioned.

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

                                          @Raffi_ It's a personal preference. The reason I prefer the System Patches or Filer package approach is that the information ends up being contained in the XML configuration file used for backup and restore.

                                          I store the XML configuration file (sans RRD and lease data) in a revision control system. I have firewall configs going back to 2013. Just in case. ๐Ÿ˜Š

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

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

                                            I have firewall configs going back to 2013.

                                            Nice. ๐Ÿ˜

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