yaax

Well-Known Member
Jun 15, 2003
67
0
156
I recently got new server with SATA hard drives and I found that cpanel smartcheck script is not working with SATA drives. However SMARTD itself is working with that drives and it just need to use additional parameter "-d ata"
So after I edited cpanel smartcheck script /scripts/smartcheck it started to work properly with my drives.

All you need to edit this part:
PHP:
my %smart = (
    'url'         => 'http://smartmontools.sourceforge.net/',
    'version_cmd' => '-V',
    'version_rgx' => 'smartctl version ',
    '2.1'         => {
        'smart_enabled_cmd' => '-d ata -i',
        'smart_enabled_rgx' => 'Drive supports S.M.A.R.T. and is enabled',
        'errors_only'       => '-d ata -l',
        'ok_drive_rgx'      => [qw(/sd /hd)],
    },
    '5.32'        => {
        'smart_enabled_cmd' => '-d ata -i',
        'smart_enabled_rgx' => 'SMART support is: Enabled',
        'errors_only'       => '-d ata -q errorsonly -H -l selftest -l error',
        'ok_drive_rgx'      => [qw(/sd /hd)],
    },
);
As you can see I just added there "-d ata" in the start of each parameter line and it worked properly for me.
So I think CPanel should add this feature to their script and check whether hard drive is SATA or SCSI and add proper parameters for SMARTD command then.
 

rs-freddo

Well-Known Member
May 13, 2003
834
1
168
Australia
cPanel Access Level
Root Administrator
Finally my smartcheck works on my SATA drives!!!
Thank you!!!

Unfortunately I got this report:
S.M.A.R.T Errors on /dev/sda
From Command: /usr/sbin/smartctl -d ata -q errorsonly -H -l selftest -l error /dev/sda
ATA Error Count: 2
Error 2 occurred at disk power-on lifetime: 10266 hours
Error 1 occurred at disk power-on lifetime: 9981 hours
----END /dev/sda--

S.M.A.R.T Errors on /dev/sdb
From Command: /usr/sbin/smartctl -d ata -q errorsonly -H -l selftest -l error /dev/sdb
ATA Error Count: 4
Error 4 occurred at disk power-on lifetime: 14375 hours
Error 3 occurred at disk power-on lifetime: 14375 hours
Error 2 occurred at disk power-on lifetime: 14163 hours
Error 1 occurred at disk power-on lifetime: 14021 hours
----END /dev/sdb--
 

AndyReed

Well-Known Member
PartnerNOC
May 29, 2004
2,221
4
193
Minneapolis, MN
rs-freddo said:
S.M.A.R.T Errors on /dev/sda
From Command: /usr/sbin/smartctl -d ata -q errorsonly -H -l selftest -l error /dev/sda
ATA Error Count: 2
Error 2 occurred at disk power-on lifetime: 10266 hours
Error 1 occurred at disk power-on lifetime: 9981 hours
----END /dev/sda--
There is no need to worry about this error. Raed my posting: http://forums.cpanel.net/showthread.php?t=53613#4
 
Last edited:

yaax

Well-Known Member
Jun 15, 2003
67
0
156
Some disks also require special parameters for smartctl to enable firmware options otherwise they may report of false errors.
I've had some server in the past with Samsung hard drives and was need to run smartctl with some option which I cannot recall now but it exist such parameter to enable applying of special firmware.
 

dapinard

Registered
Apr 22, 2005
1
0
151
Charlotte, NC
Thanks! This makes smartcheck work for me also. Unfortunately, upcp sees that the md5 changed for smartcheck and promptly replaces it with the old one. Is there an easy way to make this change stick? I was going to just change the permissions on the script but don't want to break any real updates to it that may come in the future. Thoughts?

Thanks -Dave
 

yaax

Well-Known Member
Jun 15, 2003
67
0
156
dapinard said:
Thanks! This makes smartcheck work for me also. Unfortunately, upcp sees that the md5 changed for smartcheck and promptly replaces it with the old one. Is there an easy way to make this change stick? I was going to just change the permissions on the script but don't want to break any real updates to it that may come in the future. Thoughts?

Thanks -Dave
Thats why I opened this thread - CPanel team should add this feature to their next version so it will be no need to worry about upcp replacement.
 

procam

Well-Known Member
Nov 24, 2003
122
0
166
This is a more serious problem on some units I have a brand new machine having an issue with this it has twice crashed as a result of this running first the cpu goes out of control high then it emails me a msg that says

The following warning/error was logged by the smartd daemon:

Device: /dev/sda, not capable of SMART self-check

and then the box crashes ~

I added to your bugzilla !!
 

ANewDay

Well-Known Member
Sep 11, 2006
86
0
156
USA
How can I update smartctl/smartd for cpanel? the 5.33 version couldn't enable SMART, howevere, after I installed 5.37 it enabled it and works with my SATA drive!!
 

procam

Well-Known Member
Nov 24, 2003
122
0
166
How can I update smartctl/smartd for cpanel? the 5.33 version couldn't enable SMART, howevere, after I installed 5.37 it enabled it and works with my SATA drive!!
I wish I knew ~ that unit I mentioned is still running with it OFF and according to WD the drives ARE capable of smart ~ and Im running with it off and blind~:rolleyes:
 

jameshsi

Well-Known Member
Oct 22, 2001
347
0
316
Hi!
I didn't fix the scripts but I execute the command and found below:

/usr/sbin/smartctl -d ata -q errorsonly -H -l selftest -l error /dev/sda
Please note the following marginal Attributes:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
190 Unknown_Attribute 0x0022 063 039 045 Old_age Always In_the_past 37

and it's found on both Hard drive of this box :
/usr/sbin/smartctl -d ata -q errorsonly -H -l selftest -l error /dev/sdb
Please note the following marginal Attributes:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
190 Unknown_Attribute 0x0022 052 036 045 Old_age Always In_the_past 48

Should we worry about this ?

Also, on my other box, which equip with 2 ATA Hard Drives, shows same problem:

/usr/sbin/smartctl -q errorsonly -H -l selftest -l error /dev/hda
Please note the following marginal Attributes:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
190 Unknown_Attribute 0x0022 058 040 045 Old_age Always In_the_past 43958272042

/usr/sbin/smartctl -q errorsonly -H -l selftest -l error /dev/hdc
Please note the following marginal Attributes:
ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
190 Unknown_Attribute 0x0022 057 038 045 Old_age Always In_the_past 1036129271851
 

cPDan

cPanel Staff
Staff member
Mar 9, 2004
720
11
243
as of revision 22092/22093 /scripts/smartcheck will use -d if it finds the drive in question listed configured with a custom -d param in the appropriate yaml file.

Perhaps its easier to simply illustrate:

[[email protected] ~]# mv smartcheck_custom_dash_d.yaml /var/cpanel/smartcheck_custom_dash_d.yaml
[[email protected] ~]# /scripts/smartcheck
Using smartcheck config 5.32 for smartctl(5.36)
Checking /dev/sda....S.M.A.R.T does not appear to be enabled for this device.
[[email protected] ~]# mv smartcheck_custom_dash_d.yaml /var/cpanel/smartcheck_custom_dash_d.yaml
[[email protected] ~]# /scripts/smartcheck
Using smartcheck config 5.32 for smartctl(5.36)
Checking /dev/sda....
Adding custom '-d ata' flag for /dev/sda from /var/cpanel/smartcheck_custom_dash_d.yaml
Ok
[[email protected] ~]# cat /var/cpanel/smartcheck_custom_dash_d.yaml
---
/dev/sda: ata
[[email protected] ~]#

The reason we don't guess what -d should be used is the same as I've commented on this topic before:

"Since this script is not intended to be a comprehensive replacement or interface to smartclt or smartd and, again, for the widest possible compatibility we'd rather rely on smartctl to handle it:

"Based on the device path, smartctl will guess the device type (ATA or SCSI).
If necessary, the '-d' option can be used to over-ride this guess"

If there is a reliable way to get a valid -d argument from a smartctl command it may be worth adding that, but so far I can't find such an option."

In other words, there is no better way to guess what -d you might want than to let smartctl do that guess.

HTH!
smartctl already guesses if no -d is used (IE if smartctl can't guess that it should do '-d whatever', then what would the script base its guess on?)
 

cPDan

cPanel Staff
Staff member
Mar 9, 2004
720
11
243
When will cpanel smartcheck be updated to the newest version?
It is already compatible with the latest version of smartmontools, 5.38

I think the confusion is it references 5.32 in this message:

Code:
Using smartcheck config 5.32 for smartctl(5.36)
That just means its using the behavior hash added at 5.32, that behavior has not changed so no new entry has been added.

I'll clarify that verbiage ASAP so as to avoid confusion in the future, thanks!