cancel
Showing results for 
Search instead for 
Did you mean: 

How to check status of multiple medias using vmquery?

rahul466
Level 3

Hi All,

I have a list of 100+ medias that i need to check whether they are in library or not.

is there any script or command that i can use to see the status of  all the medias in a go.

 

Thanks in advance

1 ACCEPTED SOLUTION

Accepted Solutions

Andy_Welburn
Level 6

Presuming the format of eject.list *is* just a list of media_ids (per revaroos example) then you would 'feed' that into the 'command' given by revaroo - this does *not* have to be run from anywhere specific (most people would just create a small script & run that, but you *can* actually run it 'live' as it were)

e.g. an updated version of revaroos example just run straight from the command line/prompt on a line by line basis - personally I would save the whole lot as a file & run that

#  for TAPE in `cat /path_to_list_of_media/tapes.lst`
>  do
>  ROBOT=`vmquery -m $TAPE | grep "robot type"|awk '{print $3}'`
>  case $ROBOT in
>          NONE) echo "Media $TAPE is NOT in library"
>          ;;
>          *) echo "Media $TAPE is in $ROBOT"
>          ;;
>  esac
>  done
Media 300184 is in TLD
Media 300726 is in TLD
Media 300625 is NOT in library
Media 300680 is NOT in library

 

View solution in original post

7 REPLIES 7

revarooo
Level 6
Employee

Depends. Is your OS Unix?

Assuming your list is like this in the file:

A00001

A00002

A00003 

etc you could use:

 

for tapes in `cat filename`

do

vmquery -m $tapes

done

 

rahul466
Level 3

Thanks revaroo for your reply.

OS is unix

the media list is located in /usr/openv/netbackup/vault.. by the name eject.list

and i have to run the command under the path /usr/openv/volmgr/bin?

 

Please let me know ..(i have less hands on unix :(

 

Will_Restore
Level 6

assuming your robot number is 0

  vmquery -b -rn 0

will show all media in the library

rahul466
Level 3

Yes but i have a list of 100 medias that i need to check whether those medias are inside the library or not?

Will_Restore
Level 6

understood. just another way to 'skin the cat'

if it's on the vmquery output, it's in the library, otherwise it's not

 

Andy_Welburn
Level 6

Presuming the format of eject.list *is* just a list of media_ids (per revaroos example) then you would 'feed' that into the 'command' given by revaroo - this does *not* have to be run from anywhere specific (most people would just create a small script & run that, but you *can* actually run it 'live' as it were)

e.g. an updated version of revaroos example just run straight from the command line/prompt on a line by line basis - personally I would save the whole lot as a file & run that

#  for TAPE in `cat /path_to_list_of_media/tapes.lst`
>  do
>  ROBOT=`vmquery -m $TAPE | grep "robot type"|awk '{print $3}'`
>  case $ROBOT in
>          NONE) echo "Media $TAPE is NOT in library"
>          ;;
>          *) echo "Media $TAPE is in $ROBOT"
>          ;;
>  esac
>  done
Media 300184 is in TLD
Media 300726 is in TLD
Media 300625 is NOT in library
Media 300680 is NOT in library

 

rahul466
Level 3

Thanks Andy...it worked :)