HPUX-LVM
view release on metacpan or search on metacpan
}
print "$templine" if $debug1;
if ($templine =~ /^ LV Status/) {
@tempdataline=split /\s+/, $templine;
$vg_info{$vgname}->{lvols}->{$lvname}->{LV_Status}
=$tempdataline[3];
$lvdatacnt++;
next LINEB;
}
if ($templine =~ /^ LV Size \(Mbytes\)/) {
@tempdataline=split /\s+/, $templine;
$vg_info{$vgname}->{lvols}->{$lvname}->{LV_Size}
=$tempdataline[4];
$lvdatacnt++;
next LINEB;
}
if ($templine =~ /^ Current LE/) {
@tempdataline=split /\s+/, $templine;
$vg_info{$vgname}->{lvols}->{$lvname}->{Current_LE}
=$tempdataline[3];
$lvdatacnt++;
next LINEB;
}
if ($templine =~ /^ Allocated PE/) {
@tempdataline=split /\s+/, $templine;
$vg_info{$vgname}->{lvols}->{$lvname}->{Allocated_PE}
=$tempdataline[3];
$lvdatacnt++;
next LINEB;
}
if ($templine =~ /^ Used PV/) {
@tempdataline=split /\s+/, $templine;
$vg_info{$vgname}->{lvols}->{$lvname}->{Used_PV}
=$tempdataline[3];
$lvdatacnt++;
#
# We should have all the logical volume data now
# if not them something went horriby wrong and the next
# statement will catch it and exit
#
if ($lvdatacnt != 5) {
print "Did not get all the logical volume data from vgdisplay\n";
print "Only got $lvdatacnt of 5\n";
print "Problems...\n";
exit;
}
else {
print "Got all $lvdatacnt of 5 logical volume data for $lvname\n\n" if $debug;
print "vgname: $vgname\n" if $debug;
print "lvname: $lvname\n" if $debug;
@lvdisplay =
`$remote_access $remote_system -l $remote_user -n $remote_command2 $vgname/$lvname`
or die "remote command $remote_command2 failed: $@\n";
#for win95 debugging purposes
# @lvdisplay = `type $lvname.vgtest`;
LVDATALINE: foreach $lvdataline (@lvdisplay) {
#attempt at keepalive timeout prevention below
#attempt at stoping browser timeout print "<B></B>";
if ($lvdataline =~ /^ --- Logical extents ---/) {
#
# Were done summ it up
#
print "Done getting physical volume data.\n" if $debug;
print "Now comparing lvdisplay physical volumes to vgdisplays used PV for each lv. Yet another sanity check\n" if $debug;
if ($lvpvcnt == $vg_info{$vgname}->{lvols}->{$lvname}->{Used_PV} ) {
@final_pvnamedatatemp=();
}
else {
}
$lvpvcnt=0;
last LVDATALINE;
}
if ($lvdataline =~ /^--- Logical volumes ---/) {
$started_lvdatacollect=1;
next LVDATALINE;
}
if ($lvdataline =~ /^LV Name/) {
#get the lvname just like getting the vgname part above
@templvname = split /\s+/, $lvdataline;
$lvname_confirm = $templvname[2];
print "Starting to process $lvname which should be the same as $lvname_confirm!...\n" if $debug;
$lvdatacnt2=0;
next LVDATALINE;
}
if ($lvdataline =~ /^VG Name/) {
@templvname=split /\s+/, $lvdataline;
$vg_info{$vgname}->{lvols}->{$lvname}->{lvdata}->{VG_Name}=$templvname[2];
$lvdatacnt2++;
next LVDATALINE;
}
if ($lvdataline =~ /^LV Permission/) {
@templvname=split /\s+/, $lvdataline;
$vg_info{$vgname}->{lvols}->{$lvname}->{lvdata}->{LV_Permission}=$templvname[2];
$lvdatacnt2++;
next LVDATALINE;
}
if ($lvdataline =~ /^LV Status/) {
@templvname=split /\s+/, $lvdataline;
$vg_info{$vgname}->{lvols}->{$lvname}->{lvdata}->{LV_Status}=$templvname[2];
$lvdatacnt2++;
next LVDATALINE;
}
if ($lvdataline =~ /^Mirror copies/) {
@templvname=split /\s+/, $lvdataline;
$vg_info{$vgname}->{lvols}->{$lvname}->{lvdata}->{Mirror_copies}=$templvname[2];
$lvdatacnt2++;
next LVDATALINE;
}
if ($lvdataline =~ /^Consistency Recovery/) {
@templvname=split /\s+/, $lvdataline;
$vg_info{$vgname}->{lvols}->{$lvname}->{lvdata}->{Consistency_Recovery}=$templvname[2];
$lvdatacnt2++;
next LVDATALINE;
}
( run in 0.474 second using v1.01-cache-2.11-cpan-d7a12ab2c7f )