LSI Megaraid Cron script Print

  • 235



Megaraid LSI/Dell Raid check script
 
———
 
#!/bin/bash
email=example@domain.com
ldDrive=`/opt/MegaRAID/MegaCli/MegaCli64  -LDInfo -Lall -aALL`
pdDrive=`/opt/MegaRAID/MegaCli/MegaCli64 -PDList -aALL`

echo '\n\n'
if  (echo "$pdDrive" |grep -iq failed ) ||  (echo "$ldDrive" |grep -iq degraded )
then
       echo $pdDrive | mailx -s "Drive Failed on $HOSTNAME " $email
fi
exit 0
11:51

run the script every 6 hours in crom It needs the MegaCLI

Was this answer helpful?

« Back

["\r\n