Your Webhosting Questions
Answered by the Webhosting Experts
Tags
...
...

CPanel is emailing me about smartcheck errors. Is my drive failing?

Solution

As of January 2006, CPanel has made some changes to their smartctl implementation, which is what they use to periodically scan for SMART errors on your drive(s). Previous versions were somewhat buggy, and did not usually correctly report minor SMART inconsistencies.

Due to recent upgrades by CPanel, when their smartcheck script runs, it may show minor ATA errors that it logged quite some time ago, but never reported.

Example:S.M.A.R.T Errors on /dev/hda
From Command: /usr/sbin/smartctl -q errorsonly -H -l selftest -l error /dev/hda
ATA Error Count: 1
Error 1 occurred at disk power-on lifetime: 3843 hours
----END /dev/hda--

ATA Errors such as these are nothing to worry about, as long as they are intermittent. Drives that have been in use for a long period of time may see more of these than a “fresh” drive, but again, there should be nothing to worry about, and no drive testing or replacement should be needed.

In the event of serious (CRITICAL) SMART errors, such as a possibly failing drive, the smartcheck script will notify you with different information. While SMART cannot always accurately predict a failing drive, in a case of a predicted drive fail, it would be best for you to make backups of all your data, and schedule a time with us to test the drive. As always, a 12 hour advance notice and 4 hour work window would be required.However, the type of error you are seeing is nothing to worry about, and again, simply a result of

CPanel’s new implementation of smartctl.

To prevent CPanel from sending duplicate SMART errors, insert this block of code to

/scripts/smartcheck.

Please note: When cPanel updates the file, you will have to make the change *again*. You can

use chattr to modify the file so it is not overwritten:

chattr +i /scripts/smartcheck

As this file is now locked from changes, you will need to unlock it before running a CPanel

upgrade:

chattr -i /scripts/smartcheck

You may then proceed with upgrading CPanel.

After you insert the code, run

/scripts/smartcheck

twice. The first time it will send out the email and log it. The second time it runs, it should not

send an email.

When there is any change in the smartcheck status, it will send one email to you.
Where to insert (most likely around line 143):

Code:if(!$nomail) {
# ***INSERT CODE HERE***
cPScript::iContact::icontact('application' => 'smartcheck',
'level' => 3,
'subject' => $subject,
'message' => $msg,
'msgtype' => '',
);
}
Code to Insert:
Code:
my $lastfile = "/root/smartlast";
if(open FILE, "$lastfile"){
my $lastsmart = join '', ;
if ($lastsmart eq $msg) {
print "We already sent this. Quitting!n";
exit;
}
}
open FILE, ">$lastfile";
print FILE $msg;
close FILE;

If you do not wish to receive any mailings, you will need to disable smartcheck completely. To do

so, perform the following from a root prompt via SSH:

touch /var/cpanel/disablesmartcheck

That will prevent smartcheck from running. If you wish to re-enable it, simply remove that file.

 

Need More Personalized Help?

If you have any further issues, questions, or would like some assistance checking on this or anything else, please reach out to us from your my.hivelocity.net account and provide your server credentials within the encrypted field for the best possible security and support.

If you are unable to reach your my.hivelocity.net account or if you are on the go, please reach out from your valid my.hivelocity.net account email to us here at: [email protected]. We are also available to you through our phone and live chat system 24/7/365.

Tags +
...