Find out the failed disk

Hi Masters,

How to find out the failed disk in redhat linux (OR)
How to decalare whether our hard disk goes bad ?

My option is:

dmesg | grep "failed"
check in /var/log/messages with the kernel error.

Please corrrect me if im wrong.

And also i heard "smartctl" command. But it's difficult to understand. Please help me out how to use this command ...

Any reply(s) would be a great !!!

Thanks !

#!/bin/bash

# Who should e-mails about failure go to
MAILTO='admin@domain.com'

LOG_FILE=/root/raid.log
OK_FILE=/root/raid.ok

# If OK file doesn't exist create it
if [ ! -e $OK_FILE ]; then
cat /proc/mdstat > $OK_FILE
fi

rm -f $LOG_FILE

SYSTEM=`uname --nodename`

cat /proc/mdstat > $LOG_FILE

DIFF=`diff $OK_FILE $LOG_FILE | wc -l `

if [ $DIFF -ne 0 ]; then
echo "RAID failed"
mail -s "URGENT: RAID disk failure detected on $SYSTEM" $MAILTO < $LOG_FILE
else
echo "RAID OK"
fi
exit 0

#hpacucli ctrl all show config execute as root.

this will clearly show the status of the disks.