Video Screencast Help

vmquery information format

Created: 19 May 2010 • Updated: 20 Jun 2010 | 6 comments
This issue has been solved. See solution.

I need to modify some existing script and would like to find a documentation about the different format we can get with vmquery, I found on the forum -bx but I'm looking for -w and other.

Would anybody have good links for this ?

Regards

Alain

Comments 6 CommentsJump to latest comment

Andy Welburn's picture

your best bet would be the manuals e.g. Veritas NetBackup (tm) 6.5 Commands for UNIX and Linux

where:

-w         Specifies  the  wide  output  format  for  volume
           information.  This  option includes any additional
           information that the -b option does not  show  and
           can be used with any of the other eleven options.

But you can 'discover' additional, unsupported features with the -Q option.
e.g.
# vmquery -Q
UNSUPPORTED OPTIONS
  -bx
      Brief 1-line-per-volume format used by xvmadm.
  -g  <adamm_guid>
      Used to query by adamm guid.
  -o
      Wide 1-line-per-volume format used by oracle load.
  -j
      Wide 1-line-per-volume format used by java.
  -j32
      3.2 format Wide 1-line-per-volume format used by java.
  -X
      Used for debug output print mode.
  -bc <barcode> -mt <media_type> -rt <robot_type> -rn <robot_number>
      Used to query by barcode.
  -loc <robot_number> <robot_type> <robot_coord1> [<robot_coord2>]
      Used to query by robot_number and robot_coord1. If the robot_type
      is ODL, robot_coord2 must be specified.
  -lasttime <server_time>
      Used to filter query to records changed since this time.
  -maxrec <record_limit>
      Used to specify limit of records to be changed with -lasttime queries.
  -assigned
      Used to specify if assigned volumes should be returned.
  -byidgp <media_id>
      Used to query by media_id and return pool information.
  -clrn <robot_number> <robot_type> <cleaning_media_type>
      Used to query for cleaning tape by robot number.
  -M <master_server>
      Obsolete
  -scratchbypool <media_type> <robot_type> <robot_number> <pool_number>
                 <assigntime>
      Used to query for scratch tape by
      media_type/robot_type/robot_number/poolNUMBER.
  -scratchbypool2 <media_type> <robot_type> <robot_number> <pool_name>
                  <assigntime> <status>
      Used to query for scratch tape by
      media_type/robot_type/robot_number/poolNAME.
  -vubc <media_id>
      Used for validate/update barcode.  This option is used by java.
  -noshowvubc
      Used for validate/update barcode.  This option is used by java.
      If specified, the vubc record will not be displayed.
  -add_host <host>
      Add device host to vm.conf.  This option is used by java.
  -delete_host <host>
      Delete device host from vm.conf.  This option is used by java.
  -list_hosts
      Not implemented.
  -noverbose
      Turn off verbose mode.  This option is used by java.
  -addmediaprefix <media_id_prefix>
      Adds a new media id prefix to the vm.conf file.
  -removemediaprefix <media_id_prefix>
      Removes a media id prefix from the vm.conf file.
  -listmediaprefix
      Returns the media id prefixes from the vm.conf file.
  -list_media_genrule
      Returns media id generation rules from the vm.conf file.
  -add_media_genrule <robot_number> <barcode_length> <genrule>
      Adds a new media id generation rule to the vm.conf file.
  -change_media_genrule <robot_number> <barcode_length> <genrule>
      Changes an existing media id generation rule from the vm.conf file.
  -remove_media_genrule <robot_number> <barcode_length>
      Removes a media id generation rule from the vm.conf file.
  -vuguid <media_id>
      Used for validate/update GUID.
  -keep_logs <number_of_days>
      Set the number of days debug logs are kept; 0 = kept forever.
  -add_not_db_host
      Used to set a host's NOT_DATABASE_HOST option in it's vm.conf.
  -remove_not_db_host
      Used to clear a host's NOT_DATABASE_HOST option in it's vm.conf.
NOTE: both -add_not_db_host and -remove_not_db_host will be recognized
by the host's vmd immediately.  There is no need to restart daemons.
  -list_adj_lsm_recs
      Used to list ADJ_LSM entries from the vm.conf file.
  -status_interval <seconds>
      Number of seconds between scan host status updates.
  -add_mm_server_name <hostname> [-quiet]
      Adds the mm server name to the vm.conf file on the local host.
  -remove_mm_server_name
      Removes the mm server name from the vm.conf file on the local host.
  -fs <fetch_size>
      When fetching (querying) records from the server this is the number of
      records in each request.
  -assigntohost <media_id> <assigntime> <hostname>
      Assign a volume by media id and host.  Replaces -assignbyid for
      NetBackup volumes.

SOLUTION
albu77's picture

I went to the doc before posting, but what I can't find is a list of the column for the return of the query for example :
1: media
7: robot host etc...
I'm a total newbie so perhaps I miss something or it's not in the manuals...
Regards

Alain

Andy Welburn's picture

The column headers are there for the following that I've just tried vmquery -b -rn 1 & vmquery -w -rn 1 (admittedly this wraps around a few times & is hard to decipher!)
 

Andy Welburn's picture

which may be a little easier to use than the -w option:

-W
Specifies parsable output format for volume information. The output data
lines are space separated fields except: the MediaID field is padded to 6
characters by adding spaces to the end of the string, the MediaType field
is padded to 8 characters by adding spaces to the end of the string, and
the MediaDescription field may contain spaces within the field. For Vault
containers, the output includes the length of the container description
(DescriptionLength), the container description, and the container ID. The
output header line is a space separated line of column labels.

albu77's picture

I was working with no access, I eventually could have somebody who could send the query and I could get the result with the header.

Many thanks for your answer

Alain

Andy Welburn's picture

...
I would be even happier if you marked one of my posts as such! wink