The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Smartcheck for SATA drives

Discussion in 'General Discussion' started by yaax, Aug 3, 2006.

  1. yaax

    yaax Well-Known Member

    Joined:
    Jun 15, 2003
    Messages:
    67
    Likes Received:
    0
    Trophy Points:
    6
    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.
     
  2. rs-freddo

    rs-freddo Well-Known Member

    Joined:
    May 13, 2003
    Messages:
    832
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    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--
     
  3. AndyReed

    AndyReed Well-Known Member
    PartnerNOC

    Joined:
    May 29, 2004
    Messages:
    2,222
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Minneapolis, MN
    There is no need to worry about this error. Raed my posting: http://forums.cpanel.net/showthread.php?t=53613#4
     
    #3 AndyReed, Aug 3, 2006
    Last edited: Aug 3, 2006
  4. yaax

    yaax Well-Known Member

    Joined:
    Jun 15, 2003
    Messages:
    67
    Likes Received:
    0
    Trophy Points:
    6
    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.
     
  5. dapinard

    dapinard Registered

    Joined:
    Apr 22, 2005
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    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
     
  6. yaax

    yaax Well-Known Member

    Joined:
    Jun 15, 2003
    Messages:
    67
    Likes Received:
    0
    Trophy Points:
    6
    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.
     
  7. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    Then you need to put this information into an enhancement bugzilla entry to bring it to their attention.
     
  8. yaax

    yaax Well-Known Member

    Joined:
    Jun 15, 2003
    Messages:
    67
    Likes Received:
    0
    Trophy Points:
    6
  9. procam

    procam Well-Known Member

    Joined:
    Nov 24, 2003
    Messages:
    123
    Likes Received:
    0
    Trophy Points:
    16
    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 !!
     
  10. chirpy

    chirpy Well-Known Member

    Joined:
    Jun 15, 2002
    Messages:
    13,475
    Likes Received:
    20
    Trophy Points:
    38
    Location:
    Go on, have a guess
    You can disable the check for now by simply:

    touch /var/cpanel/disablesmartcheck
     
  11. ANewDay

    ANewDay Well-Known Member

    Joined:
    Sep 11, 2006
    Messages:
    86
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    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!!
     
  12. procam

    procam Well-Known Member

    Joined:
    Nov 24, 2003
    Messages:
    123
    Likes Received:
    0
    Trophy Points:
    16
    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:
     
  13. ANewDay

    ANewDay Well-Known Member

    Joined:
    Sep 11, 2006
    Messages:
    86
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    USA
    Why don't Cpanel fix this already?
     
  14. jameshsi

    jameshsi Well-Known Member

    Joined:
    Oct 22, 2001
    Messages:
    347
    Likes Received:
    0
    Trophy Points:
    16
    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
     
  15. figure8hosting

    Joined:
    May 24, 2007
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    SMART check doesn't work on my SCSI drives...

    Do they not support SMART?
     
  16. ANewDay

    ANewDay Well-Known Member

    Joined:
    Sep 11, 2006
    Messages:
    86
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    USA
    Why isn't this still fixed in Cpanel 11??? :mad:
     
  17. ANewDay

    ANewDay Well-Known Member

    Joined:
    Sep 11, 2006
    Messages:
    86
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    USA
    Bump, I'm appalled that smartcheck still did not get updated to support SATA drives. :rolleyes:
     
  18. cPDan

    cPDan cPanel Staff
    Staff Member

    Joined:
    Mar 9, 2004
    Messages:
    711
    Likes Received:
    3
    Trophy Points:
    18
    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:

    [root@ea3ap20 ~]# mv smartcheck_custom_dash_d.yaml /var/cpanel/smartcheck_custom_dash_d.yaml
    [root@ea3ap20 ~]# /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.
    [root@ea3ap20 ~]# mv smartcheck_custom_dash_d.yaml /var/cpanel/smartcheck_custom_dash_d.yaml
    [root@ea3ap20 ~]# /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
    [root@ea3ap20 ~]# cat /var/cpanel/smartcheck_custom_dash_d.yaml
    ---
    /dev/sda: ata
    [root@ea3ap20 ~]#

    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?)
     
  19. ANewDay

    ANewDay Well-Known Member

    Joined:
    Sep 11, 2006
    Messages:
    86
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    USA
    When will cpanel smartcheck be updated to the newest version?
     
  20. cPDan

    cPDan cPanel Staff
    Staff Member

    Joined:
    Mar 9, 2004
    Messages:
    711
    Likes Received:
    3
    Trophy Points:
    18
    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!
     

Share This Page