Create a gist now

Instantly share code, notes, and snippets.

@llaumgui /01megacli
Last active Aug 29, 2015

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