Answers:
创建脚本如:
#!/bin/bash
STATUS=`MegaCli -AdpAllInfo -aALL -NoLog|egrep '^ (Degraded|Failed)'|grep -v ' 0'`;
if [ "x$STATUS" != "x" ]; then
echo -e "Subject: RAID WARNING @ `hostname`\n\n$STATUS"|/usr/sbin/sendmail your@email.com
fi
并将其添加到您的crontab:https://help.ubuntu.com/community/CronHowto
您还需要在您的系统上使用有效的sendmail程序,通过ssmtp进行最简单的配置就足够了。