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 15:18] 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/ | + | Added to ''/ |
- | </ | + | |
- | + | ||
- | ==== CRON ==== | + | |
- | + | ||
- | I added this to my ''/ | + | |
< | < | ||
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. | ||
+ | < | ||
+ | #!/bin/bash | ||
+ | # | ||
+ | # 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'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 | ||
+ | </ |