I have a unix master and win2k media servers. Not being a scripting guru I was wondering how I can make the script below work for me. Any ideas??
#!/bin/ksh
# Check Drives on Master Server, if down, bring drive up.
# Send an email to some one who cares.
# 04/08/02
#
#------------------------------------------------------------------
#BEGIN SCRIPT DRIVEWATCH
#!/usr/bin/ksh
#----------------------------------------------------------------------
# Keith G. Deems
# Check drives, bring drive up if down, email Staff
# If drives are up, do not create a report, runs from cron
#----------------------------------------------------------------------
# Add interested parties below:
someone_who_cares=jl1@ci.henderson.nv.us
/usr/openv/volmgr/bin/vmoprcmd -d ds | grep "DOWN-TLD" 2>&1
if [ $? -ne 1 ];then
echo " "
echo " "
rm /tmp/kgd/drivelog
/usr/bin/date >> /tmp/drivelog
echo "Please check DLT drives on MASTER:
`/usr/openv/volmgr/bin/vmoprcmd -d ds`
I will now attempt to place drive(s) in UP status" >> /tmp/drivelog
echo "" >> /tmp/drivelog
# for i in `/usr/openv/volmgr/bin/vmoprcmd -d ds | tail +5 | grep "DOWN"|awk '{print $1}'`
# do
# /usr/openv/volmgr/bin/vmoprcmd -up $i
# done
#/usr/openv/volmgr/bin/vmoprcmd -d ds >> /tmp/drivelog
cat /tmp/drivelog | /usr/bin/mail -s "Drive(s) on Veritas are DOWN" $someone_who_cares
fi
#!/bin/ksh
# Check Drives on Master Server, if down, bring drive up.
# Send an email to some one who cares.
# 04/08/02
#
#------------------------------------------------------------------
#BEGIN SCRIPT DRIVEWATCH
#!/usr/bin/ksh
#----------------------------------------------------------------------
# Keith G. Deems
# Check drives, bring drive up if down, email Staff
# If drives are up, do not create a report, runs from cron
#----------------------------------------------------------------------
# Add interested parties below:
someone_who_cares=jl1@ci.henderson.nv.us
/usr/openv/volmgr/bin/vmoprcmd -d ds | grep "DOWN-TLD" 2>&1
if [ $? -ne 1 ];then
echo " "
echo " "
rm /tmp/kgd/drivelog
/usr/bin/date >> /tmp/drivelog
echo "Please check DLT drives on MASTER:
`/usr/openv/volmgr/bin/vmoprcmd -d ds`
I will now attempt to place drive(s) in UP status" >> /tmp/drivelog
echo "" >> /tmp/drivelog
# for i in `/usr/openv/volmgr/bin/vmoprcmd -d ds | tail +5 | grep "DOWN"|awk '{print $1}'`
# do
# /usr/openv/volmgr/bin/vmoprcmd -up $i
# done
#/usr/openv/volmgr/bin/vmoprcmd -d ds >> /tmp/drivelog
cat /tmp/drivelog | /usr/bin/mail -s "Drive(s) on Veritas are DOWN" $someone_who_cares
fi