User Tools

Site Tools


computing:storage:lsi:megaraid_monitor

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
computing:storage:lsi:megaraid_monitor [2013/03/02 12: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 ======
  
-See also **[[computing:storage:megaraid|LSI MegaRAID]]**+See also **[[computing:storage:lsi:megaraid|LSI MegaRAID]]**
  
 **Cheat Sheet**: http://tools.rapidsoft.de/perc/ **Cheat Sheet**: http://tools.rapidsoft.de/perc/
Line 20: Line 20:
  
 <file> <file>
-vim /etc/ssmtp/ssmtp.conf+vi /etc/ssmtp/ssmtp.conf
  
 root=admin@yourdomain.com root=admin@yourdomain.com
Line 41: Line 41:
 ==== Install the MegaCLI Utility ==== ==== Install the MegaCLI Utility ====
  
-See **[[computing:storage:megaraid|LSI MegaRAID]]**+See also **[[computing:storage:lsi:megaraid|LSI MegaRAID]]**
  
-==== CRON ====+==== cron ====
  
-I added this to my ''/etc/crontab'' to run the script every 10 minutes:+Added to ''/etc/crontab'' to run the script every 10 minutes:
  
 <file> <file>
Line 54: Line 54:
 ==== raid-status-megacli.sh ==== ==== raid-status-megacli.sh ====
  
-Place this script in the ''/root'' directory.+Place this script in the ''/root'' directory and make it executable: 
 + 
 +<file> 
 +chmod +x /root/raid-status-megacli.sh 
 +</file>
  
 You will want to edit the variables to fit your needs. You will want to edit the variables to fit your needs.
Line 61: Line 65:
 #!/bin/bash #!/bin/bash
 # #
-# raid-status-megacli.sh - Gene Cooper <gcooper@sonoracomm.com>+# raid-status-megacli.sh - Gene Cooper <gcooper at sonoracomm.com>
 # #
 # 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='"RAID Status" <user@domain.com>'
  
 # 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='you@yourdomain.com'+ADMIN='"Your Name" <you@yourdomain.com>'
  
 # RAID utility check command # RAID utility check command
Line 82: 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 "$(grep "^State.*: Degraded$" $STATUS | awk '{print $NF}')" ]; then if [ -z "$(grep "^State.*: Degraded$" $STATUS | awk '{print $NF}')" ]; then
   exit 0   exit 0
 fi fi
  
-send mail+Send mail
 /usr/sbin/sendmail -t -i <<EOF /usr/sbin/sendmail -t -i <<EOF
 Date: $(date) Date: $(date)
 To:  $ADMIN To:  $ADMIN
 Subject: $SUBJECT Subject: $SUBJECT
-From: $ADMIN+From: $FROM
  
 $(cat $STATUS) $(cat $STATUS)
computing/storage/lsi/megaraid_monitor.1362251937.txt.gz · Last modified: 2013/03/02 12:18 by gcooper