Veritas-bu

[Veritas-bu] Downed Drives

2004-12-03 13:09:49
Subject: [Veritas-bu] Downed Drives
From: neil AT mbari DOT org (Conner, Neil)
Date: Fri, 3 Dec 2004 10:09:49 -0800
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_000_01C4D962.9B427F8D
Content-Type: text/plain;
        charset="iso-8859-1"

I know there's a place where you can download scripts but I'm feeling lazy...

Here is the excellent drive_watch script written by David Chapa when he was at 
DataStaff.  I also included a companion script called changer_watch that I 
wrote based on the drive_watch script.  Just change the someone_who_cares email 
address.

Cheers,
Neil

-----Original Message-----
From: Jennifer Hooper [mailto:jennifer.hooper AT peregrine DOT com]
Sent: Friday, December 03, 2004 9:41 AM
To: 'veritas-bu AT mailman.eng.auburn DOT edu'
Subject: [Veritas-bu] Downed Drives


Hi Guys - 

        We're still running Netbackup 5.0, and we are having the dreaded
DOWN-TLD problem when a job runs and can't connect to a server or fails.  We
have to live with it for just a little while longer, so I'm looking to write
a script that can check the status of the drive, and issue an UP Drive
command to bring them back up every 1/2 hour or so.  Does anyone have any
idea where to start to look for info on how to do this?

Thanks,

Jennifer

Peregrine Systems, Inc.
Sr. Network Engineer
mailto:jennifer.hooper AT peregrine DOT com
_______________________________________________
Veritas-bu maillist  -  Veritas-bu AT mailman.eng.auburn DOT edu
http://mailman.eng.auburn.edu/mailman/listinfo/veritas-bu


------_=_NextPart_000_01C4D962.9B427F8D
Content-Type: application/octet-stream;
        name="changer_watch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
        filename="changer_watch"

#!/bin/sh=0A=
#=0A=
#******************************************************************** =
=0A=
#Copyright 1998, DataStaff, Inc.=0A=
#=0A=
# Filename: changer_watch=0A=
# =0A=
# Purpose: This script uses the results of vmoprcmd -d ds=0A=
#          to determine if drive control is in AVR (error) state.  =0A=
#          If so, it will email the someone_who_cares=0A=
#          variable to notify them of the potential problem.=0A=
#=0A=
# 10/14/02 - Neil Conner=0A=
#=0A=
# Adapted from: drivewatch by David A. Chapa, DataStaff, Inc.=0A=
#=0A=
#*******************************************************************=0A=
########################################################################=
#=0A=
#=0A=
NBU=3D/usr/openv/netbackup/bin=0A=
ADMCMD=3D$NBU/admincmd=0A=
VOLMGR=3D/usr/openv/volmgr/bin=0A=
#SERVERS=3D`$ADMCMD/bpgetconfig | grep '^SERVER =3D' | awk '{print =
$3}'`=0A=
SERVERS=3D`$ADMCMD/bpgetconfig | grep '^CLIENT_NAME =3D' | awk '{print =
$3}'`=0A=
LIBCHK=3D/tmp/libcheck=0A=
someone_who_cares=3Dme AT work DOT com=0A=
#=0A=
# Clean up old Logs=0A=
for SERVER in $SERVERS=0A=
do=0A=
if [ -s $LIBCHK.$SERVER ];then=0A=
rm $LIBCHK.$SERVER=0A=
fi=0A=
done=0A=
# Clean up done=0A=
#=0A=
for i in $SERVERS=0A=
do=0A=
$VOLMGR/vmoprcmd -h $i -d ds | grep AVR >/dev/null 2>&1=0A=
if [ $? -ne 1 ];then=0A=
        echo "Please check $i-changer for possible errors:=0A=
=0A=
`$VOLMGR/vmoprcmd -d ds -h $i`" > $LIBCHK.$i=0A=
=0A=
echo "" >> $LIBCHK.$i=0A=
=0A=
echo "***Check syslog to determine cause.***"  >> $LIBCHK.$i=0A=
cat $LIBCHK.$i | /usr/ucb/mail -s "$i-changer" $someone_who_cares=0A=
echo "Please check $i-changer for possible errors"=0A=
fi=0A=
done=0A=
#=0A=
# This apparently is in 3.2 and following, but occasionally support =0A=
# will ask you to perform this when you have hung stunits.=0A=
#/usr/openv/netbackup/bin/admincmd/bpschedreq -read_stunits=0A=

------_=_NextPart_000_01C4D962.9B427F8D
Content-Type: application/octet-stream;
        name="drive_watch"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
        filename="drive_watch"

#!/bin/sh=0A=
#=0A=
#******************************************************************** =
=0A=
#Copyright 1998, DataStaff, Inc.=0A=
#=0A=
# Filename: drivewatch (drive_watch)=0A=
# =0A=
# Purpose: This script uses the results of vmoprcmd -d ds=0A=
#          to determine if a drive is in a DOWN state.  =0A=
#          If the drive appears to be down, it will attempt to =0A=
#          set it to an up state and email the someone_who_cares=0A=
#          variable to notify them of the potential problem.=0A=
#          Should any of the drives be down, this script will report=0A=
#          that to a log /tmp/drivecheck.SERVERNAME and attempt to=0A=
#          place the DOWN'd drives to an UP state.=0A=
#=0A=
# Caveat:  The command vmoprcmd will only apply to media servers.=0A=
#          Therefore, if this is running on a master only, you =0A=
#          will need to use the -h option to designate which media=0A=
#          server to query.=0A=
#=0A=
#          This script also assumes all servers are also media servers.=0A=
#=0A=
# Creation Date: 12/02/97=0A=
#=0A=
# Author: David A. Chapa, DataStaff, Inc. - 847 413 1144=0A=
#=0A=
# Revision History:=0A=
# 01/26/98      Initial Creation  =0A=
#               - David Chapa=0A=
# 02/25/99      Updated design and added more functionality =0A=
#               -David Chapa=0A=
# 10/14/00      Added functions to support more than one server=0A=
#               -David Chapa=0A=
#*******************************************************************=0A=
########################################################################=
#=0A=
#=0A=
NBU=3D/usr/openv/netbackup/bin=0A=
ADMCMD=3D$NBU/admincmd=0A=
VOLMGR=3D/usr/openv/volmgr/bin=0A=
#SERVERS=3D`$ADMCMD/bpgetconfig | grep '^SERVER =3D' | awk '{print =
$3}'`=0A=
SERVERS=3D`$ADMCMD/bpgetconfig | grep '^CLIENT_NAME =3D' | awk '{print =
$3}'`=0A=
DRVCHK=3D/tmp/drivecheck=0A=
someone_who_cares=3Dme AT work DOT com=0A=
#=0A=
# Clean up old Logs=0A=
for SERVER in $SERVERS=0A=
do=0A=
if [ -s $DRVCHK.$SERVER ];then=0A=
rm $DRVCHK.$SERVER=0A=
fi=0A=
done=0A=
# Clean up done=0A=
#=0A=
for i in $SERVERS=0A=
do=0A=
$VOLMGR/vmoprcmd -h $i -d ds | grep TL8 | grep DOWN >/dev/null 2>&1=0A=
if [ $? -ne 1 ];then=0A=
        echo "Please check tape drives on Media Server $i:=0A=
=0A=
`$VOLMGR/vmoprcmd -d ds -h $i`=0A=
=0A=
Will attempt to place drive(s) in UP status" > $DRVCHK.$i=0A=
echo "" >> $DRVCHK.$i=0A=
=0A=
        for drives in `$VOLMGR/vmoprcmd -d ds -h $i | tail +5 |\=0A=
        grep TL8 | grep DOWN |awk '{print $1}'`=0A=
        do=0A=
          echo $i $drives=0A=
          $VOLMGR/vmoprcmd -up $drives -h $i=0A=
        done=0A=
=0A=
        echo "***Check all logs to determine cause.***"  >> =
$DRVCHK.$i=0A=
        $VOLMGR/vmoprcmd -d ds >> $DRVCHK.$i=0A=
cat $DRVCHK.$i | /usr/ucb/mail -s "$i tape drives" =
$someone_who_cares=0A=
fi=0A=
done=0A=
#=0A=
# This apparently is in 3.2 and following, but occasionally support =0A=
# will ask you to perform this when you have hung stunits.=0A=
#/usr/openv/netbackup/bin/admincmd/bpschedreq -read_stunits=0A=

------_=_NextPart_000_01C4D962.9B427F8D--

<Prev in Thread] Current Thread [Next in Thread>