顯示具有 Veritas NetBackup 標籤的文章。 顯示所有文章
顯示具有 Veritas NetBackup 標籤的文章。 顯示所有文章

星期五, 2月 20, 2009

rottest

source: http://seer.entsupport.symantec.com/docs/274063.htm

Robtest is in the path: veritas\volmgr\bin\robtest.exe

init - Initialize element status
initrange [#]- Init element status range
allow - Allow media removal
prevent - Prevent media removal
extend - Extend media access port
retract - Retract media access port
mode - Mode sense
m - Move medium
pos - Position to drive or slot
s [dpts [n]] [raw] - Read element status
inquiry - Display vendor and product ID
rezero - Rezero unit
inport - Ready inport (media access port)
debug - Toggle debug mode for this utility
test_ready - Send a TEST UNIT READY to the device

specifies drive (d#), slot (s#), media access port (p#), or transport (t#)
is drive #, slot #, media access port #, or transport #
[#] is number of elements for d, s, p, or t

NOTE:drive # is 1 - Number of drives
slot # is 1 - Number of slots
media access port # is 1 - Number of media access port elements
transport # is 1 - Number of transports
unload - Issue SCSI unload
= d1 or 1, d2 or 2, d3 or 3 ... d648 or 648

Examples:
s d - status of all drives
s d1 - status of drive 1
s s - status of all slots
s s1 - status of slot 1
s p - status of all "media access port" slots
s t - status the transport (gripper assembly)
m s1 d1 - will move the contents of slot 1 into drive 1.
unload d1 - will rewind the tape in the drive and will release the read/write head
m d1 s1 - will move the tape from drive 1 into slot 1
init - will initialize the library. Should end with "Initialize_Element_Status_Complete"
mode - will list information about the library i.e. existence of barcode reader, number of MAP ports, etc...
debug - this will put the robtest session into "debug mode." Retype "debug" to turn debug mode off. Once in debug mode, type "dm" to print a list of Extended Robot Attributes which can sometimes be useful for troubleshooting.

Important note:
All robtest commands use the OS configuration except for the UNLOAD command. This uses the NetBackup configuration. The easiest way to see if the OS and NetBackup see the drives in the same way is to move a tape into a drive (for example, drive 1). Then, look into NetBackup's device monitor and see what drive number NetBackup sees the tape in. If other than drive 1, change the Robot Drive Number of the drive in the NetBackup Media and Device Manager configuration to match what robotic drive number robtest shows the tape in.

You will need to complete this step for every drive in the configuration.

星期三, 10月 29, 2008

Netbackup restart

STOP
/usr/openv/netbackup/bin/bp.kill_all

START
/usr/openv/netbackup/bin/goodies/netbackup

STATUS CODE: 800, NetBackup

Document ID: 278533
http://support.veritas.com/docs/278533 E-Mail this document to a colleague

STATUS CODE: 800, NetBackup 6.0 jobs are failing with Status 800 (resource request failed).
--------------------------------------------------------------------------------
Details:
Overview:
There can be several causes for a Status 800 (resource request failed) with NetBackup (tm) 6.0. This error indicates that the NetBackup Policy Execution Manager (nbpem) was unable to get the required resources from the Enterprise Media Manager (EMM) processes. Typically, the Status 800 will indicate a failure to get an available drive for the backup, or the drive requested is the wrong density, or a storage unit is disabled. This error does not typically refer to system resources such as disk or memory, it refers to resources managed by the EMM server.

Not every resource request will fail with a Status 800. Here are some other situations that will fail with different error codes:

A request for a storage unit that no longer exists will generate a Status 219.
A request for a drive that no longer exists will generate a Status 213.
A request for media of the wrong density, a request made when no media is available, will generate a Status 96.
· These situations will require different troubleshooting than a Status 800.

Troubleshooting:
Verify the drives in the required storage unit are in an "UP" status. If the drives are "DOWN" this can cause the backups to fail with a Status 800. The following is an example of a DOWN drive.

# /usr/openv/volmgr/bin/tpconfig -d
Id DriveName Type Residence
Drive Path Status
*************************************************
0 QUANTUM.DLT8000.000 dlt2 Standalone
/dev/rmt/0cbn DOWN
Currently defined robotics are:
EMM Server = starfury

Verify the storage unit is configured with the correct number of available drives. Also, verify the density of the storage unit has been set correctly and matches the available media. If this density is set incorrectly the storage unit will be unavailable and the backup can fail with a Status 800.

The following is an example of a dlt2 type storage unit that has been disabled and has no available drives.
# cd /usr/openv/netbackup/bin/admincmd
# bpstulist -label starfury-dlt2 -L
Label: starfury-dlt2
Storage Unit Type: Media Manager
Host Connection: starfury
Number of Drives: 0
On Demand Only: no
Density: dlt2 (15)
Robot Type: (not robotic)
Max Fragment Size: 1048576
Max MPX/drive: 4

Master Server Log Files:

The Unified logs on the EMM server will show the following errors for the backup job. Use the vxlogview command to look up the details for the Job ID that failed with a Status 800 (eg. Job ID 124) .

The following shows Unified logging for Job 307 with the errors highlighted in bold. In this example, the drives in the storage unit are down.

# /usr/openv/netbackup/bin/vxlogview -X "jobid=307" -d all
08/24/05 16:14:46.961 [Debug] NB 51216 mds 143 PID:16879 TID:5 [jobid=307] 1 [allocateTwin] EXIT STATUS = 2005009 (EMM_ERROR_DrivesDownMediaAvailable, All compatible drive paths are down, but media is available)
...
08/24/05 16:14:47.008 [Debug] NB 51216 nbjm 117 PID:16912 TID:1 [307 job_group_id=307 client=starfury type=4] 1 [BackupJob::ERMEvent] initial resource request failed, jobid = 307, requestId = -1, EMM status = All compatible drive paths are down, but media is available, NBU status = 800(BackupJob.cpp:289)
08/24/05 16:14:47.009 [Application] NB 51216 nbjm 117 PID:16912 TID:1 [307 job_group_id=307 client=starfury type=4] [Error] V-117-131 NBU status: 800, EMM status: All compatible drive paths are down, but media is available
..
08/24/05 16:14:47.040 [Application] NB 51216 nbpem 116 PID:16917 TID:7 [parent_jobid=-1,clientname=starfury,type=4] [Info] V-116-14 CLIENT starfury POLICY test-dlt SCHED FULL EXIT STATUS 800 (resource request failed)
08/24/05 16:14:47.059 [Application] NB 51216 nbpem 116 PID:16917 TID:7 [parent_jobid=-1,clientname=starfury,type=4] [Error] V-116-85 backup of client starfury exited with status 800 (resource request failed)

The following shows Unified logging for Job 310 with the errors highlighted in bold. In this example, the storage unit is disabled:

# /usr/openv/netbackup/bin/vxlogview -X "jobid=310" -d all
08/24/05 16:22:15.378 [Debug] NB 51216 mds 143 PID:16879 TID:4 [jobid=310] 1 [allocateTwin] EXIT STATUS = 2005045 (EMM_ERROR_STUNoMaxJobCount, Storage unit is disabled)
...
08/24/05 16:22:15.393 [Debug] NB 51216 nbjm 117 PID:16912 TID:4 [310 job_group_id=310 client=starfury type=4] 1 [BackupJob::ERMEvent] initial resource request failed, jobid = 310, requestId = -1, EMM status = Storage unit is disabled, NBU status = 800(BackupJob.cpp:289)
08/24/05 16:22:15.396 [Application] NB 51216 nbjm 117 PID:16912 TID:4 [310 job_group_id=310 client=starfury type=4] [Error] V-117-131 NBU status: 800, EMM status: Storage unit is disabled
...
08/24/05 16:22:15.439 [Application] NB 51216 nbpem 116 PID:16917 TID:9 [parent_jobid=-1,clientname=starfury,type=4] [Info] V-116-14 CLIENT starfury POLICY test-dlt SCHED FULL EXIT STATUS 800 (resource request failed)
08/24/05 16:22:15.467 [Application] NB 51216 nbpem 116 PID:16917 TID:9 [parent_jobid=-1,clientname=starfury,type=4] [Error] V-116-85 backup of client starfury exited with status 800 (resource request failed)

Resolution:
The following are some known causes of a Status 800 and how to correct them.

If the drives are down:
Ensure all the drives in the storage unit are in an "UP" state. If a drive is "DOWN" check the Windows Event Viewer or UNIX system logs (syslog, messages) for any hardware or SCSI errors that indicate why the drive was brought down. To manually put the drive in an "UP" state do the following:
1. Launch the NetBackup Administration Console
2. Go to the Device Monitor
3. Highlight any drives that appear as "DOWN"
4. Select Actions | Up Drive to up the drive

If the storage unit is misconfigured:
If all the drives are in an "UP" state, verify the storage unit is configured correctly. If the density of the storage unit is wrong or if there are no drives available, a Status 800 can occur.
1. Launch the NetBackup Administration Console
2. Go to Storage Units
3. Right-click the storage unit name and select Change
4. Correct any misconfigured settings such as incorrect density or the wrong number of drives
If necessary, delete and recreate the storage unit.

Additionally, if using the "Multiple Copies" or ITC (Inline Tape Copy) feature of a policy, specifying a Storage Unit directly instead of using "Any Available" has been known to resolve this issue.

星期五, 9月 05, 2008

Netbackup 磁帶更換通知(1)!!!

另一種形式的寫法


#!/usr/bin/sh
####################################
20080524 by vincent
#################################
PATH=$PATH:/usr/openv/volmgr/bin
export PATH
#########################
TO_DAY=`date +%Y%m%d`TODAY=`date +%d`
TOMONTH=`date +%m`
#####################
ALLTAPTLIST=/tmp/log
AGROUP_FILE=/tmp/AGROUPLIST
BGROUP_FILE=/tmp/BGROUPLIST
TMP_FILE=/tmp/tmp_file
OUT_TAPE_FILE=/tmp/out_tapefile
IN_TAPE_FILE=/tmp/in_tapefile
BANK_TAPE_FILE=/tmp/bank_tapefile
MAIL_FILE=/tmp/mail_file
BARCODE_HEAD="TF"
###########################################################
POOLLIST=`vmpool -list_all grep "pool name:" awk '$3 !="None" && $3 !="NetBackup" && $3 !="DataStore" && $3 !="CatalogBackup" && $3 !="changeByScript" {print $3}'`#POOLLIST_CATALOG=`vmpool -list_all grep "pool name:" awk '$3 =="CatalogBackup" {print $3}'`
#############################################################
F_QUERYPOOL(){
for i in $POOLLIST
do
GROUP_COUNT=`vmquery -pn $i grep "media ID:" awk '{printf "%s\n",$3}'wc -l`
x=1
while [ "$x" -le $GROUP_COUNT ]; do
TAPE_LIST=`vmquery -pn $i grep "media ID:" awk '{printf "%s\t", substr($3,3,4)}' cut -f$x`
if [ $x = "1" ];then
TAPE_LIST2=$TAPE_LIST
else
TAPE_LIST3=$TAPE_LIST
fi
x=`echo "$x + 1" bc` done
if [ "$TAPE_LIST2" -lt "$TAPE_LIST3" ];then
echo "DAY$i" " " "$BARCODE_HEAD$TAPE_LIST2" >> $AGROUP_FILE
echo "DAY$i" " " "$BARCODE_HEAD$TAPE_LIST3" >> $BGROUP_FILE
else
echo "DAY$i" " " "$BARCODE_HEAD$TAPE_LIST3" >> $AGROUP_FILE
echo "DAY$i" " " "$BARCODE_HEAD$TAPE_LIST2" >> $BGROUP_FILE
fi
done
}

F_ALL_QUERYPOOL(){
vmquery -pn $1 grep "media ID:" awk '{printf "%s\n",$3}' >> $ALLTAPTLIST
}

F_DAY_RENGE(){
echo "" > $TMP_FILE
if [ $1 = "1" ];then
LAST_MONTH=`/export/home/shell/bin/day $TO_DAY d -7 |awk '{print substr($1,5,2)}'`
LAST_FULLDAY=`/export/home/shell/bin/day $TO_DAY d -7`
elif [ $1 = "2" ];then
LAST_MONTH=`/export/home/shell/bin/day $TO_DAY d +14 | awk '{print substr($1,5,2)}'`
LAST_FULLDAY=`/export/home/shell/bin/day $TO_DAY d +14`
elif [ $1 = "3" ];then
LAST_MONTH=`/export/home/shell/bin/day $TO_DAY d +21 |awk '{print substr($1,5,2)}'`
LAST_FULLDAY=`/export/home/shell/bin/day $TO_DAY d +21`
fi
x=0
while [ "$x" -le "6" ];
do
if [ $1 = "1" ];then
LAST_DAY=`/export/home/shell/bin/day $LAST_FULLDAY d +$x |awk '{print substr($1,7,2)}'`
LAST_MONTH=`/export/home/shell/bin/day $LAST_FULLDAY d +$x |awk '{print substr($1,5,2)}'`
elif [ $1 = "2" ] [ $1 = "3" ];then
LAST_DAY=`/export/home/shell/bin/day $LAST_FULLDAY d -$x |awk '{print substr($1,7,2)}'`
LAST_MONTH=`/export/home/shell/bin/day $LAST_FULLDAY d -$x |awk '{print substr($1,5,2)}'`
fi
if [ $LAST_MONTH = "01" ] ||[ $LAST_MONTH = "03" ] || [ $LAST_MONTH = "05" ]|| [ $LAST_MONTH = "07" ] || [ $LAST_MONTH = "09" ] || [ $LAST_MONTH = "11" ];then
cat $AGROUP_FILE |awk '$1 == DAY {printf "%s\n",$2} ' DAY=DAY$LAST_DAY >> $TMP_FILE elif [ $LAST_MONTH = "02" ] [ $LAST_MONTH = "04" ] [ $LAST_MONTH = "06" ] [ $LAST_MONTH = "08" ] [ $LAST_MONTH = "10" ] [ $LAST_MONTH = "12" ];then
cat $BGROUP_FILE | awk '$1 == DAY {printf "%s\n",$2} ' DAY=DAY$LAST_DAY >> $TMP_FILE
fi
x=`echo "$x + 1" |bc`
done
if [ $1 = "1" ];then
cat $TMP_FILE > $OUT_TAPE_FILE
elif [ $1 = "2" ];then
cat $TMP_FILE > $IN_TAPE_FILE
elif [ $1 = "3" ];then
cat $TMP_FILE > $BANK_TAPE_FILE
fi
}
########################## main start ######################################## inital file #############################
echo "" > $AGROUP_FILE
echo "" > $BGROUP_FILE
echo "" > $OUT_TAPE_FILE
echo "" > $IN_TAPE_FILEe
cho "" > $BANK_TAPE_FILE
echo "" > $TMP_FILE
echo "" > $MAIL_FILE
########################## main start ########################
F_QUERYPOOL
######## tape out the library ############
F_DAY_RENGE 1
######## tape in the library ##########
F_DAY_RENGE 2
######## tape out the BANK #########
F_DAY_RENGE 3
###################################################################################
echo "Tape out the Library" > $MAIL_FILE
echo "-----------------------------------------------------------------" >> $MAIL_FILE
cat $OUT_TAPE_FILE |awk '{printf "%s\n",$1}' sort -n >> $MAIL_FILE
echo "-----------------------------------------------------------------" >> $MAIL_FILE
echo "Tape in the Library" >> $MAIL_FILE
echo "-----------------------------------------------------------------" >> $MAIL_FILE
cat $IN_TAPE_FILE |awk '{printf "%s\n",$1}' sort -n >> $MAIL_FILE
echo "-----------------------------------------------------------------" >> $MAIL_FILE
echo "Tape out the custodian bank " >> $MAIL_FILE
echo "-----------------------------------------------------------------" >> $MAIL_FILE
awk '{printf "%s\n",$1}' $BANK_TAPE_FILE sort -n >> $MAIL_FILE
echo "-----------------------------------------------------------------" >> $MAIL_FILE
mailx -s " Notify: Change Tape " network_log @aaa.com < $MAIL_FILE

星期四, 6月 26, 2008

Netbackup 磁帶更換通知!!!

我真的是太懶了,原本這隻script在crontab中執行有些小問題,我都一直偷懶沒除錯....一直到現在。真是......

其實這隻程式的小問題,是我忘了本質(沒設環境變數),真是要自我檢討一下。





#!/sbin/sh
####################################
20080524 by vincent
#################################
PATH=$PATH:/usr/openv/volmgr/bin
export PATH
################################
TO_DAY=`date +%Y%m%d`
TODAY=`date +%d`
TOMONTH=`date +%m`
#####################
TEMP_PATH=/export/home/shell/TAPE/TEMP
ALLTAPTLIST=$TEMP_PATH/log
AGROUP_FILE=$TEMP_PATH/AGROUPLIST
BGROUP_FILE=$TEMP_PATH/BGROUP
LISTTMP_FILE=$TEMP_PATH/tmp_file
OUT_TAPE_FILE=$TEMP_PATH/out_tapefile
IN_TAPE_FILE=$TEMP_PATH/in_tapefile
BANK_TAPE_FILE=$TEMP_PATH/bank_tapefile
MAIL_FILE=$TEMP_PATH/mail_file
########################
BARCODE_HEAD="TF"
###########################################################
POOLLIST=`vmpool -list_all grep "pool name:" awk '$3 !="None" && $3 !="NetBackup" && $3 !="DataStore" && $3 !="CatalogBackup" && $3 !="changeByScript" {print $3}'`
#############################################################
echo "" > $AGROUP_FILE
echo "" > $BGROUP_FILE
echo "" > $OUT_TAPE_FILE
echo "" > $IN_TAPE_FILE
echo "" > $BANK_TAPE_FILE
echo "" > $TMP_FILE
echo "" > $MAIL_FILE
for i in $POOLLIST
do
GROUP_COUNT=`vmquery -pn $i| grep "media ID:"| awk '{printf "%s\n",$3}'|wc -l`
x=1
while [ "$x" -le $GROUP_COUNT ];
do
TAPE_LIST=`vmquery -pn |$i grep "media ID:" |awk '{printf "%s\t", substr($3,3,4)}' |cut -f$x`
if [ $x = "1" ];then
TAPE_LIST2=$TAPE_LIST
else
TAPE_LIST3=$TAPE_LIST
fi
x=`echo "$x + 1" | bc`
done
if [ "$TAPE_LIST2" -lt "$TAPE_LIST3" ];then
echo "DAY$i" " " "$BARCODE_HEAD$TAPE_LIST2" >> $AGROUP_FILE
echo "DAY$i" " " "$BARCODE_HEAD$TAPE_LIST3" >> $BGROUP_FILE
else
echo "DAY$i" " " "$BARCODE_HEAD$TAPE_LIST3" >> $AGROUP_FILE
echo "DAY$i" " " "$BARCODE_HEAD$TAPE_LIST2" >> $BGROUP_FILE
fi
done
for xx in 1 2 3
do
echo "" > $TMP_FILE if [ $xx = "1" ];then
LAST_MONTH=`/export/home/shell/bin/day $TO_DAY d -7 awk '{print substr($1,5,2)}'` LAST_FULLDAY=`/export/home/shell/bin/day $TO_DAY d -7` elif [ $xx = "2" ];then LAST_MONTH=`/export/home/shell/bin/day $TO_DAY d +14 awk '{print substr($1,5,2)}'` LAST_FULLDAY=`/export/home/shell/bin/day $TO_DAY d +14` elif [ $xx = "3" ];then LAST_MONTH=`/export/home/shell/bin/day $TO_DAY d +21 awk '{print substr($1,5,2)}'` LAST_FULLDAY=`/export/home/shell/bin/day $TO_DAY d +21`
fi
x=0
while [ "$x" -le "6" ]; do
if [ $xx = "1" ];then
LAST_DAY=`/export/home/shell/bin/day $LAST_FULLDAY d +$x |awk '{print substr($1,7,2)}'`
LAST_MONTH=`/export/home/shell/bin/day $LAST_FULLDAY d +$x |awk '{print substr($1,5,2)}'`

elif [ $xx = "2" ] [ $xx = "3" ];then
LAST_DAY=`/export/home/shell/bin/day $LAST_FULLDAY d -$x |awk '{print substr($1,7,2)}'`
LAST_MONTH=`/export/home/shell/bin/day $LAST_FULLDAY d -$x| awk '{print substr($1,5,2)}'`
fi
if [ $LAST_MONTH = "01" ] [ $LAST_MONTH = "03" ] [ $LAST_MONTH = "05" ] [ $LAST_MONTH = "07" ] [ $LAST_MONTH = "09" ] [ $LAST_MONTH = "11" ];then
cat $AGROUP_FILE |awk '$1 == DAY {printf "%s\n",$2} '
DAY=DAY$LAST_DAY >> $TMP_FILE elif [ $LAST_MONTH = "02" ] [ $LAST_MONTH = "04" ] [ $LAST_MONTH = "06" ] [ $LAST_MONTH = "08" ] [ $LAST_MONTH = "10" ] [ $LAST_MONTH = "12" ];then
cat $BGROUP_FILE |awk '$1 == DAY {printf "%s\n",$2} ' DAY=DAY$LAST_DAY >> $TMP_FILE
fi
x=`echo "$x + 1" bc`
done
if [ $xx = "1" ];then
cat $TMP_FILE >> $OUT_TAPE_FILE
elif [ $xx = "2" ];then
cat $TMP_FILE >> $IN_TAPE_FILE
elif [ $xx = "3" ];then
cat $TMP_FILE >> $BANK_TAPE_FILE
fi
done
###################################################################################
echo "Tape out the Library" > $MAIL_FILE
echo "-----------------------------------------------------------------" >> $MAIL_FILE
cat $OUT_TAPE_FILE |awk '{printf "%s\n",$1}' |sort -n >> $MAIL_FILE
echo "-----------------------------------------------------------------" >> $MAIL_FILE
echo "Tape in the Library" >> $MAIL_FILE
echo "-----------------------------------------------------------------" >> $MAIL_FILE
cat $IN_TAPE_FILE| awk '{printf "%s\n",$1}' |sort -n >> $MAIL_FILE
echo "-----------------------------------------------------------------" >> $MAIL_FILE
echo "Tape out the custodian bank " >> $MAIL_FILE
echo "-----------------------------------------------------------------" >> $MAIL_FILE
cat $BANK_TAPE_FILE awk '{printf "%s\n",$1}' sort -n >> $MAIL_FILE
echo "-----------------------------------------------------------------" >> $MAIL_FILE
mailx -s " Notify: Change Tape " network_log@AAA.com < $MAIL_FILE







星期三, 4月 02, 2008

command line

bpmedialist media list

### change pool
bpplschedrep -help
USAGE: bpplschedrep policy_name sched_label
[-M master_server...] [-v]
[-st sched_type] [-freq frequency]
[-mpxmax mpx_factor] [-cal 0/1/2]
[-incl mm/dd/yyyy] [-excl mm/dd/yyyy]
[-delincl mm/dd/yyyy] [-delexcl mm/dd/yyyy]
[-weekday day_name week] [-dayomonth 1-31 l]
[-delweekday day_name week] [-deldayomonth 1-31 l]
[-ci] [-ce] [-cw] [-cd]
[-number_copies number]
[-rl retention_level[,rl-copy2 ,..., rl-copyn]]
[-fail_on_error (0 1)[,(0 1),...,(0 1)]]
[-residence storage_unit_label[,stunit-copy2,... stunit-copyn]]
[-pool volume_pool_label[,pool-copy2,... pool-copyn]]
[-(0..6) start duration]

處理error code 96(抓不到帶子)

處理error code 96(抓不到帶子)
可能因retention 週期錯誤
1.login (unix command)


2.bpmedialist (view status SUSPENDED)

3.change status

<> <參數 0 = immediate>
bpexpdate -m TF1603 -d 0