marbo wrote:
Legato 6.1.4/ Sun Solaris /L180
how to display via command line names of all volumes wihich are currently in
CAP.
we have 6.1.4 and one L700e with 20 CAP slots here, your output may vary:
#!/usr/bin/perl
$notfound = 1;
$lineno = 0;
$anz_leer = 20;
$scsi_id = "2.6.0";
open(JBSTAT, "/etc/LGTOuscsi/sjirdtag ".$scsi_id."| ") || die "cannot open
file";
while ( $notfound && ($line=<JBSTAT>) )
{
$lineno+=1;
chomp($line);
$notfound = ( $line !~ /Element\ Type\ IMPORT\/EXPORT/ );
}
$lineno = 0;
while ( $line=<JBSTAT> )
{
chomp($line);
next if ( $line !~/Elem/ );
$lineno+=1;
print "$lineno\t";
if ( $line =~ /full=0/ )
{
if ( $line =~ /pres_val=0/ )
{
print "Tape-Tragerl fehlt!!!" if ( $line =~ /full=0/ );
}
else
{
print "LEER" if ( $line =~ /full=0/ );
}
}
else
{
print "VOLUME=";
$line=<JBSTAT>;
chomp($line);
$line =~ s/(^\W*VolumeTag.*=\<)(\d{6})(.+$)/$2/;
print "$line";
$anz_leer-=1;
}
print "\n";
}
print "Anzahl freier Import-/Export-Ports: $anz_leer/20\n";
close(JBSTAT);
exit ( $anz_leer );
--
Note: To sign off this list, send a "signoff networker" command via email
to listserv AT listserv.temple DOT edu or visit the list's Web site at
http://listserv.temple.edu/archives/networker.html where you can
also view and post messages to the list. Questions regarding this list
should be sent to stan AT temple DOT edu
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
|