Why am I no longer receiving daily emails with the cPanel update log output after updating to version 82?

SJR

Active Member
Jan 2, 2017
27
1
3
USA
cPanel Access Level
Website Owner
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.
 

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,749
2,205
363
cPanel Access Level
DataCenter Provider
Twitter
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:

Edit note: A user-submitted workaround is available here.

Out of curiosity, is there anything in-particular you observe in the upcp output that you find helpful?

Thank you.
 
Last edited:

SJR

Active Member
Jan 2, 2017
27
1
3
USA
cPanel Access Level
Website Owner
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.
 

SJR

Active Member
Jan 2, 2017
27
1
3
USA
cPanel Access Level
Website Owner
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.
 

ffeingol

Well-Known Member
PartnerNOC
Nov 9, 2001
221
1
318
cPanel Access Level
DataCenter Provider
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.
 

jtaylor0522

Registered
Jul 20, 2013
3
0
1
cPanel Access Level
Root Administrator
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.
 

alpinist

Member
Jun 9, 2011
14
3
53
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.
 

ffeingol

Well-Known Member
PartnerNOC
Nov 9, 2001
221
1
318
cPanel Access Level
DataCenter Provider
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.
 

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,749
2,205
363
cPanel Access Level
DataCenter Provider
Twitter
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:


Comments are particularly helpful in helping us provide Development with information about why a feature is important to the cPanel Community. Here's an example of how to format your comment:

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}.

Thank you.
 
  • Like
Reactions: linux4me2

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,749
2,205
363
cPanel Access Level
DataCenter Provider
Twitter
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.

Here's an example of the steps you could use to do this:

1. Access the server via SSH as root and create the custom bash script with the following commands:

Bash:
touch /usr/local/cpanel/3rdparty/bin/custom-postupcpemail.sh
chmod 0755 /usr/local/cpanel/3rdparty/bin/custom-postupcpemail.sh
chown root:root /usr/local/cpanel/3rdparty/bin/custom-postupcpemail.sh
2. Use your preferred command line text editor (e.g. vi) to open the bash script and populate it with content. Here's an example of how it might look if you wanted to send the log output to "[email protected]":

Bash:
#!/bin/bash
cat /var/cpanel/updatelogs/last | mail -s "Post UPCP Hook - Daily Log Output" [email protected]
3. Use the crontab -e command to add the new cron job. Here's an example of the line to add:

Code:
29 6 * * * /usr/local/cpanel/3rdparty/bin/custom-postupcpemail.sh > /dev/null 2>&1
Feel free to customize the bash script and cron job to your own preferences if you are an experienced developer and share your example scripts here (for instance, you may want to setup the bash script to use SMTP).

Let me know if this workaround is helpful.

Thank you.
 

cPanelMichael

Technical Support Community Manager
Staff member
Apr 11, 2011
47,749
2,205
363
cPanel Access Level
DataCenter Provider
Twitter
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:

Contact Manager - Version 82 Documentation - cPanel Documentation

In particular, note the System Update Failures notification type.

For a deeper look into what the "cPanel Update Failures" notification type checks for, you can review the contents of /usr/local/cpanel/Cpanel/Update/Now.pm (there are numerous failure checks).

Let me know if this helps.

Thank you.
 

alpinist

Member
Jun 9, 2011
14
3
53
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?
 

allpar

Well-Known Member
Sep 16, 2005
52
2
158
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.
 

sergiorcs82

Registered
Aug 11, 2019
1
0
0
France
cPanel Access Level
Root Administrator
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.
 

PeteS

Well-Known Member
Jun 8, 2017
168
32
28
Oregon
cPanel Access Level
Root Administrator
@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
 
  • Like
Reactions: David Colter

David Colter

Active Member
Jun 30, 2016
35
5
8
USA
cPanel Access Level
Root Administrator
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:

Code:
20 4 * * * ( echo "Subject: cPanel Update Log (upcp)"; cat /var/cpanel/updatelogs/last ) | /usr/sbin/sendmail [email protected]
Incidentally, only one line of code (in crontab) is needed.
 
Last edited:

coffeeboyuk

Active Member
Nov 12, 2005
27
2
153
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
 

alpinist

Member
Jun 9, 2011
14
3
53

coffeeboyuk

Active Member
Nov 12, 2005
27
2
153
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: https://features.cpanel.net/topic/move-upcp-successful-update-emails-to-contact-manager-notifications#comment-55085
Hi,

I didn't read the whole lot of this thread when I modified my cron jobs, just skip through it quickly. I can see now, the updates have added back the dev/null but I did get my email. I guess I won't get anymore emails after that though.

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?

I just notice I can't log into like that post feature, what's going on?

Regards,

L
 

Michael-Inet

Well-Known Member
Feb 20, 2014
68
6
8
Austin, TX, USA
inet-design.com
cPanel Access Level
Root Administrator
This is by-design as of cPanel & WHM version 82 per the below case:
Out of curiosity, is there anything in-particular you observe in the upcp output that you find helpful?
Hi cPanelMichael,

Gotta say that’s a horrible design choice. cPanel is literally telling users they have to login to a potentially compromised system for a routine check. Why? How else are we suppose to verify when lfd reports a “System Integrity checking detected a modified system file?”

I was a little more emphatic than that in the comments section of request, but I can’t see that I’m unjustified.

Code:
20 4 * * * ( echo "Subject: cPanel Update Log (upcp)"; cat /var/cpanel/updatelogs/last ) | /usr/sbin/sendmail [email protected]
Hi David,

Thanks for this, it works well. But I’m going to suggest a change for you to edit into your post. Basically many of us have email triggers on subject lines, so what you have botches those. And, well, these should help those who don’t know cron as well as us. If you would, please add this to your post (edit as desired):

  1. Build the "command" in a plain text document
  2. Log into a root shell
  3. Run “crontab -l”
  4. Copy/Paste from the upcp script line the time component. Example: "37 2 * * * "
  5. Add ~20 minutes. Example: "57 2 * * * "
  6. Copy/Paste the “Subject:” from one of your existing emails to the "command"
  7. Copy/Paste the “To:” from one of your existing emails for “[email protected]
  8. Test what you have by:
    1. Coping what you have, starting at “(“ until the end of the line
    2. Paste that into your root shell and execute (hit enter)
  9. Check your email to see if works
  10. After it tests okay:
    1. In your root shell run “crontab -e”
    2. Copy/Paste the entire line to a bottom blank line
    3. Exit and Save
    4. Verify it took by “crontab -l”
That’s probably too wordy, but usually better to have too many instructions than too few...

Best All,
Michael
 
Last edited: