Showing results for 
Search instead for 
Did you mean: 

Scripts to get tape Drive status

Level 4
Hello Friends--

I need a script to automate the drive down status of my tape libraries. I have netbackup 6.5.3 in window 2003 x64. One Master server and 3 media server. There are 4 libraries with 10 drives. Does anyone of you have any script for this.

Level 6
you could look at using vmoprcmd to determine drive status, tapes loaded etc. Can also be used to up/down drives etc etc etc.

# vmoprcmd -help
(Device Monitor)
    vmoprcmd -devmon [pr|ds|hs] [-h <device_host>] (default operation)
    vmoprcmd -dp [pr|ds|ad] [-h <device_host>]

(Up/Down/Reset drive)
    vmoprcmd -down|-up|-upopr|-reset <drive_index> [-h <device_host>]
    vmoprcmd -downbyname|-upbyname|-upoprbyname <drive_name>
        [-path  <drivepath>] [-nh <ndmp_hostname>] [-h <device_host>]
    vmoprcmd -resetbyname <drive_name> [-h <device_host>]

(Assign mount request to drive)
    vmoprcmd -assign <drive_index> <mount_request_index> [-h <device_host>]
    vmoprcmd -assignbyname <drive_name> <mount_request_index>
        [-h <device_host>]

(Deny/Resubmit mount request)
    vmoprcmd -deny|-resubmit <mount_request_index> [-h <device_host>]

(Comment the drive)
    vmoprcmd -comment <drive_index> ["<comment>"] [-h <device_host>]
    vmoprcmd -commentbyname <drive_name> ["<comment>"] [-h <device_host>]

(SCSI release SSO drive)
    vmoprcmd -crawlreleasebyname <drive_name> [-h <EMM_server>]

(Active/Deactivate host)
    vmoprcmd [-activate_host|-deactivate_host] [-h <device_host>]

(Get host status)
    vmoprcmd -hoststatus [-h <device_host>]

(Display usage)
    vmoprcmd -help

NOTE: The following is provided for backward compatibility only.

    vmoprcmd [-h <volume_database_host>]
           -d [pr|ds|ad] |
           -dps [<drive_name>]

Haven't looked at this in detail, but maybe there's something in this download of Antons that may be of use : TapeAlert analyser

Not applicable
You could install NetBackup Operations Manager and it can report drive status.

If you want to automate it based on status, then there are as usual UNIX scripts that can do this.

If Windows server you might be able to run this ksh script in cygwin that I found from way back. (modified of course)

# Add interested parties below: 
/usr/openv/volmgr/bin/vmoprcmd -d ds | grep "DOWN-TLD" 2>&1
if [ $? -ne 1 ];then
         echo " "
         echo " "
         rm /tmp/adm/drivelog
         /usr/bin/date >> /tmp/adm/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/adm/drivelog
echo "" >> /tmp/adm/drivelog
        for i in `/usr/openv/volmgr/bin/vmoprcmd -d ds | tail +5 | grep "DOWN"|awk '{print $1}'`
          /usr/openv/volmgr/bin/vmoprcmd -up $i
/usr/openv/volmgr/bin/vmoprcmd -d ds >> /tmp/adm/drivelog
cat /tmp/adm/drivelog | /usr/bin/mail -s "Drive(s) on NetBackup are DOWN" \