Find the answer to your Linux question:
Results 1 to 2 of 2
Hello, this command returns disk health status: Code: smartctl -a /dev/sda like: ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE 1 Raw_Read_Error_Rate 0x000b 100 100 016 Pre-fail Always ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux User postcd's Avatar
    Join Date
    Apr 2011
    Posts
    311

    Automatic HDD health check?


    Hello,

    this command returns disk health status:
    Code:
    smartctl -a /dev/sda
    like:
    ID# ATTRIBUTE_NAME FLAG VALUE WORST THRESH TYPE UPDATED WHEN_FAILED RAW_VALUE
    1 Raw_Read_Error_Rate 0x000b 100 100 016 Pre-fail Always - 0
    2 Throughput_Performance 0x0005 140 140 054 Pre-fail Offline - 68
    3 Spin_Up_Time 0x0007 100 100 024 Pre-fail Always - 0
    4 Start_Stop_Count 0x0012 100 100 000 Old_age Always - 3
    5 Reallocated_Sector_Ct 0x0033 100 100 005 Pre-fail Always - 0
    7 Seek_Error_Rate 0x000b 100 100 067 Pre-fail Always - 0
    8 Seek_Time_Performance 0x0005 124 124 020 Pre-fail Offline - 33
    9 Power_On_Hours 0x0012 100 100 000 Old_age Always - 870
    10 Spin_Retry_Count 0x0013 100 100 060 Pre-fail Always - 0
    12 Power_Cycle_Count 0x0032 100 100 000 Old_age Always - 3
    192 Power-Off_Retract_Count 0x0032 100 100 000 Old_age Always - 7
    193 Load_Cycle_Count 0x0012 100 100 000 Old_age Always - 7
    194 Temperature_Celsius 0x0002 214 214 000 Old_age Always - 28 (Min/Max 21/30)
    196 Reallocated_Event_Count 0x0032 100 100 000 Old_age Always - 0
    197 Current_Pending_Sector 0x0022 100 100 000 Old_age Always - 0
    198 Offline_Uncorrectable 0x0008 100 100 000 Old_age Offline - 0
    199 UDMA_CRC_Error_Count 0x000a 200 200 000 Old_age Always - 0
    I want to ask how i can automate smartctl so i get notiffied by email that disk health status is unacceptable?

    Is there any script for that?

    ============
    found this in /etc/smartd.conf
    # /dev/hdc -a -I 194 -W 4,45,55 -R 5 -m admin@example.com
    # /dev/hdc -H -C 0 -U 0 -m admin@example.com[/code]

    Please when i uncomment the first line, how can i veriffy these checks really running and can i relly on it i will be notiffied? (how frequently run)
    /dev/hdc dont exist, and /dev/sda returns "-bash: /dev/hdc: No such file or directory" (when i run that line in command line)

    Also there are more scripts:
    http://nixcraft.com/showthread.php/1...ll=1#post33371
    http://hotfortech.wikispaces.com/HD+monitor+script
    http://rhau.se/2012/11/08/disk-check-script/
    https://help.ubuntu.com/community/Smartmontools (on the bottom)
    http://csidiropoulos.wordpress.com/2...mail-on-error/
    Last edited by postcd; 04-13-2014 at 10:44 AM.
    "Avoid the Gates of Hell. Use Linux affordable VPS."

  2. #2
    Linux Guru Rubberman's Avatar
    Join Date
    Apr 2009
    Location
    I can be found either 40 miles west of Chicago, in Chicago, or in a galaxy far, far away.
    Posts
    11,459
    Well, my system will notify me when smartctl detects a problem with a disc (running Gnome 2.x on Scientific Linux - an RHEL 6 clone). If you are running text mode, you should be able to run smartctl in a script triggered on a regular basis by cron (such as /etc/cron.hourly) which could send you an email or execute "wall" to display a message to all users. However, you would have to write the script - not a major problem if you want to get into bash scripts.
    Sometimes, real fast is almost as good as real time.
    Just remember, Semper Gumbi - always be flexible!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •