Veritas-bu

[Veritas-bu] Drives down

2003-01-13 21:00:25
Subject: [Veritas-bu] Drives down
From: rodger.hanson AT manukau.ac DOT nz (Rodger Hanson)
Date: Tue, 14 Jan 2003 15:00:25 +1300
Hello
I have had this problem before and found a script that monitors the drives
and tries to bring them up again if they are down. The nice part is, it will
email you if the drive status changes.
I have added this into my crontab to look every 15 min's:
-----------------------------------------------------------
# Execute Tape Library Monitor Script every 15 minutes
15,30,45,00 * * * * /Admin/drivewatch.sh >/dev/null 2>&1
-----------------------------------------------------------
Here's the script: - drivewatch
-------------------------------------------------------------------------
#!/bin/sh
#
#********************************************************************
#Copyright 1998, DataStaff, Inc.
#
# Filename: drivewatch
#
# Purpose: This script uses the results of vmoprcmd -d ds
#          to determine if a drive is in a DOWN state.
#          If the drive appears to be down, it will attempt to
#          set it to an up state and email the someone_who_cares
#          variable to notify them of the potential problem.
#          Should any of the drives be down, this script will report
#          that to a log /tmp/drivecheck.SERVERNAME and attempt to
#          place the DOWN'd drives to an UP state.
#
# Caveat:  The command vmoprcmd will only apply to media servers.
#          Therefore, if this is running on a master only, you
#          will need to use the -h option to designate which media
#          server to query.
#
#          This script also assumes all servers are also media servers.
#
# Creation Date: 12/02/97
#
# Author: David A. Chapa, DataStaff, Inc. - 847 413 1144
#
# Revision History:
# 01/26/98      Initial Creation
#               - David Chapa
# 02/25/99      Updated design and added more functionality
#               -David Chapa
# 10/14/00      Added functions to support more than one server
#               -David Chapa
#
# 6/28/01       Now we get all VALID server names by using
#               bpstulist and sorting unique.  Prior to this
#               we would may have gotten administrative clients
#               (pc's).
#               -David
#
# 02/26/02      Variable-ized the robot type. RTYPE should be
#               modified depending on the type of tape library
#               you have.  ie. TLD, ACS, TL8, TL4, etc.
#               -David Chapa
#*******************************************************************
#########################################################################
#
NBU=/usr/openv/netbackup/bin
ADMCMD=$NBU/admincmd
VOLMGR=/usr/openv/volmgr/bin
SERVERS=`$ADMCMD/bpstulist | awk '{print $3}' | sort -u`
DRVCHK=/tmp/drivecheck
RTYPE=TL8 #other types are ACS, TL8, TL4, etc.
someone_who_cares="unixreport AT manukau.ac DOT nz"
#
# Clean up old Logs
for SERVER in $SERVERS
do
if [ -s $DRVCHK.$SERVER ];then
rm $DRVCHK.$SERVER
fi
done
# Clean up done
#
for i in $SERVERS
do
$VOLMGR/vmoprcmd -h $i -d ds | grep $RTYPE | grep DOWN >/dev/null 2>&1
if [ $? -ne 1 ];then
        echo "Please check the $RTYPE drives on Media Server $i:

`$VOLMGR/vmoprcmd -d ds -h $i`

Will attempt to place drive(s) in UP status" > $DRVCHK.$i
echo "" >> $DRVCHK.$i

        for drives in `$VOLMGR/vmoprcmd -d ds -h $i | tail +5 |\
        grep $RTYPE | grep DOWN |awk '{print $1}'`
        do
          echo $i $drives
          $VOLMGR/vmoprcmd -up $drives -h $i
        done

        echo "***Check all logs to determine cause.***"  >> $DRVCHK.$i
        $VOLMGR/vmoprcmd -d ds >> $DRVCHK.$i
#
# Uncomment this line to receive mail about the drive status
#       **Be sure to give $someone_who_cares a value
#
#cat $DRVCHK.$i | /usr/ucb/mail -s "$RTYPE Drives" $someone_who_cares
cat $DRVCHK.$i | mailx -s "Solcfs2 Error on $RTYPE Drives"
$someone_who_cares
fi
done
#
# This apparently is in 3.2 and following, but occasionally support
# will ask you to perform this when you have hung stunits.
/usr/openv/netbackup/bin/admincmd/bpschedreq -read_stunits

-------------------------
END -------------------------------------------------
Rodger Hanson
Solaris Technician
Information Technology
Manukau Institute of Technology
Ph: 64 9 968 7659
Mobile 029 968 7659
Email: rodger AT manukau.ac DOT nz
Web: http://www.qsl.net/zl1rah/
_____________________________________________________________________
CAUTION - This message may contain privileged and confidential
information intended only for the use of the addressee named above.
If you are not the intended recipient of this message you are hereby
notified that any use, dissemination, distribution or reproduction
of this message is prohibited. If you have received this message in
error please notify rodger AT manukau.ac DOT nz immediately.
_____________________________________________________________________


<Prev in Thread] Current Thread [Next in Thread>
  • [Veritas-bu] Drives down, Rodger Hanson <=