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/02/22 15:39] 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 ====== | ||
+ | |||
+ | See also **[[computing: | ||
**Cheat Sheet**: http:// | **Cheat Sheet**: http:// | ||
Line 18: | Line 20: | ||
< | < | ||
- | vim / | + | vi / |
root=admin@yourdomain.com | root=admin@yourdomain.com | ||
Line 39: | 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/ | + | Added to ''/ |
- | </ | + | |
- | + | ||
- | ==== CRON ==== | + | |
- | + | ||
- | I added this to my ''/ | + | |
< | < | ||
Line 61: | Line 54: | ||
==== raid-status-megacli.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 68: | Line 65: | ||
#!/bin/bash | #!/bin/bash | ||
# | # | ||
- | # raid-status-megacli.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 89: | 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) |