Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


Closed Thread
  Search this Thread
Old 10-01-2011, 05:07 PM   #1
Senior Member
Registered: Jan 2010
Location: SI : 45.9531, 15.4894
Distribution: CentOS, OpenNA/Trustix, testing desktop openSuse 12.1 /Cinnamon/KDE4.8
Posts: 1,144

Rep: Reputation: 217Reputation: 217Reputation: 217
Adaptec ARCCONF RAID array check script emailing status


I'd like to share this script I modified for my server to monitor/check the status of the Adaptec RAID array (3405).
It uses "Adaptec Storage manager" utilities and sendEmail great script for sending e-mails from CLI with attachment(s).

more here Adaptec Storage Manager - ARCCONF - check Adaptec RAID array

DATE=$(date +"%F (%H:%M:%Sh)")

RAID=/var/tmp/adaptec/adaptec3405check_$(date +"%F_%H-%M-%Sh").txt

/usr/StorMan/arcconf getconfig 1 al > $RAID

CTRLSTAT=$(grep 'Controller Status' $RAID| cut -d\: -f2 | cut -d' ' -f2)
## Optimal
echo "Adaptec Status $DATE :" >$RAIDSTATUSFILE
echo "----------------------------------------" >>$RAIDSTATUSFILE
echo "Controller status : $CTRLSTAT" >>$RAIDSTATUSFILE
## CTRLBATINFO=$(grep -A 2 'Controller Battery' $RAID|grep 'Status'| cut -d\: -f2)
CTRTEMP=$(grep 'Temperature' $RAID| awk '{print $7}' | sed -e 's/^.*(\(.*\)),*/\1/')
## Normal
LOGICSTAT=$(grep 'Status of logical device' $RAID| cut -d\: -f2 | cut -d' ' -f2)
## Optimal
echo "Status of logical device : $LOGICSTAT" >>$RAIDSTATUSFILE
LOGICSTR=$(grep 'Failed stripes' $RAID| cut -d\: -f2 | cut -d' ' -f2)
## No
echo "Failed stripes : $LOGICSTR" >>$RAIDSTATUSFILE

# number of drives
DRIVESNO=$(grep -B 1 -A 1 'Device is a Hard' $RAID | grep -c 'Device #')

echo "Devices found : $DRIVESNO" >>$RAIDSTATUSFILE
if [ "$CTRLSTAT" = "Optimal" ]
# when everything is OK send the status message on Wednesday and Saturday (Wed / Sat) on 02.00 hrs, which is set to run in CRON every hour (15 * * * * /usr/local/bin/ >/dev/null )
# if you don't want to get emails if nothing wrong then don't use this block if ... fi
# this should be all in 1 line
if ( [ "$(date +"%H")" = "02" ] && [ "$(date +"%a")" = "Wed" ] ) || ( [ "$(date +"%H")" = "02" ] && [ "$(date +"%a")" = "Sat" ] )
while [ $i -lt "$DRIVESNO" ]
# this should be all in 1 line
echo "$CURDRIVE : $(grep -A 2 "Device #$i" $RAID | grep 'State' | cut -d\: -f2 | cut -d' ' -f2)" >>$RAIDSTATUSFILE
# this should be all in 1 line
/usr/local/bin/sendEmail -f "" -t "" -u "Adaptec RAID status $DATE " -o message-file=$RAIDSTATUSFILE >/dev/null
$(rm $RAID)

elif [ "$CTRLSTAT" != "Optimal" ]
# this should be all in 1 line
/usr/local/bin/sendEmail -f "" -t "" -u "RAID FAILURE - Adaptec RAID error $DATE !" -o message-file=$RAIDSTATUSFILE -a $RAID >/dev/null

# this should be all in 1 line
/usr/local/bin/sendEmail -f "" -t "" -cc "" -u "RAID FAILURE - Adaptec RAID error $DATE !" -o message-file=$RAIDSTATUSFILE -a $RAID >/dev/null

Improvements are possible but I didn't look further because it works for me!

Comments, suggestions welcome and appreciated.

Last edited by lithos; 10-02-2011 at 02:41 PM.
Old 10-03-2011, 03:27 PM   #2
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911
Only one suggestion: this really belongs into either the Tutorials
section, or your blog, as there's no technical question in there.

I suggest you copy the content to either (not both ;}), and I'll
close this thread.


Last edited by Tinkster; 10-03-2011 at 03:29 PM.

Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing Slackware 13 x86_64 on a Adaptec AIC 9410 controlled RAID 10 array Equinoxe Slackware - Installation 6 06-28-2013 05:47 PM
Using mdadm - Failed RAID-5 Array but individual disks check out ok JRFrogman Linux - Server 0 06-05-2008 03:46 PM
Installing with an Adaptec RAID 5 Array hadronzoo Linux - Hardware 1 08-30-2004 07:18 PM
Cannot find adaptec-SCSI raid array Manuel-H Linux - Software 1 08-25-2004 06:32 PM
How to auto check RAID array and send results? fclifton Linux - General 0 11-10-2003 01:43 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 02:40 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration