Last active
August 17, 2017 05:48
-
-
Save amosbird/9f1bd182cca01db8da7d1618458685b0 to your computer and use it in GitHub Desktop.
check disk failures using megacli
This file contains 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
#!/usr/bin/env bash | |
while [[ 1 ]]; do | |
nd=$(sudo /opt/MegaRAID/MegaCli/MegaCli64 -PDList -aALL | grep "Firmware state: Online, Spun Up" | wc -l) | |
if [[ nd -ne <YOU DISK NUM> ]]; | |
then | |
echo "check it using sudo /opt/MegaRAID/MegaCli/MegaCli64 -PDList -aALL" | mail -s "$HOSTNAME has disk failure!!" <YOU EMAIL ADDRESS> | |
sleep 3600 | |
fi | |
sleep 120 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment