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
-
@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.
"cron" itself is a pfSense package :
it permits you to show the already present cron tasks, and add your own.
-
-
@Gertjan :) first message
-
-
-
-
@luckman212 Confirmed that if you change
notify_via_smtp($msg);
tonotify_all_remote($msg);
it will pick up the configuration of Slack and send the notification$msg
property to Slack as well. -
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. -
-
@DominikHoffmann not sure if you've tried the existing script, but it works as is with email. No changes required for me. Cheers!
-
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?
-
@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.
-
@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? -
@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.
-
@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
-
@wgstarks Permissions?
-
@provels
Actually it was missing completely. After upgrading from a 3100 to my 4200 many (or maybe all) packages were missing so it's not surprising that this script was also missing. Re-created it with the permissions you showed and all is working now.
Thanks -
That's not a pfSense package so it won't be added when restoring a config unless you've used the filer pkg.
-
-
@stephenw10 said in Auto update check, checks for updates to base system + packages and sends email alerts:
That's not a pfSense package so it won't be added when restoring a config unless you've used the filer pkg.
Thanks. The filer package looks like it could be useful. I’ll have to install it and give it a try.
-
-
To clarify, if there are no updates to any of the packages, does this script still send an email at the times as specified in your cron job? Thanks!
-
@MarinSNB said in Auto update check, checks for updates to base system + packages and sends email alerts:
To clarify, if there are no updates to any of the packages, does this script still send an email at the times as specified in your cron job? Thanks!
No. At least not in my case. I only get an email when an update exists.
-
@stephenw10 said in Auto update check, checks for updates to base system + packages and sends email alerts:
That's not a pfSense package so it won't be added when restoring a config unless you've used the filer pkg.
This question is way off topic for this thread (apologies) but since it looks like the filer pkg docs have been removed from pfsense docs perhaps you can tell me how to use filer to modify what is backed up by the auto config backup? I see a sync tab but the help link just links back to the full pfsense docs.
-
@wgstarks sounds good! That is what is am finding out here too! Thanks much!
-
@MarinSNB said in Auto update check, checks for updates to base system + packages and sends email alerts:
To clarify, if there are no updates to any of the packages, does this script still send an email at the times as specified in your cron job? Thanks!
It's 'open source' ;)
As the script language is somewhat backed up English, it says :
If the 'message' ($msg) is not empty (so there was a message ! == thing to update/upgrade) then
87) log a message in to system log ( here : StatusSystem LogsSystemGeneral )
88) show the message on the command line (visible if you executed the command yourself)
89) and... send/notify the message by mail.I 'see' you thinking : is it really that simple ? Yes, it is.