Skip to content

Instantly share code, notes, and snippets.

@llaumgui
Last active August 29, 2015 13:57
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save llaumgui/9669561 to your computer and use it in GitHub Desktop.
File to put in /etc/cron.daily to check the status of a card LSI MegaSAS 9260.
#!/bin/bash
#
# Check LSI MegaSAS 9260 status
#
# Global
STATUS1=`megacli -AdpAllInfo -aALL -NoLog | egrep '(Degraded|Failed)' | grep -v ' 0' | grep -v ': No'`;
if [ "x$STATUS1" != "x" ]; then
megacli -AdpAllInfo -aAll | mail -s "[sol-mtp-virt1] Panne RAID" root
fi
# Physical
STATUS2=`megacli -PDList -aALL | egrep '(Error Count)' | grep -v ' 0'`;
if [ "x$STATUS2" != "x" ]; then
megacli -PDList -aALL | mail -s "[sol-mtp-virt1] Panne RAID" root
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment