Skip to content

Instantly share code, notes, and snippets.

@AndrewRose
Created August 27, 2015 09:48
Show Gist options
  • Save AndrewRose/9a725ce7706e771303b8 to your computer and use it in GitHub Desktop.
Save AndrewRose/9a725ce7706e771303b8 to your computer and use it in GitHub Desktop.
megacli has been superseded by storcli .. below is a quick and dirty method of monitoring your megaraid.. drop into /etc/cron.d/hourly for instance and be sure to have a mail server running and update with your email address.
#!/bin/bash
storcli64 /c0 show events type=sincereboot filter=warning,critical,fatal > /etc/storcli/status.tmp
if ! diff -q /etc/storcli/status /etc/storcli/status.tmp > /dev/null ; then
cat /etc/storcli/status.tmp | mail -s "RAID Problem on hostname!" user@example.com,anotheruser@example.com
mv /etc/storcli/status.tmp /etc/storcli/status
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment