Created
May 26, 2017 02:47
-
-
Save linuxwizard/1ed63ca15f4a6b86dc79a5b30c951730 to your computer and use it in GitHub Desktop.
Simple RAID status check script for LSI MegaRAID cards
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Simple RAID status check script for LSI MegaRAID cards | |
# Needs MegaCli installed. Install from https://docs.broadcom.com/docs-and-downloads/raid-controllers/raid-controllers-common-files/8-07-14_MegaCLI.zip | |
# Requires sendmail installed | |
# Create a cron job for auto checks | |
# Output format | |
# Degraded 1 | |
# Failed 1 | |
#!/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 [email protected] | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment