Why am I no longer receiving daily emails with the cPanel update log output after updating to version 82?
After cPanel update to v82.0.6 the cPanel Update daily email stopped. I am one that likes to see this email. The current cron update line currently looks like this:
(/usr/local/cpanel/scripts/fix-cpanel-perl; /usr/local/cpanel/scripts/upcp --cron > /dev/null)
What should it look like to enable the email again?
Thank you.
-
Hello @SJR, This is by-design as of cPanel & WHM version 82 per the below case: Fixed case CPANEL-26113: Suppress unwanted output during scheduled upcp runs which would mail the configured system contacts. "cPanel Update Failures" is an alert type you can configure under the Notifications tab in WHM >> Contact Manager. If you want to receive an email after every cPanel update whether it fails or succeeds, see the solution below: [COLOR=rgb(41, 105, 176)]Edit note: A user-submitted workaround is available 0 -
Thank you Michael. Since I don't log into WHM on a regular basis, this email lets me know when there has been a cPanel version update. It's a reminder for me to log into WHM, read the Change Log, News, check Security Advisor (reboot if needed), and do other general checks & updates. It works for me. 0 -
Michael - I made the change to the line and saved the file. After saving the file, I checked the saved file and the new settings are saved. However, when the new script runs, and I get the email as I should, the file is then re-written again with the code: /dev/null) at the end of the line. The new date and time of the file is immediately after the script runs. And thus, again the email will no longer be sent. Is there anything I can do to stop the line from being re-written back to the no-email version? Thank you. 0 -
If we enable the "cPanel Update Failures" what kinds of failures will we get notified about? From memory, yum update issues (dependency issues) are not considered, failures, so you never got notified. They only way that we catch these are by parsing/reviewing the emailed logs. 0 -
Michael - I made the change to the line and saved the file. After saving the file, I checked the saved file and the new settings are saved. However, when the new script runs, and I get the email as I should, the file is then re-written again with the code: /dev/null) at the end of the line. The new date and time of the file is immediately after the script runs. And thus, again the email will no longer be sent. Is there anything I can do to stop the line from being re-written back to the no-email version? Thank you.
I also would like to know how to make this change stick. I'm another one who liked these emails. IMHO this should've been made a configurable setting.0 -
I agree with SJR. The old update notification behavior should be an option in the WHM Contact Manager configuration. Even when the overall update process succeeds there are often errors and warnings that can be useful to know about. It's also very useful to know when cPanel has been updated to a new version. It makes it quicker to track down any sudden screwy behavior. 0 -
We also us these emails to see what day new versions of cPanel will hit (when they are blocked to spread updates over a number of days). It's much more efficient to scan the emails vs. having to log into lots of lots of servers to check the notice / get the date. 0 -
Hello Everyone, I've tested and confirmed the suggested workaround (e.g. modifying the cron job) isn't valid because it's not preserved through additional updates. I also would like to know how to make this change stick. I'm another one who liked these emails. IMHO this should've been made a configurable setting.
It's also very useful to know when cPanel has been updated to a new version. It makes it quicker to track down any sudden screwy behavior.
Even when the overall update process succeeds there are often errors and warnings that can be useful to know about.
It's much more efficient to scan the emails vs. having to log into lots of lots of servers to check the notice / get the date.
If we enable the "cPanel Update Failures" what kinds of failures will we get notified about? From memory, yum update issues (dependency issues) are not considered, failures, so you never got notified. They only way that we catch these are by parsing/reviewing the emailed logs.
This is all very helpful feedback. I'm going to consider this in my research into a more suitable workaround. I'll update this thread shortly with more information. Long-term, voting and adding feedback to the following feature request is the most effective way to provide this functionality directly in the product:0 -
Hello Everyone, To have the full upcp output sent to you via email in cPanel & WHM version 82 or newer, you could create a custom bash script that emails the contents of /var/cpanel/updatelogs/last
to the email contact of your preference, and then add the script as a new cron job that runs +1 hour after the cPanel update cron job. Edit note: A user-submitted workaround is available0 -
If we enable the "cPanel Update Failures" what kinds of failures will we get notified about? From memory, yum update issues (dependency issues) are not considered, failures, so you never got notified. They only way that we catch these are by parsing/reviewing the emailed logs.
You can find a full list and description of each contact notification type on the document below: /usr/local/cpanel/Cpanel/Update/Now.pm
(there are numerous failure checks). Let me know if this helps. Thank you.0 -
Thank you cPanelMichael, for providing the bash script. It works fine. Is this the future of cPanel, replacing functionality broken by the development team with shell script alternatives? 0 -
Thanks for providing that. I've spent well over an hour trying to troubleshoot these emails only to find out it was by design... I guess I did not read the design notes more carefully, but when you make a major change like that, it would be nice to have a little box come up to tell us about it the first time we log into WHM. The reason I want these: because LFD tells me about what's changed every day, and I correlate these changes against the UPCP output. 0 -
The reason I want these: because LFD tells me about what's changed every day, and I correlate these changes against the UPCP output.
Same here. Every time i get a notification from LFD telling me that some file has changed, i immediately check that against the updates mentioned in the last UPCP email. Also, getting those messages is a way for me to know that the servers are still alive. If for whatever reason the email system fails, the server won't have any way to notify me, which might be interpreted as an "all is well" if i only expect to receive failure messages.0 -
@cPanelMichael Thanks for the workaround... Was it also by design that upon changing the cron job time in WHM that > /dev/null is removed, thus causing the email to go one one time and then suppress it again? Not sure of the logic of that other than confirming the new run time. I too depend upon these emails for the reasons mentioned above, particularly cPanel version updates. I will upvote the feature request to make it a setting option. It seems to me that there should be two categories of fixes: those that CHANGE functionality, and those that don't. I often miss such changes because of the shear number of fixes in the updates, and it is easy to miss one amid the list unless you happen to be looking for it and know what to search for. Changes like this should be called out in a separate section of the change log, IMO. -Pete 0 -
Thank you @cPanelMichael for your work-around. Your suggested bash script sent email with /var/cpanel/updatelogs/last as an attachment. I would rather read the output in my mail program, and finding some advice after search, resorted to this: 20 4 * * * ( echo "Subject: cPanel Update Log (upcp)"; cat /var/cpanel/updatelogs/last ) | /usr/sbin/sendmail email-address@domain.tld
Incidentally, only one line of code (in crontab) is needed.0 -
Hello, I too have experienced no emails since 05/Aug/2019. How do I enable my emails again? Do I log into root and remove the line: /dev/null from the following? 23 2 * * * (/usr/local/cpanel/scripts/fix-cpanel-perl; /usr/local/cpanel/scripts/upcp --cron > /dev/null) Regards, L 0 -
Do I log into root and remove the line: /dev/null
Removing /dev/null is ineffective because it will be replaced with the next daily update. The solution offered by David Colter is the best. (Until the cPanel development team fixes what they broke.) Be sure to vote and comment on the feature request for getting this fixed:0 -
If I use David Colter solution do I just add that one liner to my cron job? I'm guessing I don't need to fiddle about with bash right?
Nope, no bash needed. Note though, you do have to modify David's one liner for, at the very least, your email address and cron time.0 -
Nope, no bash needed. Note though, you do have to modify David's one liner for, at the very least, your email address and cron time.
Thanks. It's been working well for the past few days and no deletion from cpanel updates. I just realized today my cpanel log wasn't sending me the current log because cron job was executing 3 minutes earlier than the cpanel log update so I was getting yesterday log instead of current today log. All fixed now after moving the hour forward. Regards, L0 -
Well, huh! I have two servers that this thread's email crontab command has been messed with. One server it was entirely deleted, the second edit: the cPanel command replaced the email entry (but kept the new time). Anyone else having similar issues? Edit: So, cPanel, ya do regex'es on crontab don't ya? {removed, italics updated above} So... AFAICT it is not safe to add entries to cron that in any way contain bits or pieces of existing (or future!) cPanel root contrab entries. Back to a bash script it is... Edit: see next post 0 -
Edit note: A user-submitted workaround is available here.
Hi cPanelMichael, Would you scan this as a quick QC? Especially looking for other cPanel processes or things that might impact the offered solution? Also, would there physically be a way to add a user section to crontab such that cPanel doesn"t regex through that part? I don"t mind adding a feature request, but kinda pointless if it"s not actually do-able... Thanks, Michael PS: Are edits now closed on older posts? If so, would you edit my #20 to remove those instructions and link here? ( ) # # # Okay, this is long winded, and addresses the issue that you want an exact replication of the original emails being sent by cron so that you don"t have to change email filters (or other flagging logic). As well as addressing that we can"t use existing text from cPanel commands in crontab (as cPanel"s regex frags stuff then). Before following the below, change srv03, /root/bin/, /root/log/, and whatever else is appropriate for your system setup. Copying everything and doing global replaces is probably easiest... # # # Access the server via SSH as root Commands: [CODE=bash] hostname | awk -F'.' '{print $1}' hostname crontab -l
I use the first part of the hostname (srv03 in this example) for naming the script below. Add ~20 minutes to the time of the cPanel /usr/local/cpanel/scripts/upcp line for the crontab entry below. [CODE=bash] cd pwd
You"re hopefully in /root. If you"re not, adjust code and instructions accordingly. [CODE=bash] mkdir log mkdir bin cd bin nano root-crontab-additions-srv03-01.sh
Copy/paste into nano: [CODE=bash] #!/bin/bash # # # Description # Send emails with the cPanel update log # # Script=root-crontab-additions-srv03-01.sh # Author=Michael # Email=use website contact # Website=http://www.inet-design.com/ # License=GPL # Script repository=none # Last Edit Date=Mon Aug 19 11:03:46 CDT 2019 # # Note: Should have used sendmail EOF instead of pipes, but throwaway script... # # # # crontab entry # 57 2 * * * /root/bin/root-crontab-additions-srv03-01.sh >>/root/log/root-crontab-additions-srv03-01.sh.log 2>&1 # # # # Be Very Nice renice -n 19 -p $$ >/dev/null 2>/dev/null # # # # # # CurrDateTime=$(date +"%y-%m-%d %H:%M:%S") echo "$CurrDateTime: # # # Starting # # #" # # # Variable Setups SendMailTo="{copy from an existin email}" SendMailFrom="{copy from an existing email}" SendMailSubject="{copy from an existing email}" SendMailBody=`cat /var/cpanel/updatelogs/last` ( echo "To: $SendMailTo"; echo "From: $SendMailFrom"; echo "Subject: $SendMailSubject"; echo "$SendMailBody" ) | /usr/sbin/sendmail "$SendMailTo" EXITCODE=("${PIPESTATUS[@]}") TESTVAR="${EXITCODE[0]}" if [ "$TESTVAR" -ne 0 ] ; then Message01='Echo had issues: ' Message02="$TESTVAR" CurrDateTime=$(date +"%y-%m-%d %H:%M:%S") echo "$CurrDateTime: $Message01$Message02" echo "$CurrDateTime: # # # Exited with Errors # # #" exit 1 fi TESTVAR="${EXITCODE[1]}" if [ "$TESTVAR" -ne 0 ] ; then Message01='Sendmail had issues: ' Message02="$TESTVAR" CurrDateTime=$(date +"%y-%m-%d %H:%M:%S") echo "$CurrDateTime: $Message01$Message02" echo "$CurrDateTime: # # # Exited with Errors # # #" exit 1 fi CurrDateTime=$(date +"%y-%m-%d %H:%M:%S") echo "$CurrDateTime: # # # Finished # # #" exit
Close and save nano: [CODE=bash] CTRL-X Y
Set the execution bit and do a test: [CODE=bash] chmod +x root-crontab-additions-srv03-01.sh ./root-crontab-additions-srv03-01.sh
Check your email. Fix what needs fixing... [CODE=bash] crontab -e
Copy/Paste the crontab entry line from root-crontab-additions-srv03-01.sh to a bottom blank line (remove the comment mark "#"). # # # I tested the script, but if you have issues post what happened (as it"s just too easy to typo, or bad copy/paste, a stream of commands like this). Best All, Michael0 -
Hello Everyone! I mentioned this thread in an internal discussion about this topic and wanted to share some notes: " One of the primary goals of this change was to improve the signal-to-noise ratio in cPanel & WHM to avoid confusion from customers that see the successful upcp email notification and are unable to assert the meaning of the log output. " The existing every change made on the system by cPanel & WHM (as opposed to just upcp) and would be readily available for viewing from the command line or as part of Contact Manager. If anyone on this thread thinks this is a good idea, open a new feature request for it in the following format and then share the link here: [QUOTE]As a {cPanel User, System Administrator, web-hosting provider, or any other user perspective}, I would like {the feature that is being requested} so that {benefit that the request adds to the product}.
@Michael-Inet, I updated your earlier post with a link to the updated workaround instructions. Thanks for putting time into this and sharing the workaround! The SSP repo on cPanel's GitHub is useful if you're interested in examples of how to interact with cPanel & WHM from a script level (it's in Perl, but it's still helpful to read without a Perl background). It's available at:0 -
Hi cPanelMichael, You"re welcome for the script work. - I mentioned this thread in an internal discussion about this topic and wanted to share some notes: - I updated your earlier post with a link to the updated workaround instructions. - The SSP repo on cPanel's GitHub is useful if you're interested in examples of how to interact with cPanel & WHM from a script level (it's in Perl, but it's still helpful to read without a Perl background). It's available at:
I"ll add my thoughts here, but if there is somewhere else you think I should add them too, I can do that as well. (Open a new topic for this discussion alone?) Trying to reduce the signal-to-noise ratio is a good thing, it is pretty high, but... The existing feature request is acceptable, but really it"s just replacing what was deleted. The idea of an "audit log" is probably the best idea I"ve seen, but... # # # I"ve already stated this, but AFAICT all of the solutions given basically boils down to a solution that requires a user to routinely log in to a potentially compromised system and as such is a "bad" solution. (Although on re-read, I"m not sure what "as part of Contact Manager" encompasses, so maybe not?) So, before I modify and add something "audit log"(ish) as a feature request, let"s discuss it and work out it"s flaws so it"s useful as a whole? My thoughts: - It must be able to be sent in email. So that any change can be compared against whatever "System Integrity checking detected a modified system file" type report (csf/ldf, etc.) the user has setup. - It preferably tells the user what specially has changed. It"d be helpful if it went beyond telling what packages were updated and also told what files, user accounts, crontab entries, and such were modified. (Currently, for not well known files, we have to find a non-updated server and run "yum whatprovides" to match changed files to updated packages.) - It should encompass everything that gets updated or changed. - It should, or should be able to, be received in basically real time. - It does not have to contain the entire log output. Raw log output is definitely a noise "issue." Granted most of us now know how to skim them well, but I can see that if they are just attached and the body is the summarized change report, it"d be significantly easier for everyone. # # # That"s a first pass, but I"m sure I"ve missed elements that should, or would be really useful to, be included. I"m also sure that it would greatly help the feature request for whatever is decided to be re-written by cPanel to use cPanel jargon, procedures, and process names. Best, Michael0 -
Thanks - I had the same problem /Jonas A. 0 -
So, before I modify and add something "audit log"(ish) as a feature request, let"s discuss it and work out it"s flaws so it"s useful as a whole? My thoughts:
Going though the actual usage is useful! (Just had 2 servers get updated.) I would add this as well:- Display in the email's body text the server's information (fully qualified name, IP address, ?).
0 -
What an annoying thing to have to manually fix myself a vital function that has worked well for an age. Whoever thought that it was better to just KILL notifications instead of giving us a UI setting to choose between "Mail Full Log, Success and Failure notifications only, Failure notifications only" reeeeeaaaallly wasn't thinking clearly. All sorts of important information about upgrade blockers, file integrity violations and more are found in that log file. 0 -
Hello @Michael-Inet, The discussion and feedback for the new feature request (e.g. an audit log) is likely to see more participation on the feature request website itself (via the comments section once it's opened). Feel free to share the feature request URL here once you submit it and I can share the link internally. Thanks! 0 -
The discussion and feedback for the new feature request (e.g. an audit log) is likely to see more participation on the feature request website itself (via the comments section once it's opened). Feel free to share the feature request URL here once you submit it and I can share the link internally.
Hi Michael, You have always been knowledgeable and conscientious, so it saddens me that the recent cPanel pricing and structure decision I"ve just become aware of is causing my company to migrate completely away from WHM/cPanel. As such, this is most likely my last post, and is basically only being done as a personal favor to yourself. I don"t know if Oakley Capital Investments will maintain a decent employee experience, but if they don"t, I (and many others here) will gladly give you a glowing letter of recommendation if you ever find yourself wanting one. All you need to do is ask! Good by for now and Best Regards, Michael0
Please sign in to leave a comment.
Comments
32 comments