Forum Discussion

backup-botw's avatar
10 years ago

crontab Question

Currently I am running this in cron to send out a scratch pool report...

 

echo "LTO4 in SCRATCH POOL:"
/usr/openv/volmgr/bin/vmquery -rn 1 -w|awk  '{print $1, $3, $9, $12}'|grep -i scratch|grep -v HCART3|wc -l 1>>$OUTFILE1 2>&1
/usr/openv/volmgr/bin/vmquery -rn 1 -w|awk  '{print $1, $3, $9, $12}'|grep -i scratch|grep -v HCART3 1>>$OUTFILE1 2>&1

 

How can I separate this more and only show LTO4 and then have another line that will only show LTO6? Right now its combining both, but I'd like to be able to break this down more  and separate the LTO4 from the LTO6 tapes.

  • It is entirely possible that your tape library is set to only report the leftmost 6 characters (this might be configurable, or it might be hard-coded, you would have to confirm with your library vendor), and that your barcode rule is set to only use those 6. 

    If your tapes' serial numbers happen to indicate the difference in LTO4 or LTO6, such sas all LTO4 tapes start with a "4" and LTO6s start with a "6", you might be able to use that instead of the L* designation.

    If that's not possible, your only method of doing what you want is to go by the HCART/HCART3 designation and hope that no one has misconfigured the tapes. 

    VMquery only reports on the tape info that has been defined for tapes through barcode rules defined by you or your predecessors in the NetBackup inventory process that recognizes new tapes, or updated by the media manager when tapes are mounted and used.  It doesn't detect what the tape type is.  I don't know of a way to determine the tape type without one of the methods above.

8 Replies

  • It can be done by picking up media that has barcode tailing with L3(LTO-3) or L6(LTO-6). You may be able to get barcode of each media from "vmquery -w" or "vmquery -l".

  • Could you be a little bit more specific? I'm sorry, but I'm not really sure what to do with that information. I don't see anything trailing the barcode and I am not sure how what you posted would play into my commands posted in my original post.

  • Would it be possible by adding additional lines to look for the different HCART types?

  • It may be possible, so long as no one reconfigured the barcode rules ever in your environment.

    The HCART, HCART2, HCART3 designations are just labels used to logically separate types of tapes.  They are not specifications, and may be manually defined differently for the same class of tape.  For example, you *could* have some LTO3 tapes that are defined as HCART3, and others as HCART.  And you could also have some LTO4 tapes that are HCART and some that are HCART3.  Trying to separate them out for reporting by the HCART type might not work the way you intend.

     

  • There are BARCODES (usually 8 characters: 6 digits, then an L, and a single digit like 004567L3, 400345L4, ...), and MEDIA IDs (6 characters; either the first 6 of the barcode, or the last 6).

    What is your barcode format, and what is your media ID format, in NetBackup right now?

  • Assuming you actually do have barcodes with trailing "L4" and "L6" in them, this should produce what you are looking for:

    vmquery -rn 1 -w | awk  '{print $4, $3, $9, $12}' | grep -i scratch| grep -i L4 | wc -l

    vmquery -rn 1 -w | awk  '{print $4, $3, $9, $12}' | grep -i scratch| grep -i L6 | wc -l

  • When I go to Media in the GUI I dont see anything after the Media ID or Barcode and the two match. Is there a vmquery type command I should run to be 100% that there is nothing trailing the barcode?

  • It is entirely possible that your tape library is set to only report the leftmost 6 characters (this might be configurable, or it might be hard-coded, you would have to confirm with your library vendor), and that your barcode rule is set to only use those 6. 

    If your tapes' serial numbers happen to indicate the difference in LTO4 or LTO6, such sas all LTO4 tapes start with a "4" and LTO6s start with a "6", you might be able to use that instead of the L* designation.

    If that's not possible, your only method of doing what you want is to go by the HCART/HCART3 designation and hope that no one has misconfigured the tapes. 

    VMquery only reports on the tape info that has been defined for tapes through barcode rules defined by you or your predecessors in the NetBackup inventory process that recognizes new tapes, or updated by the media manager when tapes are mounted and used.  It doesn't detect what the tape type is.  I don't know of a way to determine the tape type without one of the methods above.