This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
computing:storage:lsi:megaraid_monitor [2013/01/21 16:27] gcooper |
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: | + | **Cheat Sheet**: http:// |
- | LSI MegaRAID SAS User's Guide: | + | **LSI MegaRAID SAS User's Guide**: http:// |
This configuration uses '' | This configuration uses '' | ||
Line 20: | Line 20: | ||
< | < | ||
- | vim / | + | vi / |
root=admin@yourdomain.com | root=admin@yourdomain.com | ||
Line 41: | Line 41: | ||
==== Install the MegaCLI Utility ==== | ==== Install the MegaCLI Utility ==== | ||
- | Log in as ' | + | See also **[[computing:storage: |
- | < | + | ==== cron ==== |
- | mkdir ~/MegaCLI | + | |
- | cd ~/MegaCLI | + | |
- | wget http:// | + | |
- | unzip 8.07.06_MegaCLI.zip | + | |
- | + | ||
- | rpm -Uvh Linux/ | + | |
- | </ | + | |
- | + | ||
- | ==== CRON ==== | + | |
- | I added this to my ''/ | + | Added to ''/ |
< | < | ||
Line 61: | Line 52: | ||
</ | </ | ||
- | ==== raidstatus.sh ==== | + | ==== raid-status-megacli.sh ==== |
- | Place this script in the ''/ | + | Place this script in the ''/ |
+ | |||
+ | < | ||
+ | chmod +x / | ||
+ | </ | ||
You will want to edit the variables to fit your needs. | You will want to edit the variables to fit your needs. | ||
Line 70: | Line 65: | ||
#!/bin/bash | #!/bin/bash | ||
# | # | ||
- | # raidstatus.sh - Gene Cooper <gcooper@sonoracomm.com> | + | # raid-status-megacli.sh - Gene Cooper < |
# | # | ||
# For newer LSI RAID controllers | # For newer LSI RAID controllers | ||
# | # | ||
# Uses MegaCLI utility and sendmail command and should be run from cron | # 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 of e-mail warning | ||
- | SUBJECT='RAID Array Failure on $HOSTNAME' | + | SUBJECT="RAID Array Failure on `hostname`" |
# Recipient of e-mail warnings | # Recipient of e-mail warnings | ||
- | ADMIN=' | + | ADMIN=' |
# RAID utility check command | # RAID utility check command | ||
Line 92: | Line 90: | ||
nice -n 19 ${COMMAND} > $STATUS | nice -n 19 ${COMMAND} > $STATUS | ||
- | # check for error | + | # Comment this section and run manually to test mail sending |
+ | # Check for error | ||
if [ -z " | if [ -z " | ||
exit 0 | exit 0 | ||
fi | fi | ||
- | # send mail | + | # Send mail |
/ | / | ||
Date: $(date) | Date: $(date) | ||
To: $ADMIN | To: $ADMIN | ||
Subject: $SUBJECT | Subject: $SUBJECT | ||
- | From: $ADMIN | + | From: $FROM |
$(cat $STATUS) | $(cat $STATUS) | ||
Line 108: | Line 107: | ||
EOF | EOF | ||
exit | exit | ||
+ | </ | ||
+ | |||
+ | Here is someone else's script for ideas: | ||
+ | |||
+ | < | ||
+ | #!/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 | ||
+ | | ||
+ | [ " | ||
+ | |||
+ | done | ||
+ | |||
+ | exit $STATUS | ||
</ | </ |