Forum Discussion

5 Replies

  • vmquery -m <media-id>

    or

    nbemmcmd -listmedia -mediaid <media-id>

  • Thanks Marianne for support.

    of vmquery & nbemmcmd , which one is safe to execute and has least previlege

  • Hi Mate,

     

    Both are good commands, use vmquery I suggest.

  • The commands need the same access level - root if you are using a Unix master.

    They are safe because they only report on tape status.

    vmquery is located in volmgr/bin and nbemmcmd in netbackup/bin/admincmd.

    nbemmcmd gives additional media status. You will see the difference when you run the commands.

    For detailed info on NBU commands, see NBU Commands Reference Guide http://www.symantec.com/docs/DOC3684

  • Nortonsfan

    Please let us know if we managed to answer your query?

    I have run some tests today with these commands as root and as normal user:

    Herewith first 3 lines output from 'vmquery':
    /root >vmquery -m 000031
    ================================================================================
    media ID:              000031
    media type:            1/2" cartridge tape 2 (14)
    barcode:               000031

    nbemmcmd:
    /root >nbemmcmd -listmedia -mediaid 000031
    NBEMMCMD, Version:7.1
    ====================================================================
    Media GUID:                     dbe285d6-1754-11e1-8000-8811c0cc8f89
    Media ID:                       000031
    Partner:                        -
    Media Type:                     HCART2
    Volume Group:                   001_00000_TLD
    Application:                    Netbackup
    Media Flags:                    1
    Description:                    Scratch Media
    Barcode:                        000031
    .....
    ....
     

    Although nbemmcmd seem to have execute permission for everyone, it can only be run by root (or if sudo access has been granted by OS admins):

    $ ls -l nbemmcmd
    -r-xr-xr-x 1 root daemon 1028182 Feb  4  2011 nbemmcmd

    running command as user 'admin':

    [admin@master admincmd]$ ./nbemmcmd -listmedia -mediaid 000031
    NBEMMCMD, Version:7.1
    You are not authorized to run this command.
    Command did not complete successfully.

    vmquery worked as user 'admin':

    -r-xr-xr-x 1 root daemon 409952 Feb  4  2011 vmquery

    [admin@master ]$ /usr/openv/volmgr/bin/vmquery -m 000031
    ================================================================================
    media ID:              000031
    media type:            1/2" cartridge tape 2 (14)
    barcode:               000031
    .....

     

    Hope this helps?