• Please help support our sponsors by considering their products and services.
    Our sponsors enable us to serve you with this high-speed Internet connection and fast webservers you are currently using at ADSM.ORG.
    They support this free flow of information and knowledge exchange service at no cost to you.

    Please welcome our latest sponsor Tectrade . We can show our appreciation by learning more about Tectrade Solutions
  • Community Tip: Please Give Thanks to Those Sharing Their Knowledge.

    If you receive helpful answer on this forum, please show thanks to the poster by clicking "LIKE" link for the answer that you found helpful.

  • Community Tip: Forum Rules (PLEASE CLICK HERE TO READ BEFORE POSTING)

    Click the link above to access ADSM.ORG Acceptable Use Policy and forum rules which should be observed when using this website. Violators may be banned from this website. This notice will disappear after you have made at least 3 posts.

TSM tape reporting tool for library (libvol) , vol , and acsls or 3494 inventory

run

ADSM.ORG Member
#1
In case anyone wants it, I've written a nice perl script that gives a list of

tapes in an STK ACSLS library, the output from a 'q libvol', and a 'q vol'.

Additionally, it shows the state of a tape (readwrite,readonly,offsite,unavail...)

as well as the % full. If you know any perl, it can be easily modified for a 3494 using the tapeutil command. I wrote this because I was tired of trying to determine if a volumes was in the library volume output verse actually in the library (acsls). Here it's all in a single simple screen. enjoy. ( TSM server is 3.7 but version doesn't really matter, perl is version 5.5003, and running on AIX 4.3.3 server)



#!/usr/bin/perl



$acsls_output_file = "acsls.vols";



# get acsls tape listing



system "echo 'q vol all' > /tmp/perl.tmp";

system "/usr/bin/rsh acsls_server -l acsss /export/home/ACSSS/bin/cmd_proc < /tmp/perl.tmp > $acsls_output_file";

# already generated for now



open(FILE," $acsls_output_file");

open(OUTFILE,"> ${acsls_output_file}.short");



@acsls = ();

while (<FILE>) {



# only care about BB/DT/IT/BD tapes on spaten

if ( (/^s*(BBS+)/) || (/^s*(DTS+)/) || (/^s*(ITS+)/) || (/^s*(BDS+)/) ) {

#print " acsls volume = $1n";

push (@acsls,$1);



} #end if

} # end while



### testing ###

#foreach $tape (keys %acsls) {

# print "key = $tapen";

#}



# get TSm libvol output #

@output_libvols = `/usr/bin/dsmadmc -id=sql -password=sqlsql "select volume_name from libvolumes"`;



@libvols = ();

foreach (@output_libvols) {

chomp;

if ( /^([A-Z][A-Z]dddd)s+/ ) {

#print "libvol = $1n";

push (@libvols,$1);

}

}



# get TSM volume output

@output_vols = `/usr/bin/dsmadmc -id=sql -password=sqlsql "select volume_name, access,pct_utilized from v

olumes where devclass_name<>'DISK'"`;



@vols = ();

foreach (@output_vols) {

chomp;

if ( /^([A-Z][A-Z]dddd)s+(S+)s+(S+)/ ) {

#print "vol = $1n";

push (@vols,"$1,$2,$3");

}

}





# use TSm volume as master list of all known tapesa

# compare the vol list with libvol list and acsls list



foreach $item (@vols) {



($tape,$state,$percent) = split(",",$item);



# search for $tape in @libvol array and then pop out value

# shorten list

$found_libvol = &find_val(*libvols,$tape);

if ($found_libvol) {

$libvol_name= $tape;

} else {

$libvol_name="";

}



# search for $tape in @acsls array and then pop out value

$found_acsls = &find_val(*acsls,$tape);



if ($found_acsls) {

$acsls_name = $tape;

} else {

$acsls_name ="";

}

# print header and each line where (vol) (libvol) (acsls)



write;

}



# now go through libvol array to find like database volumes



# lastly go through acsls array to find volumes in acsls not in TSM

# things that need to be fixed in other words



###########

# subroutines #

############



# find a value array, if found return 1, else return 0 (not found)

# also removes the found element from array, to shorten it up



sub find_val {



local(*array_name,$value) = @_;



for ($i=0;$i <= $#array_name ; $i++)

{

if ($value eq $array_name[$i]) {

splice(@array_name,$i,1);

return 1;

}

} # end for loop



return 0; # didn't find

} # end sub find_val



########

# formats

#########



format top =

Volume Libvol ACSLS status % full

====== ====== ====== =========== ======

.



format STDOUT =

@>>>>> @>>>>> @>>>>> @>>>>>>>>>>> @>>>>>

$tape,$libvol_name,$acsls_name,$state,$percent

.
 

Advertise at ADSM.ORG

If you are reading this, so are your potential customer. Advertise at ADSM.ORG right now.

UpCloud high performance VPS at $5/month

Get started with $25 in credits on Cloud Servers. You must use link below to receive the credit. Use the promo to get upto 5 month of FREE Linux VPS.

The Spectrum Protect TLA (Three-Letter Acronym): ISP or something else?

  • Every product needs a TLA, Let's call it ISP (IBM Spectrum Protect).

    Votes: 17 19.5%
  • Keep using TSM for Spectrum Protect.

    Votes: 53 60.9%
  • Let's be formal and just say Spectrum Protect

    Votes: 10 11.5%
  • Other (please comement)

    Votes: 7 8.0%

Forum statistics

Threads
31,468
Messages
134,118
Members
21,568
Latest member
MESSID
Top