LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Automatic HDD health check? (https://www.linuxquestions.org/questions/linux-software-2/automatic-hdd-health-check-4175501524/)

postcd 04-13-2014 04:52 AM

Automatic HDD health check?
 
Hello,

this command returns disk health status:
Code:

smartctl -a /dev/sda
like:
Quote:

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/

Drakeo 04-13-2014 05:38 AM

well for slackware use the cron script http://docs.slackware.com/slackware:beginners_guide scroll down to cron.


All times are GMT -5. The time now is 07:51 AM.