This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
computing:storage:lsi:megaraid_monitor [2013/01/21 14:59] gcooper created |
computing:storage:lsi:megaraid_monitor [2018/11/01 10:55] (current) gcooper |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Monitoring LSI SAS RAID Controllers on Linux ====== | ====== Monitoring LSI SAS RAID Controllers on Linux ====== | ||
- | FIXME This page needs updating. | + | See also **[[computing: |
+ | |||
+ | **Cheat Sheet**: http:// | ||
+ | |||
+ | **LSI MegaRAID SAS User's Guide**: http:// | ||
This configuration uses '' | This configuration uses '' | ||
Line 16: | Line 20: | ||
< | < | ||
- | vim / | + | vi / |
root=admin@yourdomain.com | root=admin@yourdomain.com | ||
Line 37: | Line 41: | ||
==== Install the MegaCLI Utility ==== | ==== Install the MegaCLI Utility ==== | ||
- | Log in as ' | + | See also **[[computing:storage: |
- | cd ~ | + | ==== cron ==== |
- | wget -O MegaCLI.zip http:// | + | |
- | unzip MegaCLI.zip | + | |
- | rpm -ivh MegaCli-8.01.06-1.i386.rpm Lib_Utils-1.00-08.noarch.rpm | + | |
- | Cron | + | Added to '' |
- | + | ||
- | I added this to my / | + | |
+ | < | ||
# check for RAID array problems every 10 minutes and send out a message | # check for RAID array problems every 10 minutes and send out a message | ||
*/10 * * * * root / | */10 * * * * root / | ||
+ | </ | ||
- | Script | + | ==== raid-status-megacli.sh ==== |
- | I wrote this script. I just place it in the /root directory. | + | Place this script in the '' |
- | More Info | + | |
- | Cheat Sheet | + | < |
- | LSI MegaRAID | + | chmod +x / |
+ | </ | ||
+ | |||
+ | You will want to edit the variables to fit your needs. | ||
+ | |||
+ | < | ||
+ | # | ||
+ | # | ||
+ | # raid-status-megacli.sh - Gene Cooper <gcooper at sonoracomm.com> | ||
+ | # | ||
+ | # For newer LSI RAID controllers | ||
+ | # | ||
+ | # Uses MegaCLI utility and sendmail command and should be run from cron | ||
+ | |||
+ | # Sender of e-mail warnings | ||
+ | # For WHMCS Ticket System, use the contact address here for automatic account assignment | ||
+ | FROM='" | ||
+ | |||
+ | # Subject of e-mail warning | ||
+ | SUBJECT=" | ||
+ | |||
+ | # Recipient of e-mail warnings | ||
+ | ADMIN='" | ||
+ | |||
+ | # RAID utility check command | ||
+ | COMMAND='/ | ||
+ | |||
+ | # RAID status check results | ||
+ | STATUS='/ | ||
+ | |||
+ | # dump hardware failure info to a text file | ||
+ | nice -n 19 ${COMMAND} > $STATUS | ||
+ | |||
+ | # Comment this section and run manually to test mail sending | ||
+ | # Check for error | ||
+ | if [ -z " | ||
+ | exit 0 | ||
+ | fi | ||
+ | |||
+ | # Send mail | ||
+ | / | ||
+ | Date: $(date) | ||
+ | To: $ADMIN | ||
+ | Subject: $SUBJECT | ||
+ | From: $FROM | ||
+ | |||
+ | $(cat $STATUS) | ||
+ | |||
+ | EOF | ||
+ | exit | ||
+ | </ | ||
+ | |||
+ | Here is someone else' | ||
+ | |||
+ | < | ||
+ | #!/bin/sh | ||
+ | CONT=" | ||
+ | STATUS=0 | ||
+ | MEGACLI=/ | ||
+ | |||
+ | echo -n " | ||
+ | hostname | ||
+ | for a in $CONT | ||
+ | do | ||
+ | |||
+ | | ||
+ | echo " | ||
+ | | ||
+ | echo "No of Physical disks online : $noonline" | ||
+ | | ||
+ | echo $DEGRADED | ||
+ | | ||
+ | [ " | ||
+ | | ||
+ | echo $FAILED | ||
+ | | ||
+ | [ " | ||
+ | |||
+ | | ||
+ | |||
+ | exit $STATUS | ||
+ | </ |