| 1 | package HPUX::LVM; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 1 | ▶ | use 5.006; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 1 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | #use warnings; | ||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 1 | require Exporter; | |||||||||||||||||||||||||||
| 8 | 1 | ▶ | use AutoLoader qw(AUTOLOAD); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 1 | our @ISA = qw(Exporter); | |||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | # Items to export into callers namespace by default. Note: do not export | ||||||||||||||||||||||||||||
| 13 | # names by default without a very good reason. Use EXPORT_OK instead. | ||||||||||||||||||||||||||||
| 14 | # Do not simply export all your public functions/methods/constants. | ||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||
| 16 | # This allows declaration use HPUX::LVM ':all'; | ||||||||||||||||||||||||||||
| 17 | # If you do not need this, moving things directly into @EXPORT or @EXPORT_OK | ||||||||||||||||||||||||||||
| 18 | # will save memory. | ||||||||||||||||||||||||||||
| 19 | 1 | our %EXPORT_TAGS = ( 'all' => [ qw( | |||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||
| 21 | ) ] ); | ||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 1 | our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); | |||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | 1 | our @EXPORT = qw( | |||||||||||||||||||||||||||
| 26 | |||||||||||||||||||||||||||||
| 27 | ); | ||||||||||||||||||||||||||||
| 28 | 1 | our $VERSION = '1.06'; | |||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | # Preloaded methods go here. | ||||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | # Autoload methods go after =cut, and are processed by the autosplit program. | ||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | ### Start | ||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||
| 37 | 1 | ▶ | use vars '$AUTOLOAD'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 38 | 1 | ▶ | use Carp ; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 39 | 1 | ▶ | use Storable; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | sub new | ||||||||||||||||||||||||||||
| 42 | 1 | ▶ | { | ||||||||||||||||||||||||||
|
Subroutine
new: called CC=91 SCAR=87.1
Pod
documented
| |||||||||||||||||||||||||||||
| 43 | 1 | my $debug=0; | |||||||||||||||||||||||||||
| 44 | 1 | my $debug1=0; | |||||||||||||||||||||||||||
| 45 | 1 | my $debug2=0; | |||||||||||||||||||||||||||
| 46 | 1 | my $debug5=0; | |||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | 1 | my ($class, @subargs) = @_ ; | |||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | 1 | my %arglist = ( | |||||||||||||||||||||||||||
| 51 | target_type => "local" , | ||||||||||||||||||||||||||||
| 52 | persistance => "new" , | ||||||||||||||||||||||||||||
| 53 | datafile => "/tmp/lvminfo.dat", | ||||||||||||||||||||||||||||
| 54 | access_prog => "ssh" , | ||||||||||||||||||||||||||||
| 55 | access_system => "localhost" , | ||||||||||||||||||||||||||||
| 56 | access_user => "root" , | ||||||||||||||||||||||||||||
| 57 | remote_command1 => '/usr/sbin/vgdisplay -v', | ||||||||||||||||||||||||||||
| 58 | remote_command2 => '/usr/sbin/lvdisplay -v', | ||||||||||||||||||||||||||||
| 59 | @subargs, | ||||||||||||||||||||||||||||
| 60 | ); | ||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||
| 62 | 1 | ▶ | if ($debug) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 63 | 0 | print "target_type : $arglist{target_type}\n"; | |||||||||||||||||||||||||||
| 64 | 0 | print "persistance : $arglist{persistance}\n"; | |||||||||||||||||||||||||||
| 65 | 0 | print "datafile : $arglist{datafile}\n"; | |||||||||||||||||||||||||||
| 66 | 0 | print "access_prog : $arglist{access_prog}\n"; | |||||||||||||||||||||||||||
| 67 | 0 | print "access_system: $arglist{access_system}\n"; | |||||||||||||||||||||||||||
| 68 | 0 | print "access_user : $arglist{access_user}\n"; | |||||||||||||||||||||||||||
| 69 | 0 | print "remote_command1: $arglist{remote_command1}\n"; | |||||||||||||||||||||||||||
| 70 | 0 | print "remote_command2: $arglist{remote_command2}\n"; | |||||||||||||||||||||||||||
| 71 | } | ||||||||||||||||||||||||||||
| 72 | |||||||||||||||||||||||||||||
| 73 | 1 | my $source_access =$arglist{target_type}; | |||||||||||||||||||||||||||
| 74 | 1 | my $new_or_saved =$arglist{persistance}; | |||||||||||||||||||||||||||
| 75 | 1 | my $datafile =$arglist{datafile}; | |||||||||||||||||||||||||||
| 76 | 1 | my $remote_access =$arglist{access_prog}; | |||||||||||||||||||||||||||
| 77 | 1 | my $remote_system =$arglist{access_system}; | |||||||||||||||||||||||||||
| 78 | 1 | my $remote_user =$arglist{access_user}; | |||||||||||||||||||||||||||
| 79 | 1 | my $remote_command1 =$arglist{remote_command1}; | |||||||||||||||||||||||||||
| 80 | 1 | my $remote_command2 =$arglist{remote_command2}; | |||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||
| 82 | 1 | my $templine; #line by line of vgdisplay output | |||||||||||||||||||||||||||
| 83 | my @tempdataline; #space split templine when gathering vg | ||||||||||||||||||||||||||||
| 84 | #and lv attributes | ||||||||||||||||||||||||||||
| 85 | 1 | my @tempdataline1; #slash sub split of tempdataline value so lvname | |||||||||||||||||||||||||||
| 86 | #can be lvol1 and not /dev/vg02/lvol1 | ||||||||||||||||||||||||||||
| 87 | 1 | my $alternate_link="no"; #yes or no to indicate an alternate | |||||||||||||||||||||||||||
| 88 | #link was found | ||||||||||||||||||||||||||||
| 89 | 1 | my @vgdisplay; #results of vgdisplay command | |||||||||||||||||||||||||||
| 90 | my @lvdisplay; #results of lvdisplay command | ||||||||||||||||||||||||||||
| 91 | 1 | my $lvname_confirm; #holds lvname extracted from output | |||||||||||||||||||||||||||
| 92 | #(templvname) and compares to current | ||||||||||||||||||||||||||||
| 93 | #lvnamefrom vgdisplay (yet another sanity check) | ||||||||||||||||||||||||||||
| 94 | 1 | my @templvname; #split line on match of LV Name in | |||||||||||||||||||||||||||
| 95 | #lvdisplay output | ||||||||||||||||||||||||||||
| 96 | |||||||||||||||||||||||||||||
| 97 | 1 | my @currentline_savetemp; #space split current_line (templine) | |||||||||||||||||||||||||||
| 98 | 1 | my @lastline_savetemp; #had to save previous lines data for alt-links | |||||||||||||||||||||||||||
| 99 | 1 | my $lastline_save; #Space split lastline_savetemp | |||||||||||||||||||||||||||
| 100 | 1 | my $pvname_previous; #extracted from lastline_savetemp | |||||||||||||||||||||||||||
| 101 | 1 | my $alternate_pvname; | |||||||||||||||||||||||||||
| 102 | 1 | my $alternate_line; | |||||||||||||||||||||||||||
| 103 | 1 | my %alternate_link_list; #May be getting rid of this one | |||||||||||||||||||||||||||
| 104 | 1 | my $current_VG; #volume group that its currently working | |||||||||||||||||||||||||||
| 105 | #on in the loop | ||||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||
| 107 | 1 | my @tempvgname; #space split templine that vgname was found on | |||||||||||||||||||||||||||
| 108 | 1 | my $vgname; #extracted from tempvgname | |||||||||||||||||||||||||||
| 109 | 1 | my $vgname_save; #saved copy of above | |||||||||||||||||||||||||||
| 110 | |||||||||||||||||||||||||||||
| 111 | 1 | my $volgrpdatacnt; #number of attributes for a volume group | |||||||||||||||||||||||||||
| 112 | #(sanity check) | ||||||||||||||||||||||||||||
| 113 | 1 | my $lvdatacnt; #number of attributes that each logical | |||||||||||||||||||||||||||
| 114 | #volume has (sanity check) in vgdisplay | ||||||||||||||||||||||||||||
| 115 | #command 5? | ||||||||||||||||||||||||||||
| 116 | 1 | my $lvdataline; # each line in lvdisplay command | |||||||||||||||||||||||||||
| 117 | 1 | my %vg_info; #MAIN hash that it returns! | |||||||||||||||||||||||||||
| 118 | 1 | my $vginfo_ref = \%vg_info; | |||||||||||||||||||||||||||
| 119 | |||||||||||||||||||||||||||||
| 120 | 1 | my $lvcnt; #number of logical volumes in vg's | |||||||||||||||||||||||||||
| 121 | my $lvname; #name of current logical volume in command | ||||||||||||||||||||||||||||
| 122 | 1 | my $started_lvdatacollect; #0 or 1 depending on if it has | |||||||||||||||||||||||||||
| 123 | #started to parse the lvdisplay attributes yet | ||||||||||||||||||||||||||||
| 124 | 1 | my $lvdatacnt2; #number of attributes gathered for | |||||||||||||||||||||||||||
| 125 | #logical volume in lvdisplay command 15? | ||||||||||||||||||||||||||||
| 126 | #should be the same number for all. this is just | ||||||||||||||||||||||||||||
| 127 | #a sanity check for the paranoid parser people | ||||||||||||||||||||||||||||
| 128 | 1 | my $parse_logical_vols; #set to yes when it gets to the | |||||||||||||||||||||||||||
| 129 | #logical volume output of the vgdisplay command | ||||||||||||||||||||||||||||
| 130 | # so it can skip some if checks | ||||||||||||||||||||||||||||
| 131 | 1 | my $lvpvcnt; #number of physical volumes in logical | |||||||||||||||||||||||||||
| 132 | #volume per lvdisplay output. later | ||||||||||||||||||||||||||||
| 133 | #compared to vgdisplays PV count. | ||||||||||||||||||||||||||||
| 134 | 1 | my @final_pvnamedatatemp; # array that contains LE on PV and | |||||||||||||||||||||||||||
| 135 | #PE on PV per the lvdisplay command | ||||||||||||||||||||||||||||
| 136 | #later to be turned into hash value | ||||||||||||||||||||||||||||
| 137 | 1 | my $pvtempname; #just a definition for debugging purposes. | |||||||||||||||||||||||||||
| 138 | #Its the pv name from lvdisplay distribution | ||||||||||||||||||||||||||||
| 139 | #of physical volumes part | ||||||||||||||||||||||||||||
| 140 | 1 | my $pvcnt; #number of physical volumes in volume | |||||||||||||||||||||||||||
| 141 | #group from ---physical volumes--- part. | ||||||||||||||||||||||||||||
| 142 | 1 | my $pvdatacnt; #number of attributs associated to the | |||||||||||||||||||||||||||
| 143 | #phyical volumes part of vgdisplay output (sanity check) | ||||||||||||||||||||||||||||
| 144 | 1 | my $pvname; #physical volume name from physical volumes | |||||||||||||||||||||||||||
| 145 | #section of vgdisplay output | ||||||||||||||||||||||||||||
| 146 | |||||||||||||||||||||||||||||
| 147 | # Check for persistance request | ||||||||||||||||||||||||||||
| 148 | |||||||||||||||||||||||||||||
| 149 | 1 | ▶ | if ($arglist{persistance} eq "old") { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 150 | 1 | ▶ | print "retrieving a copy from prosperity...\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 151 | 1 | ▶ | $vginfo_ref = Storable::retrieve $datafile | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 152 | or die "unable to retrieve hash data in /tmp\n"; | ||||||||||||||||||||||||||||
| 153 | 1 | return bless($vginfo_ref,$class); | |||||||||||||||||||||||||||
| 154 | } | ||||||||||||||||||||||||||||
| 155 | |||||||||||||||||||||||||||||
| 156 | 0 | ▶ | @vgdisplay=`$remote_access $remote_system -l $remote_user -n $remote_command1` | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 157 | or die "Unable to execute $remote_command1: $@\n"; | ||||||||||||||||||||||||||||
| 158 | |||||||||||||||||||||||||||||
| 159 | # For debuggin on win95 | ||||||||||||||||||||||||||||
| 160 | # @vgdisplay=`type vgdisplay.vgtest` or die "unable to exec command vgdisplay: $@\n"; | ||||||||||||||||||||||||||||
| 161 | |||||||||||||||||||||||||||||
| 162 | |||||||||||||||||||||||||||||
| 163 | |||||||||||||||||||||||||||||
| 164 | |||||||||||||||||||||||||||||
| 165 | |||||||||||||||||||||||||||||
| 166 | 0 | LINEB: foreach $templine (@vgdisplay) { | |||||||||||||||||||||||||||
| 167 | 0 | ▶ | if ( $templine eq "" || $templine =~ /^\s+$/ ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$templine eq "" or $templine =~ /^\s+$/
MC/DC0%0/2
$templine eq "" or $templine =~ /^\s+$/
$templine eq ""
$templine =~ /^\s+$/
Truth table0%0/3
A or B
A= $templine eq ""B= $templine =~ /^\s+$/
| |||||||||||||||||||||||||||||
| 168 | 0 | next LINEB; | |||||||||||||||||||||||||||
| 169 | } | ||||||||||||||||||||||||||||
| 170 | # | ||||||||||||||||||||||||||||
| 171 | # Added this code to support Alternate link indentification. | ||||||||||||||||||||||||||||
| 172 | # This required that I save the previous lines data | ||||||||||||||||||||||||||||
| 173 | # Not yet merged into new format yet. | ||||||||||||||||||||||||||||
| 174 | # | ||||||||||||||||||||||||||||
| 175 | |||||||||||||||||||||||||||||
| 176 | # First check to see if the alternate link flag has been tripped | ||||||||||||||||||||||||||||
| 177 | |||||||||||||||||||||||||||||
| 178 | 0 | ▶ | if ($alternate_link eq "yes" ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 179 | 0 | @currentline_savetemp = split /\s+/,$alternate_line; | |||||||||||||||||||||||||||
| 180 | 0 | @lastline_savetemp = split /\s+/,$lastline_save; | |||||||||||||||||||||||||||
| 181 | 0 | $pvname_previous = $lastline_savetemp[3]; | |||||||||||||||||||||||||||
| 182 | #print "pvname_previous is $pvname_previous\n"; | ||||||||||||||||||||||||||||
| 183 | 0 | $alternate_pvname = $currentline_savetemp[3]; | |||||||||||||||||||||||||||
| 184 | # | ||||||||||||||||||||||||||||
| 185 | # I give up. Create an alternate link hash with the key as the main link | ||||||||||||||||||||||||||||
| 186 | #and the alternate as the value and refrence it later | ||||||||||||||||||||||||||||
| 187 | # | ||||||||||||||||||||||||||||
| 188 | 0 | ▶ | print "Adding Alternate link/s to object\n" if $debug5; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 189 | 0 | push @{ $alternate_link_list{$pvname_previous} },$alternate_pvname; | |||||||||||||||||||||||||||
| 190 | 0 | $vg_info{$vgname}->{Physical_Vols}->{$pvname_previous}->{Alternate_Links}=\@{ $alternate_link_list{$pvname_previous} }; | |||||||||||||||||||||||||||
| 191 | #print "alternate_pvname is $alternate_pvname\n"; | ||||||||||||||||||||||||||||
| 192 | 0 | $alternate_link="no"; | |||||||||||||||||||||||||||
| 193 | #next LINEB; | ||||||||||||||||||||||||||||
| 194 | } | ||||||||||||||||||||||||||||
| 195 | # End of Alternate link code that I have yet to use in new format | ||||||||||||||||||||||||||||
| 196 | |||||||||||||||||||||||||||||
| 197 | 0 | ▶ | if ($templine =~ /^VG Name/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 198 | #get the vgname | ||||||||||||||||||||||||||||
| 199 | 0 | @tempvgname = split /\s+/, $templine; | |||||||||||||||||||||||||||
| 200 | 0 | $vgname = $tempvgname[2]; | |||||||||||||||||||||||||||
| 201 | 0 | $vgname_save = $vgname; | |||||||||||||||||||||||||||
| 202 | # print "Initializing $vgname...\n"; | ||||||||||||||||||||||||||||
| 203 | 0 | $volgrpdatacnt=0; | |||||||||||||||||||||||||||
| 204 | 0 | $current_VG = $vgname; | |||||||||||||||||||||||||||
| 205 | 0 | next LINEB; | |||||||||||||||||||||||||||
| 206 | } | ||||||||||||||||||||||||||||
| 207 | 0 | ▶ | next LINEB unless defined($current_VG); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 208 | # Now get all the volumegroup data | ||||||||||||||||||||||||||||
| 209 | 0 | ▶ | if ($templine =~ /^VG Write Access/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 210 | 0 | @tempdataline=split /\s+/, $templine; | |||||||||||||||||||||||||||
| 211 | 0 | $vg_info{$vgname}->{VG_Write_Access}=$tempdataline[3]; | |||||||||||||||||||||||||||
| 212 | 0 | $volgrpdatacnt++; | |||||||||||||||||||||||||||
| 213 | 0 | next LINEB; | |||||||||||||||||||||||||||
| 214 | } | ||||||||||||||||||||||||||||
| 215 | 0 | ▶ | if ($templine =~ /^VG Status/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 216 | 0 | @tempdataline=split /\s+/, $templine; | |||||||||||||||||||||||||||
| 217 | 0 | $vg_info{$vgname}->{VG_Status}=$tempdataline[2]; | |||||||||||||||||||||||||||
| 218 | 0 | $volgrpdatacnt++; | |||||||||||||||||||||||||||
| 219 | 0 | next LINEB; | |||||||||||||||||||||||||||
| 220 | } | ||||||||||||||||||||||||||||
| 221 | 0 | ▶ | if ($templine =~ /^Max LV/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 222 | 0 | @tempdataline=split /\s+/, $templine; | |||||||||||||||||||||||||||
| 223 | 0 | $vg_info{$vgname}->{Max_LV}=$tempdataline[2]; | |||||||||||||||||||||||||||
| 224 | 0 | $volgrpdatacnt++; | |||||||||||||||||||||||||||
| 225 | 0 | next LINEB; | |||||||||||||||||||||||||||
| 226 | } | ||||||||||||||||||||||||||||
| 227 | 0 | ▶ | if ($templine =~ /^Cur LV/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 228 | 0 | @tempdataline=split /\s+/, $templine; | |||||||||||||||||||||||||||
| 229 | 0 | $vg_info{$vgname}->{Cur_LV}=$tempdataline[2]; | |||||||||||||||||||||||||||
| 230 | 0 | $volgrpdatacnt++; | |||||||||||||||||||||||||||
| 231 | 0 | next LINEB; | |||||||||||||||||||||||||||
| 232 | } | ||||||||||||||||||||||||||||
| 233 | 0 | ▶ | if ($templine =~ /^Open LV/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 234 | 0 | @tempdataline=split /\s+/, $templine; | |||||||||||||||||||||||||||
| 235 | 0 | $vg_info{$vgname}->{Open_LV}=$tempdataline[2]; | |||||||||||||||||||||||||||
| 236 | 0 | $volgrpdatacnt++; | |||||||||||||||||||||||||||
| 237 | 0 | next LINEB; | |||||||||||||||||||||||||||
| 238 | } | ||||||||||||||||||||||||||||
| 239 | 0 | ▶ | if ($templine =~ /^Max PV/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 240 | 0 | @tempdataline=split /\s+/, $templine; | |||||||||||||||||||||||||||
| 241 | 0 | $vg_info{$vgname}->{Max_PV}=$tempdataline[2]; | |||||||||||||||||||||||||||
| 242 | 0 | $volgrpdatacnt++; | |||||||||||||||||||||||||||
| 243 | 0 | next LINEB; | |||||||||||||||||||||||||||
| 244 | } | ||||||||||||||||||||||||||||
| 245 | 0 | ▶ | if ($templine =~ /^Cur PV/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 246 | 0 | @tempdataline=split /\s+/, $templine; | |||||||||||||||||||||||||||
| 247 | 0 | $vg_info{$vgname}->{Cur_PV}=$tempdataline[2]; | |||||||||||||||||||||||||||
| 248 | 0 | $volgrpdatacnt++; | |||||||||||||||||||||||||||
| 249 | 0 | next LINEB; | |||||||||||||||||||||||||||
| 250 | } | ||||||||||||||||||||||||||||
| 251 | 0 | ▶ | if ($templine =~ /^Act PV/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 252 | 0 | @tempdataline=split /\s+/, $templine; | |||||||||||||||||||||||||||
| 253 | 0 | $vg_info{$vgname}->{Act_PV}=$tempdataline[2]; | |||||||||||||||||||||||||||
| 254 | 0 | $volgrpdatacnt++; | |||||||||||||||||||||||||||
| 255 | 0 | next LINEB; | |||||||||||||||||||||||||||
| 256 | } | ||||||||||||||||||||||||||||
| 257 | 0 | ▶ | if ($templine =~ /^Max PE per PV/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 258 | 0 | @tempdataline=split /\s+/, $templine; | |||||||||||||||||||||||||||
| 259 | 0 | $vg_info{$vgname}->{Max_PE_per_PV}=$tempdataline[4]; | |||||||||||||||||||||||||||
| 260 | 0 | $volgrpdatacnt++; | |||||||||||||||||||||||||||
| 261 | 0 | next LINEB; | |||||||||||||||||||||||||||
| 262 | } | ||||||||||||||||||||||||||||
| 263 | 0 | ▶ | if ($templine =~ /^VGDA/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 264 | 0 | @tempdataline=split /\s+/, $templine; | |||||||||||||||||||||||||||
| 265 | 0 | $vg_info{$vgname}->{VGDA}=$tempdataline[1]; | |||||||||||||||||||||||||||
| 266 | 0 | $volgrpdatacnt++; | |||||||||||||||||||||||||||
| 267 | 0 | next LINEB; | |||||||||||||||||||||||||||
| 268 | } | ||||||||||||||||||||||||||||
| 269 | 0 | ▶ | if ($templine =~ /^PE Size \(Mbytes\)/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 270 | 0 | @tempdataline=split /\s+/, $templine; | |||||||||||||||||||||||||||
| 271 | 0 | $vg_info{$vgname}->{PE_Size_Mbytes}=$tempdataline[3]; | |||||||||||||||||||||||||||
| 272 | 0 | $volgrpdatacnt++; | |||||||||||||||||||||||||||
| 273 | 0 | next LINEB; | |||||||||||||||||||||||||||
| 274 | } | ||||||||||||||||||||||||||||
| 275 | 0 | ▶ | if ($templine =~ /^Total PE/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 276 | 0 | @tempdataline=split /\s+/, $templine; | |||||||||||||||||||||||||||
| 277 | 0 | $vg_info{$vgname}->{Total_PE}=$tempdataline[2]; | |||||||||||||||||||||||||||
| 278 | 0 | $volgrpdatacnt++; | |||||||||||||||||||||||||||
| 279 | 0 | next LINEB; | |||||||||||||||||||||||||||
| 280 | } | ||||||||||||||||||||||||||||
| 281 | 0 | ▶ | if ($templine =~ /^Alloc PE/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 282 | 0 | @tempdataline=split /\s+/, $templine; | |||||||||||||||||||||||||||
| 283 | 0 | $vg_info{$vgname}->{Alloc_PE}=$tempdataline[2]; | |||||||||||||||||||||||||||
| 284 | 0 | $volgrpdatacnt++; | |||||||||||||||||||||||||||
| 285 | 0 | next LINEB; | |||||||||||||||||||||||||||
| 286 | } | ||||||||||||||||||||||||||||
| 287 | 0 | ▶ | if ($templine =~ /^Free PE/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 288 | 0 | @tempdataline=split /\s+/, $templine; | |||||||||||||||||||||||||||
| 289 | 0 | $vg_info{$vgname}->{Free_PE}=$tempdataline[2]; | |||||||||||||||||||||||||||
| 290 | 0 | $volgrpdatacnt++; | |||||||||||||||||||||||||||
| 291 | 0 | next LINEB; | |||||||||||||||||||||||||||
| 292 | } | ||||||||||||||||||||||||||||
| 293 | 0 | ▶ | if ($templine =~ /^Total PVG/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 294 | 0 | @tempdataline=split /\s+/, $templine; | |||||||||||||||||||||||||||
| 295 | 0 | $vg_info{$vgname}->{Total_PVG}=$tempdataline[2]; | |||||||||||||||||||||||||||
| 296 | 0 | $volgrpdatacnt++; | |||||||||||||||||||||||||||
| 297 | 0 | next LINEB; | |||||||||||||||||||||||||||
| 298 | } | ||||||||||||||||||||||||||||
| 299 | 0 | ▶ | if ( $volgrpdatacnt == 15 ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 300 | 0 | ▶ | print "Got all volume group data for $current_VG, $volgrpdatacnt of 15\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 301 | 0 | $volgrpdatacnt=0; | |||||||||||||||||||||||||||
| 302 | } | ||||||||||||||||||||||||||||
| 303 | # | ||||||||||||||||||||||||||||
| 304 | # Now get and store logical volume data for current VG | ||||||||||||||||||||||||||||
| 305 | # | ||||||||||||||||||||||||||||
| 306 | 0 | ▶ | if ($templine =~ /^ --- Logical volumes ---/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 307 | #print "Start of Logical Volume data\n"; | ||||||||||||||||||||||||||||
| 308 | 0 | $lvcnt = 0; | |||||||||||||||||||||||||||
| 309 | 0 | $parse_logical_vols="yes"; | |||||||||||||||||||||||||||
| 310 | 0 | next LINEB; | |||||||||||||||||||||||||||
| 311 | } | ||||||||||||||||||||||||||||
| 312 | 0 | ▶ | if ($templine =~ /^ LV Name/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 313 | 0 | @tempdataline=split /\s+/, $templine; | |||||||||||||||||||||||||||
| 314 | 0 | ▶ | print "Logical volume parse: $tempdataline[3]\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 315 | 0 | @tempdataline1 = split /\//, $tempdataline[3]; | |||||||||||||||||||||||||||
| 316 | 0 | ▶ | print "Just Logical Volume : $tempdataline1[3]\n" if $debug1; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 317 | 0 | $lvname = $tempdataline1[3]; | |||||||||||||||||||||||||||
| 318 | 0 | ▶ | print "Starting logical volume $lvname\n" if $debug1; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 319 | 0 | $lvdatacnt=0; | |||||||||||||||||||||||||||
| 320 | 0 | next LINEB; | |||||||||||||||||||||||||||
| 321 | } | ||||||||||||||||||||||||||||
| 322 | 0 | ▶ | print "$templine" if $debug1; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 323 | |||||||||||||||||||||||||||||
| 324 | 0 | ▶ | if ($templine =~ /^ LV Status/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 325 | 0 | @tempdataline=split /\s+/, $templine; | |||||||||||||||||||||||||||
| 326 | $vg_info{$vgname}->{lvols}->{$lvname}->{LV_Status} | ||||||||||||||||||||||||||||
| 327 | 0 | =$tempdataline[3]; | |||||||||||||||||||||||||||
| 328 | 0 | $lvdatacnt++; | |||||||||||||||||||||||||||
| 329 | 0 | next LINEB; | |||||||||||||||||||||||||||
| 330 | } | ||||||||||||||||||||||||||||
| 331 | 0 | ▶ | if ($templine =~ /^ LV Size \(Mbytes\)/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 332 | 0 | @tempdataline=split /\s+/, $templine; | |||||||||||||||||||||||||||
| 333 | $vg_info{$vgname}->{lvols}->{$lvname}->{LV_Size} | ||||||||||||||||||||||||||||
| 334 | 0 | =$tempdataline[4]; | |||||||||||||||||||||||||||
| 335 | 0 | $lvdatacnt++; | |||||||||||||||||||||||||||
| 336 | 0 | next LINEB; | |||||||||||||||||||||||||||
| 337 | } | ||||||||||||||||||||||||||||
| 338 | 0 | ▶ | if ($templine =~ /^ Current LE/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 339 | 0 | @tempdataline=split /\s+/, $templine; | |||||||||||||||||||||||||||
| 340 | $vg_info{$vgname}->{lvols}->{$lvname}->{Current_LE} | ||||||||||||||||||||||||||||
| 341 | 0 | =$tempdataline[3]; | |||||||||||||||||||||||||||
| 342 | 0 | $lvdatacnt++; | |||||||||||||||||||||||||||
| 343 | 0 | next LINEB; | |||||||||||||||||||||||||||
| 344 | } | ||||||||||||||||||||||||||||
| 345 | 0 | ▶ | if ($templine =~ /^ Allocated PE/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 346 | 0 | @tempdataline=split /\s+/, $templine; | |||||||||||||||||||||||||||
| 347 | $vg_info{$vgname}->{lvols}->{$lvname}->{Allocated_PE} | ||||||||||||||||||||||||||||
| 348 | 0 | =$tempdataline[3]; | |||||||||||||||||||||||||||
| 349 | 0 | $lvdatacnt++; | |||||||||||||||||||||||||||
| 350 | 0 | next LINEB; | |||||||||||||||||||||||||||
| 351 | } | ||||||||||||||||||||||||||||
| 352 | 0 | ▶ | if ($templine =~ /^ Used PV/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 353 | 0 | @tempdataline=split /\s+/, $templine; | |||||||||||||||||||||||||||
| 354 | $vg_info{$vgname}->{lvols}->{$lvname}->{Used_PV} | ||||||||||||||||||||||||||||
| 355 | 0 | =$tempdataline[3]; | |||||||||||||||||||||||||||
| 356 | 0 | $lvdatacnt++; | |||||||||||||||||||||||||||
| 357 | # | ||||||||||||||||||||||||||||
| 358 | # We should have all the logical volume data now | ||||||||||||||||||||||||||||
| 359 | # if not them something went horriby wrong and the next | ||||||||||||||||||||||||||||
| 360 | # statement will catch it and exit | ||||||||||||||||||||||||||||
| 361 | # | ||||||||||||||||||||||||||||
| 362 | 0 | ▶ | if ($lvdatacnt != 5) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 363 | 0 | print "Did not get all the logical volume data from vgdisplay\n"; | |||||||||||||||||||||||||||
| 364 | 0 | print "Only got $lvdatacnt of 5\n"; | |||||||||||||||||||||||||||
| 365 | 0 | print "Problems...\n"; | |||||||||||||||||||||||||||
| 366 | 0 | exit; | |||||||||||||||||||||||||||
| 367 | } | ||||||||||||||||||||||||||||
| 368 | else { | ||||||||||||||||||||||||||||
| 369 | 0 | ▶ | print "Got all $lvdatacnt of 5 logical volume data for $lvname\n\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 370 | 0 | ▶ | print "vgname: $vgname\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 371 | 0 | ▶ | print "lvname: $lvname\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 372 | |||||||||||||||||||||||||||||
| 373 | 0 | ▶ | @lvdisplay = | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 374 | `$remote_access $remote_system -l $remote_user -n $remote_command2 $vgname/$lvname` | ||||||||||||||||||||||||||||
| 375 | or die "remote command $remote_command2 failed: $@\n"; | ||||||||||||||||||||||||||||
| 376 | |||||||||||||||||||||||||||||
| 377 | #for win95 debugging purposes | ||||||||||||||||||||||||||||
| 378 | # @lvdisplay = `type $lvname.vgtest`; | ||||||||||||||||||||||||||||
| 379 | |||||||||||||||||||||||||||||
| 380 | 0 | LVDATALINE: foreach $lvdataline (@lvdisplay) { | |||||||||||||||||||||||||||
| 381 | #attempt at keepalive timeout prevention below | ||||||||||||||||||||||||||||
| 382 | #attempt at stoping browser timeout print "<B></B>"; | ||||||||||||||||||||||||||||
| 383 | |||||||||||||||||||||||||||||
| 384 | 0 | ▶ | if ($lvdataline =~ /^ --- Logical extents ---/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 385 | # | ||||||||||||||||||||||||||||
| 386 | # Were done summ it up | ||||||||||||||||||||||||||||
| 387 | # | ||||||||||||||||||||||||||||
| 388 | 0 | ▶ | print "Done getting physical volume data.\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 389 | 0 | ▶ | print "Now comparing lvdisplay physical volumes to vgdisplays used PV for each lv. Yet another sanity check\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 390 | 0 | ▶ | if ($lvpvcnt == $vg_info{$vgname}->{lvols}->{$lvname}->{Used_PV} ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 391 | 0 | @final_pvnamedatatemp=(); | |||||||||||||||||||||||||||
| 392 | } | ||||||||||||||||||||||||||||
| 393 | |||||||||||||||||||||||||||||
| 394 | else { | ||||||||||||||||||||||||||||
| 395 | } | ||||||||||||||||||||||||||||
| 396 | 0 | $lvpvcnt=0; | |||||||||||||||||||||||||||
| 397 | 0 | last LVDATALINE; | |||||||||||||||||||||||||||
| 398 | } | ||||||||||||||||||||||||||||
| 399 | 0 | ▶ | if ($lvdataline =~ /^--- Logical volumes ---/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 400 | 0 | $started_lvdatacollect=1; | |||||||||||||||||||||||||||
| 401 | 0 | next LVDATALINE; | |||||||||||||||||||||||||||
| 402 | } | ||||||||||||||||||||||||||||
| 403 | |||||||||||||||||||||||||||||
| 404 | 0 | ▶ | if ($lvdataline =~ /^LV Name/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 405 | #get the lvname just like getting the vgname part above | ||||||||||||||||||||||||||||
| 406 | 0 | @templvname = split /\s+/, $lvdataline; | |||||||||||||||||||||||||||
| 407 | 0 | $lvname_confirm = $templvname[2]; | |||||||||||||||||||||||||||
| 408 | 0 | ▶ | print "Starting to process $lvname which should be the same as $lvname_confirm!...\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 409 | 0 | $lvdatacnt2=0; | |||||||||||||||||||||||||||
| 410 | 0 | next LVDATALINE; | |||||||||||||||||||||||||||
| 411 | } | ||||||||||||||||||||||||||||
| 412 | 0 | ▶ | if ($lvdataline =~ /^VG Name/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 413 | 0 | @templvname=split /\s+/, $lvdataline; | |||||||||||||||||||||||||||
| 414 | 0 | $vg_info{$vgname}->{lvols}->{$lvname}->{lvdata}->{VG_Name}=$templvname[2]; | |||||||||||||||||||||||||||
| 415 | 0 | $lvdatacnt2++; | |||||||||||||||||||||||||||
| 416 | 0 | next LVDATALINE; | |||||||||||||||||||||||||||
| 417 | } | ||||||||||||||||||||||||||||
| 418 | 0 | ▶ | if ($lvdataline =~ /^LV Permission/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 419 | 0 | @templvname=split /\s+/, $lvdataline; | |||||||||||||||||||||||||||
| 420 | 0 | $vg_info{$vgname}->{lvols}->{$lvname}->{lvdata}->{LV_Permission}=$templvname[2]; | |||||||||||||||||||||||||||
| 421 | 0 | $lvdatacnt2++; | |||||||||||||||||||||||||||
| 422 | 0 | next LVDATALINE; | |||||||||||||||||||||||||||
| 423 | } | ||||||||||||||||||||||||||||
| 424 | 0 | ▶ | if ($lvdataline =~ /^LV Status/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 425 | 0 | @templvname=split /\s+/, $lvdataline; | |||||||||||||||||||||||||||
| 426 | 0 | $vg_info{$vgname}->{lvols}->{$lvname}->{lvdata}->{LV_Status}=$templvname[2]; | |||||||||||||||||||||||||||
| 427 | 0 | $lvdatacnt2++; | |||||||||||||||||||||||||||
| 428 | 0 | next LVDATALINE; | |||||||||||||||||||||||||||
| 429 | } | ||||||||||||||||||||||||||||
| 430 | 0 | ▶ | if ($lvdataline =~ /^Mirror copies/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 431 | 0 | @templvname=split /\s+/, $lvdataline; | |||||||||||||||||||||||||||
| 432 | 0 | $vg_info{$vgname}->{lvols}->{$lvname}->{lvdata}->{Mirror_copies}=$templvname[2]; | |||||||||||||||||||||||||||
| 433 | 0 | $lvdatacnt2++; | |||||||||||||||||||||||||||
| 434 | 0 | next LVDATALINE; | |||||||||||||||||||||||||||
| 435 | } | ||||||||||||||||||||||||||||
| 436 | 0 | ▶ | if ($lvdataline =~ /^Consistency Recovery/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 437 | 0 | @templvname=split /\s+/, $lvdataline; | |||||||||||||||||||||||||||
| 438 | 0 | $vg_info{$vgname}->{lvols}->{$lvname}->{lvdata}->{Consistency_Recovery}=$templvname[2]; | |||||||||||||||||||||||||||
| 439 | 0 | $lvdatacnt2++; | |||||||||||||||||||||||||||
| 440 | 0 | next LVDATALINE; | |||||||||||||||||||||||||||
| 441 | } | ||||||||||||||||||||||||||||
| 442 | 0 | ▶ | if ($lvdataline =~ /^Schedule/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 443 | 0 | @templvname=split /\s+/, $lvdataline; | |||||||||||||||||||||||||||
| 444 | 0 | $vg_info{$vgname}->{lvols}->{$lvname}->{lvdata}->{Schedule}=$templvname[1]; | |||||||||||||||||||||||||||
| 445 | 0 | $lvdatacnt2++; | |||||||||||||||||||||||||||
| 446 | 0 | next LVDATALINE; | |||||||||||||||||||||||||||
| 447 | } | ||||||||||||||||||||||||||||
| 448 | 0 | ▶ | if ($lvdataline =~ /^LV Size \(Mbytes\)/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 449 | 0 | @templvname=split /\s+/, $lvdataline; | |||||||||||||||||||||||||||
| 450 | 0 | $vg_info{$vgname}->{lvols}->{$lvname}->{lvdata}->{LV_Size_Mbytes}=$templvname[3]; | |||||||||||||||||||||||||||
| 451 | 0 | $lvdatacnt2++; | |||||||||||||||||||||||||||
| 452 | 0 | next LVDATALINE; | |||||||||||||||||||||||||||
| 453 | } | ||||||||||||||||||||||||||||
| 454 | 0 | ▶ | if ($lvdataline =~ /^Current LE/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 455 | 0 | @templvname=split /\s+/, $lvdataline; | |||||||||||||||||||||||||||
| 456 | 0 | $vg_info{$vgname}->{lvols}->{$lvname}->{lvdata}->{Current_LE}=$templvname[2]; | |||||||||||||||||||||||||||
| 457 | 0 | $lvdatacnt2++; | |||||||||||||||||||||||||||
| 458 | 0 | next LVDATALINE; | |||||||||||||||||||||||||||
| 459 | } | ||||||||||||||||||||||||||||
| 460 | 0 | ▶ | if ($lvdataline =~ /^Allocated PE/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 461 | 0 | @templvname=split /\s+/, $lvdataline; | |||||||||||||||||||||||||||
| 462 | 0 | $vg_info{$vgname}->{lvols}->{$lvname}->{lvdata}->{Allocated_PE}=$templvname[2]; | |||||||||||||||||||||||||||
| 463 | 0 | $lvdatacnt2++; | |||||||||||||||||||||||||||
| 464 | 0 | next LVDATALINE; | |||||||||||||||||||||||||||
| 465 | } | ||||||||||||||||||||||||||||
| 466 | 0 | ▶ | if ($lvdataline =~ /^Stripes/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 467 | 0 | @templvname=split /\s+/, $lvdataline; | |||||||||||||||||||||||||||
| 468 | 0 | $vg_info{$vgname}->{lvols}->{$lvname}->{lvdata}->{Stripes}=$templvname[1]; | |||||||||||||||||||||||||||
| 469 | 0 | $lvdatacnt2++; | |||||||||||||||||||||||||||
| 470 | 0 | next LVDATALINE; | |||||||||||||||||||||||||||
| 471 | } | ||||||||||||||||||||||||||||
| 472 | 0 | ▶ | if ($lvdataline =~ /^Stripe Size \(Kbytes\)/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 473 | 0 | @templvname=split /\s+/, $lvdataline; | |||||||||||||||||||||||||||
| 474 | 0 | $vg_info{$vgname}->{lvols}->{$lvname}->{lvdata}->{Stripe_Size_Kbytes}=$templvname[3]; | |||||||||||||||||||||||||||
| 475 | 0 | $lvdatacnt2++; | |||||||||||||||||||||||||||
| 476 | 0 | next LVDATALINE; | |||||||||||||||||||||||||||
| 477 | } | ||||||||||||||||||||||||||||
| 478 | 0 | ▶ | if ($lvdataline =~ /^Bad block/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 479 | 0 | @templvname=split /\s+/, $lvdataline; | |||||||||||||||||||||||||||
| 480 | 0 | $vg_info{$vgname}->{lvols}->{$lvname}->{lvdata}->{Bad_block}=$templvname[2]; | |||||||||||||||||||||||||||
| 481 | 0 | $lvdatacnt2++; | |||||||||||||||||||||||||||
| 482 | 0 | next LVDATALINE; | |||||||||||||||||||||||||||
| 483 | } | ||||||||||||||||||||||||||||
| 484 | 0 | ▶ | if ($lvdataline =~ /^Allocation/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 485 | 0 | @templvname=split /\s+/, $lvdataline; | |||||||||||||||||||||||||||
| 486 | 0 | $vg_info{$vgname}->{lvols}->{$lvname}->{lvdata}->{Allocation}=$templvname[1]; | |||||||||||||||||||||||||||
| 487 | 0 | $lvdatacnt2++; | |||||||||||||||||||||||||||
| 488 | 0 | next LVDATALINE; | |||||||||||||||||||||||||||
| 489 | } | ||||||||||||||||||||||||||||
| 490 | 0 | ▶ | if ($lvdataline =~ /^IO Timeout \(Seconds\)/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 491 | 0 | @templvname=split /\s+/, $lvdataline; | |||||||||||||||||||||||||||
| 492 | 0 | $vg_info{$vgname}->{lvols}->{$lvname}->{lvdata}->{IO_Timeout_Seconds}=$templvname[3]; | |||||||||||||||||||||||||||
| 493 | 0 | $lvdatacnt2++; | |||||||||||||||||||||||||||
| 494 | 0 | next LVDATALINE; | |||||||||||||||||||||||||||
| 495 | } | ||||||||||||||||||||||||||||
| 496 | # End of extracting logical volume attributes | ||||||||||||||||||||||||||||
| 497 | #now count em up and compare to a static number that its supposed to be | ||||||||||||||||||||||||||||
| 498 | 0 | ▶ | if ($lvdatacnt2 != 14) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 499 | 0 | print "Did not get all the logical volume data in lvdisplay command\n"; | |||||||||||||||||||||||||||
| 500 | 0 | print "Only got $lvdatacnt2 of 14\n"; | |||||||||||||||||||||||||||
| 501 | 0 | print "Problems...\n"; | |||||||||||||||||||||||||||
| 502 | 0 | exit; | |||||||||||||||||||||||||||
| 503 | } | ||||||||||||||||||||||||||||
| 504 | else { | ||||||||||||||||||||||||||||
| 505 | 0 | ▶ | print "Got all $lvdatacnt2 of 14 logical volume data for $lvname\n\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 506 | } | ||||||||||||||||||||||||||||
| 507 | |||||||||||||||||||||||||||||
| 508 | 0 | ▶ | if ($lvdataline =~ /^ --- Distribution of logical volume ---/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 509 | 0 | ▶ | print "Start of Physical Volume data for $lvname\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 510 | 0 | $lvpvcnt = 0; | |||||||||||||||||||||||||||
| 511 | 0 | next LVDATALINE; | |||||||||||||||||||||||||||
| 512 | } | ||||||||||||||||||||||||||||
| 513 | |||||||||||||||||||||||||||||
| 514 | 0 | ▶ | if ($lvdataline =~ /^ \/dev/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 515 | 0 | @tempdataline=split /\s+/, $lvdataline; | |||||||||||||||||||||||||||
| 516 | # | ||||||||||||||||||||||||||||
| 517 | # Ouch, my head hurts now... Now I add a third hash with an annonymouns array as the value that | ||||||||||||||||||||||||||||
| 518 | # contains the pv info | ||||||||||||||||||||||||||||
| 519 | # | ||||||||||||||||||||||||||||
| 520 | 0 | $pvtempname=$tempdataline[1]; | |||||||||||||||||||||||||||
| 521 | 0 | ▶ | print "PVname should be : $pvtempname\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 522 | 0 | ▶ | print "tempdataline2 is : $tempdataline[2]\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 523 | 0 | ▶ | print "tempdataline3 is : $tempdataline[3]\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 524 | #add it here directly! | ||||||||||||||||||||||||||||
| 525 | 0 | $vg_info{$vgname}->{lvols}->{$lvname}->{Ordered_PV}->{$lvpvcnt}=$tempdataline[1]; | |||||||||||||||||||||||||||
| 526 | 0 | $vg_info{$vgname}->{lvols}->{$lvname}->{PV_Data}->{$tempdataline[1]}->{le_on_pv}=$tempdataline[2]; | |||||||||||||||||||||||||||
| 527 | 0 | $vg_info{$vgname}->{lvols}->{$lvname}->{PV_Data}->{$tempdataline[1]}->{pe_on_pv}=$tempdataline[3]; | |||||||||||||||||||||||||||
| 528 | #$logical_volume_hash_data{$vgname}{$lvname}{LVPVDATA}=$lvdataline[2]; | ||||||||||||||||||||||||||||
| 529 | 0 | $lvpvcnt++; | |||||||||||||||||||||||||||
| 530 | 0 | next LVDATALINE; | |||||||||||||||||||||||||||
| 531 | } | ||||||||||||||||||||||||||||
| 532 | #NEXT LINE ENDS lvdisplay foreach | ||||||||||||||||||||||||||||
| 533 | } | ||||||||||||||||||||||||||||
| 534 | |||||||||||||||||||||||||||||
| 535 | 0 | next LINEB; | |||||||||||||||||||||||||||
| 536 | #next line ends else statement way up there | ||||||||||||||||||||||||||||
| 537 | } | ||||||||||||||||||||||||||||
| 538 | } #end of "Used PV last volume group extract if statement | ||||||||||||||||||||||||||||
| 539 | # | ||||||||||||||||||||||||||||
| 540 | # Here we start the physical volume data gathering thats in the vgdisplay output just for yucks... | ||||||||||||||||||||||||||||
| 541 | # | ||||||||||||||||||||||||||||
| 542 | 0 | ▶ | if ($templine =~ /^ --- Physical volumes ---/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 543 | # print "Start of Physical Volume data for volume group $current_VG\n"; | ||||||||||||||||||||||||||||
| 544 | 0 | $pvcnt = 0; | |||||||||||||||||||||||||||
| 545 | 0 | next LINEB; | |||||||||||||||||||||||||||
| 546 | } | ||||||||||||||||||||||||||||
| 547 | 0 | ▶ | if ($templine =~ /^ PV Name/ && $templine !~ /Alternate Link/ ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$templine =~ /^ PV Name/ and not $templine =~ /Alternate Link/
MC/DC0%0/2
$templine =~ /^ PV Name/ and not $templine =~ /Alternate Link/
$templine =~ /^ PV Name/
not $templine =~ /Alternate Link/
Truth table0%0/3
A and not(B)
A= $templine =~ /^ PV Name/B= not $templine =~ /Alternate Link/
| |||||||||||||||||||||||||||||
| 548 | 0 | $lastline_save = $templine; | |||||||||||||||||||||||||||
| 549 | 0 | @tempdataline=split /\s+/, $templine; | |||||||||||||||||||||||||||
| 550 | 0 | $pvname = $tempdataline[3]; | |||||||||||||||||||||||||||
| 551 | #print "Starting Physical volume $pvname in group $current_VG\n"; | ||||||||||||||||||||||||||||
| 552 | #push @{ $physical_volume_hash_data{$vgname}{$pvname}}, $tempdataline[3]; | ||||||||||||||||||||||||||||
| 553 | 0 | $pvdatacnt=0; | |||||||||||||||||||||||||||
| 554 | 0 | next LINEB; | |||||||||||||||||||||||||||
| 555 | } | ||||||||||||||||||||||||||||
| 556 | # | ||||||||||||||||||||||||||||
| 557 | #Added this one to support PV links | ||||||||||||||||||||||||||||
| 558 | # | ||||||||||||||||||||||||||||
| 559 | 0 | ▶ | if ($templine =~ /^ PV Name/ && $templine =~ /Alternate Link/ ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$templine =~ /^ PV Name/ and $templine =~ /Alternate Link/
MC/DC0%0/2
$templine =~ /^ PV Name/ and $templine =~ /Alternate Link/
$templine =~ /^ PV Name/
$templine =~ /Alternate Link/
Truth table0%0/3
A and B
A= $templine =~ /^ PV Name/B= $templine =~ /Alternate Link/
| |||||||||||||||||||||||||||||
| 560 | #set the flag for processing at the beginning of the next LINEB foreach | ||||||||||||||||||||||||||||
| 561 | 0 | ▶ | print "Caught an alternate link\n" if $debug5; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 562 | 0 | $alternate_line=$templine; | |||||||||||||||||||||||||||
| 563 | 0 | $alternate_link="yes"; | |||||||||||||||||||||||||||
| 564 | 0 | next LINEB; | |||||||||||||||||||||||||||
| 565 | } | ||||||||||||||||||||||||||||
| 566 | |||||||||||||||||||||||||||||
| 567 | 0 | ▶ | if ($templine =~ /^ PV Status/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 568 | # Made it past alternate links, set default value if its not there. | ||||||||||||||||||||||||||||
| 569 | 0 | ▶ | unless ( exists( $vg_info{$vgname}->{Physical_Vols}->{$pvname}->{Alternate_Links}) ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 570 | 0 | ▶ | print "No Alternate links found! setting default\n" if $debug5; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 571 | 0 | $vg_info{$vgname}->{Physical_Vols}->{$pvname}->{Alternate_Links}=[ "None" ]; | |||||||||||||||||||||||||||
| 572 | } | ||||||||||||||||||||||||||||
| 573 | 0 | @tempdataline=split /\s+/, $templine; | |||||||||||||||||||||||||||
| 574 | 0 | $vg_info{$vgname}->{Physical_Vols}->{$pvname}->{PV_Status}=$tempdataline[3]; | |||||||||||||||||||||||||||
| 575 | 0 | $pvdatacnt++; | |||||||||||||||||||||||||||
| 576 | 0 | next LINEB; | |||||||||||||||||||||||||||
| 577 | } | ||||||||||||||||||||||||||||
| 578 | 0 | ▶ | if ($templine =~ /^ Total PE/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 579 | 0 | @tempdataline=split /\s+/, $templine; | |||||||||||||||||||||||||||
| 580 | 0 | $vg_info{$vgname}->{Physical_Vols}->{$pvname}->{Total_PE}=$tempdataline[3]; | |||||||||||||||||||||||||||
| 581 | 0 | $pvdatacnt++; | |||||||||||||||||||||||||||
| 582 | 0 | next LINEB; | |||||||||||||||||||||||||||
| 583 | } | ||||||||||||||||||||||||||||
| 584 | 0 | ▶ | if ($templine =~ /^ Free PE/) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 585 | 0 | @tempdataline=split /\s+/, $templine; | |||||||||||||||||||||||||||
| 586 | 0 | $vg_info{$vgname}->{Physical_Vols}->{$pvname}->{Free_PE}=$tempdataline[3]; | |||||||||||||||||||||||||||
| 587 | 0 | $pvdatacnt++; | |||||||||||||||||||||||||||
| 588 | # | ||||||||||||||||||||||||||||
| 589 | # We should have all the physical volume data now | ||||||||||||||||||||||||||||
| 590 | # | ||||||||||||||||||||||||||||
| 591 | 0 | ▶ | if ($pvdatacnt != 3) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 592 | 0 | print "Did not get all the physical volume data\n"; | |||||||||||||||||||||||||||
| 593 | 0 | print "Only got $pvdatacnt of 3\n"; | |||||||||||||||||||||||||||
| 594 | 0 | print "Problems...\n"; | |||||||||||||||||||||||||||
| 595 | 0 | exit; | |||||||||||||||||||||||||||
| 596 | } | ||||||||||||||||||||||||||||
| 597 | else { | ||||||||||||||||||||||||||||
| 598 | # print "Got all $pvdatacnt of 3 physical volume data for $lvname\n"; | ||||||||||||||||||||||||||||
| 599 | } | ||||||||||||||||||||||||||||
| 600 | 0 | next LINEB; | |||||||||||||||||||||||||||
| 601 | } | ||||||||||||||||||||||||||||
| 602 | |||||||||||||||||||||||||||||
| 603 | #Should not see the next line print out!!! All lines should be accounted for | ||||||||||||||||||||||||||||
| 604 | #print "Unaccounted for line:\n"; | ||||||||||||||||||||||||||||
| 605 | #print "$templine"; | ||||||||||||||||||||||||||||
| 606 | } #end of vgdisplay extraction routine foreach | ||||||||||||||||||||||||||||
| 607 | |||||||||||||||||||||||||||||
| 608 | 0 | ▶ | if ( $arglist{persistance} eq "new" ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 609 | 0 | ▶ | print "saving a copy for prosperity...\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 610 | 0 | ▶ | Storable::nstore \%vg_info, $datafile | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 611 | or die "unable to store hash data in /tmp\n"; | ||||||||||||||||||||||||||||
| 612 | } | ||||||||||||||||||||||||||||
| 613 | |||||||||||||||||||||||||||||
| 614 | |||||||||||||||||||||||||||||
| 615 | |||||||||||||||||||||||||||||
| 616 | |||||||||||||||||||||||||||||
| 617 | 0 | return bless($vginfo_ref, $class); | |||||||||||||||||||||||||||
| 618 | } | ||||||||||||||||||||||||||||
| 619 | |||||||||||||||||||||||||||||
| 620 | |||||||||||||||||||||||||||||
| 621 | 1 | ▶ | sub AUTOLOAD { | ||||||||||||||||||||||||||
|
Subroutine
AUTOLOAD: called CC=38 SCAR=72.1
| |||||||||||||||||||||||||||||
| 622 | # | ||||||||||||||||||||||||||||
| 623 | # Some ugly hacketry to be able to autoload sub hashes. | ||||||||||||||||||||||||||||
| 624 | # There must be a better way. | ||||||||||||||||||||||||||||
| 625 | # | ||||||||||||||||||||||||||||
| 626 | 1 | my $debug = 0; | |||||||||||||||||||||||||||
| 627 | |||||||||||||||||||||||||||||
| 628 | 1 | my ($class, @subargs) = @_ ; | |||||||||||||||||||||||||||
| 629 | |||||||||||||||||||||||||||||
| 630 | 1 | ▶ | return if $AUTOLOAD =~ /::DESTROY$/; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 631 | |||||||||||||||||||||||||||||
| 632 | 0 | my %arglist = ( | |||||||||||||||||||||||||||
| 633 | volume_group => undef, | ||||||||||||||||||||||||||||
| 634 | vg_sub_cat => undef, | ||||||||||||||||||||||||||||
| 635 | vg_sub_cat_lv => undef, | ||||||||||||||||||||||||||||
| 636 | vg_sub_cat_lv_data => undef, | ||||||||||||||||||||||||||||
| 637 | vg_sub_cat_pv => undef, | ||||||||||||||||||||||||||||
| 638 | vg_sub_cat_pv_data => undef, | ||||||||||||||||||||||||||||
| 639 | vg_sub_cat_pv_data_pv => undef, | ||||||||||||||||||||||||||||
| 640 | @subargs, | ||||||||||||||||||||||||||||
| 641 | ); | ||||||||||||||||||||||||||||
| 642 | |||||||||||||||||||||||||||||
| 643 | 0 | ▶ | print "Passed: @_<--\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 644 | 0 | ▶ | print "Yoyoyoyo got called here\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 645 | 0 | my $self = $class; | |||||||||||||||||||||||||||
| 646 | 0 | ▶ | my $VOLGRP = $arglist{volume_group} || "0"; #required to get anything useful | ||||||||||||||||||||||||||
|
Condition0%0/2
$arglist{'volume_group'} || '0'
MC/DC0%0/1
$arglist{'volume_group'} || '0'
$arglist{'volume_group'}
Truth table0%0/2
A
A= $arglist{'volume_group'}
| |||||||||||||||||||||||||||||
| 647 | 0 | ▶ | print "VOLGRP is $VOLGRP\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 648 | 0 | ▶ | my $THIRDARG = $arglist{vg_sub_cat} || "0"; # should be one of Volgrp attrs if not defined else: | ||||||||||||||||||||||||||
|
Condition0%0/2
$arglist{'vg_sub_cat'} || '0'
MC/DC0%0/1
$arglist{'vg_sub_cat'} || '0'
$arglist{'vg_sub_cat'}
Truth table0%0/2
A
A= $arglist{'vg_sub_cat'}
| |||||||||||||||||||||||||||||
| 649 | # "Physical_Vols" | ||||||||||||||||||||||||||||
| 650 | # "lvols" | ||||||||||||||||||||||||||||
| 651 | 0 | ▶ | print "THIRDARG is $THIRDARG\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 652 | |||||||||||||||||||||||||||||
| 653 | 0 | ▶ | my $FOURTHARG = $arglist{vg_sub_cat_lv} || $arglist{vg_sub_cat_pv} || "0"; # can be each of the following: | ||||||||||||||||||||||||||
|
Condition0%0/5
$arglist{'vg_sub_cat_lv'} || $arglist{'vg_sub_cat_pv'} || '0'
$arglist{"vg_sub_cat_lv"} or $arglist{"vg_sub_cat_pv"}
MC/DC0%0/2
$arglist{'vg_sub_cat_lv'} || $arglist{'vg_sub_cat_pv'} || '0'
$arglist{"vg_sub_cat_lv"}
$arglist{"vg_sub_cat_pv"}
Truth table0%0/3
A or B
A= $arglist{"vg_sub_cat_lv"}B= $arglist{"vg_sub_cat_pv"}
| |||||||||||||||||||||||||||||
| 654 | # actual phyical vol "/dev/dsk/..." | ||||||||||||||||||||||||||||
| 655 | # actual logical volume "lvol#" | ||||||||||||||||||||||||||||
| 656 | 0 | ▶ | print "FOURTHARG is $FOURTHARG\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 657 | |||||||||||||||||||||||||||||
| 658 | 0 | ▶ | my $FIFTHARG = $arglist{vg_sub_cat_lv_data} || $arglist{vg_sub_cat_pv_data} || "0"; # Can be any of the following: | ||||||||||||||||||||||||||
|
Condition0%0/5
$arglist{'vg_sub_cat_lv_data'} || $arglist{'vg_sub_cat_pv_data'} || '0'
$arglist{"vg_sub_cat_lv_data"} or $arglist{"vg_sub_cat_pv_data"}
MC/DC0%0/2
$arglist{'vg_sub_cat_lv_data'} || $arglist{'vg_sub_cat_pv_data'} || '0'
$arglist{"vg_sub_cat_lv_data"}
$arglist{"vg_sub_cat_pv_data"}
Truth table0%0/3
A or B
A= $arglist{"vg_sub_cat_lv_data"}B= $arglist{"vg_sub_cat_pv_data"}
| |||||||||||||||||||||||||||||
| 659 | # physical volume attribute if not defined | ||||||||||||||||||||||||||||
| 660 | # logical volume attribute if not defined | ||||||||||||||||||||||||||||
| 661 | # OR link on to: | ||||||||||||||||||||||||||||
| 662 | # "PV_Data" | ||||||||||||||||||||||||||||
| 663 | # "lvdata" | ||||||||||||||||||||||||||||
| 664 | 0 | ▶ | print "FIFTHARG is $FIFTHARG\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 665 | |||||||||||||||||||||||||||||
| 666 | 0 | ▶ | my $SIXTHARG = $arglist{vg_sub_cat_pv_data_pv} || "0"; # can be "lvdata" attribute if not defined else | ||||||||||||||||||||||||||
|
Condition0%0/2
$arglist{'vg_sub_cat_pv_data_pv'} || '0'
MC/DC0%0/1
$arglist{'vg_sub_cat_pv_data_pv'} || '0'
$arglist{'vg_sub_cat_pv_data_pv'}
Truth table0%0/2
A
A= $arglist{'vg_sub_cat_pv_data_pv'}
| |||||||||||||||||||||||||||||
| 667 | # actual phyical volume "/dev/dsk..." | ||||||||||||||||||||||||||||
| 668 | 0 | ▶ | print "SIXTHARG is $SIXTHARG\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 669 | |||||||||||||||||||||||||||||
| 670 | 0 | ▶ | print "VOLGRP: $VOLGRP\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 671 | 0 | ▶ | print "AUTOLOAD: $AUTOLOAD\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 672 | 0 | ▶ | $AUTOLOAD =~ /.*::get_(\w+)/ or croak "No Such method: $AUTOLOAD\n"; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 673 | 0 | ▶ | print "AUTOLOAD is now: $AUTOLOAD\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 674 | 0 | ▶ | croak "$self not an object" unless ref($self); | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 675 | # return if $AUTOLOAD =~ /::DESTROY$/; | ||||||||||||||||||||||||||||
| 676 | # start checking arguments here from 6th down to 3rd | ||||||||||||||||||||||||||||
| 677 | 0 | ▶ | print "\$1 is set to: $1\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 678 | |||||||||||||||||||||||||||||
| 679 | |||||||||||||||||||||||||||||
| 680 | 0 | ▶ | if ($SIXTHARG) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 681 | 0 | ▶ | print "Found sixtharg.\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 682 | 0 | ▶ | unless (exists $self->{$VOLGRP}->{$THIRDARG}->{$FOURTHARG}->{$FIFTHARG}->{$SIXTHARG}->{$1}) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 683 | 0 | croak "Cannot access $1 field in $self->{$VOLGRP}->{$THIRDARG}->{$FOURTHARG}->{$FIFTHARG}->{$SIXTHARG}\n"; | |||||||||||||||||||||||||||
| 684 | } | ||||||||||||||||||||||||||||
| 685 | 0 | return $self->{$VOLGRP}->{$THIRDARG}->{$FOURTHARG}->{$FIFTHARG}->{$SIXTHARG}->{$1}; | |||||||||||||||||||||||||||
| 686 | } | ||||||||||||||||||||||||||||
| 687 | |||||||||||||||||||||||||||||
| 688 | 0 | ▶ | if ($FIFTHARG) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 689 | 0 | ▶ | print "Found fiftharg.\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 690 | 0 | ▶ | unless (exists $self->{$VOLGRP}->{$THIRDARG}->{$FOURTHARG}->{$FIFTHARG}->{$1}) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 691 | 0 | croak "Cannot access $1 field in $self->{$VOLGRP}->{$THIRDARG}->{$FOURTHARG}->{$FIFTHARG}\n"; | |||||||||||||||||||||||||||
| 692 | } | ||||||||||||||||||||||||||||
| 693 | 0 | return $self->{$VOLGRP}->{$THIRDARG}->{$FOURTHARG}->{$FIFTHARG}->{$1}; | |||||||||||||||||||||||||||
| 694 | } | ||||||||||||||||||||||||||||
| 695 | |||||||||||||||||||||||||||||
| 696 | |||||||||||||||||||||||||||||
| 697 | 0 | ▶ | if ($FOURTHARG) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 698 | 0 | ▶ | print "Found fourtharg.\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 699 | 0 | ▶ | unless (exists $self->{$VOLGRP}->{$THIRDARG}->{$FOURTHARG}->{$1}) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 700 | 0 | croak "Cannot access $1 field in $self->{$VOLGRP}->{$THIRDARG}->{$FOURTHARG}\n"; | |||||||||||||||||||||||||||
| 701 | } | ||||||||||||||||||||||||||||
| 702 | 0 | return $self->{$VOLGRP}->{$THIRDARG}->{$FOURTHARG}->{$1}; | |||||||||||||||||||||||||||
| 703 | } | ||||||||||||||||||||||||||||
| 704 | |||||||||||||||||||||||||||||
| 705 | 0 | ▶ | if ($THIRDARG) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 706 | 0 | ▶ | print "Found thirdarg.\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 707 | 0 | ▶ | unless (exists $self->{$VOLGRP}->{$THIRDARG}->{$1}) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 708 | 0 | croak "Cannot access $1 field in $self->{$VOLGRP}->{$THIRDARG}"; | |||||||||||||||||||||||||||
| 709 | } | ||||||||||||||||||||||||||||
| 710 | 0 | return $self->{$VOLGRP}->{$THIRDARG}->{$FOURTHARG}->{$1}; | |||||||||||||||||||||||||||
| 711 | } | ||||||||||||||||||||||||||||
| 712 | |||||||||||||||||||||||||||||
| 713 | # Just check the main volgrp attr | ||||||||||||||||||||||||||||
| 714 | 0 | ▶ | print "No extra args. continur to check default level\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 715 | |||||||||||||||||||||||||||||
| 716 | 0 | ▶ | unless (exists $self->{$VOLGRP}->{$1}) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 717 | 0 | croak "Cannot access $1 field in $self->{$VOLGRP}\n"; | |||||||||||||||||||||||||||
| 718 | } | ||||||||||||||||||||||||||||
| 719 | 0 | ▶ | print "self says its: $self->{$1}\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 720 | 0 | ▶ | if (@_) { return $self->{$VOLGRP}->{$1} = shift } | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 721 | 0 | else { return $self->{$VOLGRP}->{$1} } | |||||||||||||||||||||||||||
| 722 | |||||||||||||||||||||||||||||
| 723 | |||||||||||||||||||||||||||||
| 724 | } | ||||||||||||||||||||||||||||
| 725 | |||||||||||||||||||||||||||||
| 726 | 0 | ▶ | sub traverse { | ||||||||||||||||||||||||||
|
Subroutine
traverse: not called CC=17 SCAR=57.2
Pod
documented
| |||||||||||||||||||||||||||||
| 727 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 728 | 0 | my $debug=0; | |||||||||||||||||||||||||||
| 729 | 0 | my $debug2=0; | |||||||||||||||||||||||||||
| 730 | 0 | ▶ | print "I am self: $self\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 731 | 0 | my $mainkey; | |||||||||||||||||||||||||||
| 732 | my $subkey; | ||||||||||||||||||||||||||||
| 733 | 0 | my $subsubkey; | |||||||||||||||||||||||||||
| 734 | 0 | my $subsubsubkey; | |||||||||||||||||||||||||||
| 735 | 0 | my $subsubsubsubkey; | |||||||||||||||||||||||||||
| 736 | 0 | my $subsubsubsubsubkey; | |||||||||||||||||||||||||||
| 737 | 0 | my $dev_file; | |||||||||||||||||||||||||||
| 738 | |||||||||||||||||||||||||||||
| 739 | 0 | foreach $mainkey ( sort keys %{ $self } ) { | |||||||||||||||||||||||||||
| 740 | 0 | print "Main Key: $mainkey\n"; | |||||||||||||||||||||||||||
| 741 | 0 | print "Values:\n"; | |||||||||||||||||||||||||||
| 742 | 0 | foreach $subkey ( sort keys %{ $self->{$mainkey} } ) { | |||||||||||||||||||||||||||
| 743 | 0 | print " SubKey: $subkey, Value: $self->{$mainkey}->{$subkey}\n"; | |||||||||||||||||||||||||||
| 744 | 0 | ▶ | print "ref:",ref( $self->{$mainkey}->{$subkey} ),"\n" if $debug2; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 745 | 0 | ▶ | if (ref($self->{$mainkey}->{$subkey}) eq "HASH") { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 746 | 0 | ▶ | print "Got here identified sub hash!\n" if $debug2; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 747 | 0 | foreach $subsubkey ( sort keys %{ $self->{$mainkey}->{$subkey} } ) { | |||||||||||||||||||||||||||
| 748 | 0 | print " SubSubKey: $subsubkey Value: $self->{$mainkey}->{$subkey}->{$subsubkey}\n"; | |||||||||||||||||||||||||||
| 749 | 0 | ▶ | if (ref($self->{$mainkey}->{$subkey}->{$subsubkey}) eq "HASH") { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 750 | 0 | ▶ | print "Got here identified sub sub hash!\n" if $debug2; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 751 | 0 | foreach $subsubsubkey ( sort keys %{ $self->{$mainkey}->{$subkey}->{$subsubkey} } ) { | |||||||||||||||||||||||||||
| 752 | 0 | print " SubSubSubKey: $subsubsubkey Value: $self->{$mainkey}->{$subkey}->{$subsubkey}->{$subsubsubkey}\n"; | |||||||||||||||||||||||||||
| 753 | 0 | ▶ | if (ref($self->{$mainkey}->{$subkey}->{$subsubkey}->{$subsubsubkey}) eq "HASH") { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 754 | 0 | ▶ | print "Got here identified sub sub sub hash!\n" if $debug2; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 755 | 0 | foreach $subsubsubsubkey ( sort keys %{ $self->{$mainkey}->{$subkey}->{$subsubkey}->{$subsubsubkey} } ) { | |||||||||||||||||||||||||||
| 756 | 0 | print " SubSubSubSubKey: $subsubsubsubkey Value: $self->{$mainkey}->{$subkey}->{$subsubkey}->{$subsubsubkey}->{$subsubsubsubkey}\n"; | |||||||||||||||||||||||||||
| 757 | 0 | ▶ | if (ref($self->{$mainkey}->{$subkey}->{$subsubkey}->{$subsubsubkey}->{$subsubsubsubkey}) eq "HASH") { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 758 | 0 | ▶ | print "Got here identified sub sub sub sub hash!\n" if $debug2; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 759 | 0 | foreach $subsubsubsubsubkey ( sort keys %{ $self->{$mainkey}->{$subkey}->{$subsubkey}->{$subsubsubkey}->{$subsubsubsubkey} } ) { | |||||||||||||||||||||||||||
| 760 | 0 | print " SubSubSubSubSubKey: $subsubsubsubsubkey Value: $self->{$mainkey}->{$subkey}->{$subsubkey}->{$subsubsubkey}->{$subsubsubsubkey}->{$subsubsubsubsubkey}\n"; | |||||||||||||||||||||||||||
| 761 | |||||||||||||||||||||||||||||
| 762 | |||||||||||||||||||||||||||||
| 763 | } | ||||||||||||||||||||||||||||
| 764 | } | ||||||||||||||||||||||||||||
| 765 | } | ||||||||||||||||||||||||||||
| 766 | } | ||||||||||||||||||||||||||||
| 767 | } | ||||||||||||||||||||||||||||
| 768 | } | ||||||||||||||||||||||||||||
| 769 | } | ||||||||||||||||||||||||||||
| 770 | } | ||||||||||||||||||||||||||||
| 771 | } | ||||||||||||||||||||||||||||
| 772 | } | ||||||||||||||||||||||||||||
| 773 | } | ||||||||||||||||||||||||||||
| 774 | |||||||||||||||||||||||||||||
| 775 | |||||||||||||||||||||||||||||
| 776 | 0 | ▶ | sub get_all_lvols_on_disk { | ||||||||||||||||||||||||||
|
Subroutine
get_all_lvols_on_disk: not called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 777 | } | ||||||||||||||||||||||||||||
| 778 | |||||||||||||||||||||||||||||
| 779 | 0 | ▶ | sub get_disk_lvol_data { | ||||||||||||||||||||||||||
|
Subroutine
get_disk_lvol_data: not called CC=22 SCAR=62.3
Pod
undocumented
| |||||||||||||||||||||||||||||
| 780 | # disk device /dev/dsk/c4t3d0 passed or equivilent | ||||||||||||||||||||||||||||
| 781 | # returns pointer to hash of hashes | ||||||||||||||||||||||||||||
| 782 | # hash key: /dev/dsk/c#t#d# is a pointer to another hash | ||||||||||||||||||||||||||||
| 783 | # key:lvol is a pointer to yet another hash | ||||||||||||||||||||||||||||
| 784 | # key: le_on_pv value: "###" | ||||||||||||||||||||||||||||
| 785 | # key: pe_on_pv value: "###" | ||||||||||||||||||||||||||||
| 786 | # | ||||||||||||||||||||||||||||
| 787 | 0 | my ($self, @subargs) = @_; | |||||||||||||||||||||||||||
| 788 | |||||||||||||||||||||||||||||
| 789 | 0 | my %arglist = ( | |||||||||||||||||||||||||||
| 790 | device_name => "" , | ||||||||||||||||||||||||||||
| 791 | @subargs, | ||||||||||||||||||||||||||||
| 792 | ); | ||||||||||||||||||||||||||||
| 793 | 0 | my $dev_file = $arglist{device_name}; | |||||||||||||||||||||||||||
| 794 | 0 | my $debug =0; | |||||||||||||||||||||||||||
| 795 | 0 | my $debug2=0; | |||||||||||||||||||||||||||
| 796 | 0 | ▶ | print "I am self: $self\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 797 | 0 | my $mainkey; | |||||||||||||||||||||||||||
| 798 | my $vg_phys_vols; | ||||||||||||||||||||||||||||
| 799 | 0 | my $vg_vol; | |||||||||||||||||||||||||||
| 800 | 0 | my %lv_vols; | |||||||||||||||||||||||||||
| 801 | 0 | my $lv_vols=\%lv_vols; | |||||||||||||||||||||||||||
| 802 | 0 | my $lv_in_vg; | |||||||||||||||||||||||||||
| 803 | my $pv_in_lv; | ||||||||||||||||||||||||||||
| 804 | 0 | my $pv_in_vg; | |||||||||||||||||||||||||||
| 805 | 0 | my $logical_vol; #used in traversal at bottom for debugging | |||||||||||||||||||||||||||
| 806 | 0 | foreach $mainkey ( sort keys %{ $self } ) { | |||||||||||||||||||||||||||
| 807 | 0 | ▶ | print "Main Key: $mainkey\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 808 | 0 | foreach $vg_phys_vols ( sort keys %{ $self->{$mainkey}->{Physical_Vols} } ) { | |||||||||||||||||||||||||||
| 809 | 0 | ▶ | print "Checking: $vg_phys_vols against $dev_file\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 810 | #First look for it on the vgdisplay output part. | ||||||||||||||||||||||||||||
| 811 | 0 | ▶ | if ( $vg_phys_vols eq $dev_file ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 812 | #if found there, then save it and continue to dig for per lv info | ||||||||||||||||||||||||||||
| 813 | 0 | ▶ | print "Got one $vg_phys_vols equals $dev_file\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 814 | 0 | ▶ | print "Checking further now that I've made a match\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 815 | 0 | ▶ | print "Found device $dev_file in $mainkey!\n" if $debug2; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 816 | 0 | $vg_vol=$mainkey; | |||||||||||||||||||||||||||
| 817 | 0 | ▶ | print "Volume Group is $vg_vol now\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 818 | 0 | foreach $lv_in_vg ( sort keys %{ $self->{$mainkey}->{lvols} } ) { | |||||||||||||||||||||||||||
| 819 | 0 | ▶ | print "Checking lvol $lv_in_vg for phys_dev\n"if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 820 | 0 | foreach $pv_in_lv ( sort keys %{ $self->{$mainkey}->{lvols}->{$lv_in_vg}->{PV_Data} } ) { | |||||||||||||||||||||||||||
| 821 | 0 | ▶ | print "Checking $pv_in_vg to match $dev_file\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 822 | 0 | ▶ | if ( $pv_in_lv eq $dev_file ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 823 | 0 | ▶ | print "Matched lvol specific physical vol $lv_in_vg: $vg_phys_vols equals $dev_file\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 824 | $lv_vols->{$lv_in_vg}= { | ||||||||||||||||||||||||||||
| 825 | vg_on_pv => $vg_vol, | ||||||||||||||||||||||||||||
| 826 | le_on_pv => $self->{$mainkey}->{lvols}->{$lv_in_vg}->{PV_Data}->{$dev_file}->{le_on_pv}, | ||||||||||||||||||||||||||||
| 827 | pe_on_pv => $self->{$mainkey}->{lvols}->{$lv_in_vg}->{PV_Data}->{$dev_file}->{pe_on_pv}, | ||||||||||||||||||||||||||||
| 828 | 0 | }; | |||||||||||||||||||||||||||
| 829 | } | ||||||||||||||||||||||||||||
| 830 | |||||||||||||||||||||||||||||
| 831 | } | ||||||||||||||||||||||||||||
| 832 | } | ||||||||||||||||||||||||||||
| 833 | |||||||||||||||||||||||||||||
| 834 | |||||||||||||||||||||||||||||
| 835 | |||||||||||||||||||||||||||||
| 836 | |||||||||||||||||||||||||||||
| 837 | |||||||||||||||||||||||||||||
| 838 | |||||||||||||||||||||||||||||
| 839 | |||||||||||||||||||||||||||||
| 840 | |||||||||||||||||||||||||||||
| 841 | } | ||||||||||||||||||||||||||||
| 842 | } | ||||||||||||||||||||||||||||
| 843 | |||||||||||||||||||||||||||||
| 844 | } | ||||||||||||||||||||||||||||
| 845 | 0 | ▶ | print "$dev_file:\n" if $debug2; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 846 | 0 | foreach $logical_vol ( sort keys %{ $lv_vols } ) { | |||||||||||||||||||||||||||
| 847 | 0 | ▶ | print " logical_vol: $logical_vol\n" if $debug2; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 848 | 0 | ▶ | print " le_on_pv: $lv_vols{$logical_vol}->{le_on_pv}\n" if $debug2; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 849 | 0 | ▶ | print " pe_on_pv: $lv_vols{$logical_vol}->{pe_on_pv}\n" if $debug2; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 850 | } | ||||||||||||||||||||||||||||
| 851 | 0 | return \%lv_vols; | |||||||||||||||||||||||||||
| 852 | |||||||||||||||||||||||||||||
| 853 | } | ||||||||||||||||||||||||||||
| 854 | |||||||||||||||||||||||||||||
| 855 | 1 | ▶ | sub get_all_volumegroups { | ||||||||||||||||||||||||||
|
Subroutine
get_all_volumegroups: called CC=2 SCAR=6.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 856 | # Returns an array of all the Volume groups (primary keys) | ||||||||||||||||||||||||||||
| 857 | # No args needed | ||||||||||||||||||||||||||||
| 858 | 1 | my ($self, @subargs) = @_; | |||||||||||||||||||||||||||
| 859 | |||||||||||||||||||||||||||||
| 860 | 1 | my %arglist = ( | |||||||||||||||||||||||||||
| 861 | @subargs, | ||||||||||||||||||||||||||||
| 862 | ); | ||||||||||||||||||||||||||||
| 863 | 1 | my $debug =0; | |||||||||||||||||||||||||||
| 864 | 1 | my $debug2=0; | |||||||||||||||||||||||||||
| 865 | 1 | my $mainkey; | |||||||||||||||||||||||||||
| 866 | my @volumegroups; | ||||||||||||||||||||||||||||
| 867 | 1 | foreach $mainkey (sort keys %{ $self } ) { | |||||||||||||||||||||||||||
| 868 | 1 | push @volumegroups, $mainkey; | |||||||||||||||||||||||||||
| 869 | } | ||||||||||||||||||||||||||||
| 870 | 1 | return \@volumegroups; | |||||||||||||||||||||||||||
| 871 | } | ||||||||||||||||||||||||||||
| 872 | 0 | ▶ | sub get_all_pvlinks { | ||||||||||||||||||||||||||
|
Subroutine
get_all_pvlinks: not called CC=11 SCAR=48.8
Pod
undocumented
| |||||||||||||||||||||||||||||
| 873 | # | ||||||||||||||||||||||||||||
| 874 | # | ||||||||||||||||||||||||||||
| 875 | # | ||||||||||||||||||||||||||||
| 876 | # Returns a hash of array/s with pimary links as keys and second | ||||||||||||||||||||||||||||
| 877 | # and thrid etc links as an ordered array. | ||||||||||||||||||||||||||||
| 878 | # ie. /dev/dsk/c1t2d0 :Key | ||||||||||||||||||||||||||||
| 879 | # /dev/dsk/c2t2d0 1st alternate :$array[0] | ||||||||||||||||||||||||||||
| 880 | # /dev/dsk/c3t2d0 2nd alternate :$array[1] | ||||||||||||||||||||||||||||
| 881 | # /dev/dsk/c4t2d0 3rd alternate :$array[2] | ||||||||||||||||||||||||||||
| 882 | # No args needed | ||||||||||||||||||||||||||||
| 883 | 0 | my ($self, @subargs) = @_; | |||||||||||||||||||||||||||
| 884 | |||||||||||||||||||||||||||||
| 885 | 0 | my %arglist = ( | |||||||||||||||||||||||||||
| 886 | @subargs, | ||||||||||||||||||||||||||||
| 887 | ); | ||||||||||||||||||||||||||||
| 888 | 0 | my $debug =0; | |||||||||||||||||||||||||||
| 889 | 0 | my $debug2=0; | |||||||||||||||||||||||||||
| 890 | 0 | my $debug5=0; | |||||||||||||||||||||||||||
| 891 | 0 | my $mainkey; | |||||||||||||||||||||||||||
| 892 | my $vg; | ||||||||||||||||||||||||||||
| 893 | 0 | my $pvinvg; | |||||||||||||||||||||||||||
| 894 | 0 | my @volumegroups; | |||||||||||||||||||||||||||
| 895 | 0 | my @lvol_attra; | |||||||||||||||||||||||||||
| 896 | 0 | my %returnhash=""; | |||||||||||||||||||||||||||
| 897 | 0 | foreach $mainkey (sort keys %{ $self } ) { | |||||||||||||||||||||||||||
| 898 | 0 | ▶ | print "Volume Groups in self: $mainkey\n" if $debug5; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 899 | 0 | push @volumegroups, $mainkey; | |||||||||||||||||||||||||||
| 900 | } | ||||||||||||||||||||||||||||
| 901 | 0 | foreach $vg ( @volumegroups ) { | |||||||||||||||||||||||||||
| 902 | 0 | ▶ | print "VG: $vg\n" if $debug5; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 903 | 0 | PVLOOP: foreach $pvinvg (sort keys %{ $self->{$vg}->{Physical_Vols} } ) { | |||||||||||||||||||||||||||
| 904 | # | ||||||||||||||||||||||||||||
| 905 | # Check each physical volume, check for pvlinks and add them as appropriate | ||||||||||||||||||||||||||||
| 906 | # | ||||||||||||||||||||||||||||
| 907 | 0 | ▶ | print "PVinVG: $pvinvg\n" if $debug5; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 908 | 0 | ▶ | if ( $self->{$vg}->{Physical_Vols}->{$pvinvg}->{Alternate_Links}->[0] eq "None" ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 909 | 0 | ▶ | print "It was NOT defined, continuing\n" if $debug5; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 910 | 0 | @lvol_attra = ""; | |||||||||||||||||||||||||||
| 911 | 0 | next PVLOOP; | |||||||||||||||||||||||||||
| 912 | } | ||||||||||||||||||||||||||||
| 913 | else { | ||||||||||||||||||||||||||||
| 914 | 0 | ▶ | print "It was defined, continuing\n" if $debug5; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 915 | 0 | @lvol_attra = @{ $self->{$vg}->{Physical_Vols}->{$pvinvg}->{Alternate_Links} }; | |||||||||||||||||||||||||||
| 916 | 0 | ▶ | print "lvol_attra: @lvol_attra\n<BR>" if $debug5; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 917 | 0 | $returnhash{$pvinvg} = [ @lvol_attra ]; | |||||||||||||||||||||||||||
| 918 | } | ||||||||||||||||||||||||||||
| 919 | |||||||||||||||||||||||||||||
| 920 | } | ||||||||||||||||||||||||||||
| 921 | } | ||||||||||||||||||||||||||||
| 922 | 0 | return \%returnhash; | |||||||||||||||||||||||||||
| 923 | } | ||||||||||||||||||||||||||||
| 924 | 1 | ▶ | sub get_vg_physicalvols { | ||||||||||||||||||||||||||
|
Subroutine
get_vg_physicalvols: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 925 | #return an array | ||||||||||||||||||||||||||||
| 926 | #pass vg | ||||||||||||||||||||||||||||
| 927 | |||||||||||||||||||||||||||||
| 928 | 1 | my ($self, @subargs) = @_; | |||||||||||||||||||||||||||
| 929 | |||||||||||||||||||||||||||||
| 930 | 1 | my %arglist = ( | |||||||||||||||||||||||||||
| 931 | volume_group => "" , | ||||||||||||||||||||||||||||
| 932 | @subargs, | ||||||||||||||||||||||||||||
| 933 | ); | ||||||||||||||||||||||||||||
| 934 | 1 | my $vol_group = $arglist{volume_group}; | |||||||||||||||||||||||||||
| 935 | 1 | my $debug =0; | |||||||||||||||||||||||||||
| 936 | 1 | my $debug2=0; | |||||||||||||||||||||||||||
| 937 | 1 | my $mainkey; | |||||||||||||||||||||||||||
| 938 | my @physicalvols; | ||||||||||||||||||||||||||||
| 939 | 1 | foreach $mainkey (sort keys %{ $self->{$vol_group}->{Physical_Vols} } ) { | |||||||||||||||||||||||||||
| 940 | 1 | push @physicalvols, $mainkey; | |||||||||||||||||||||||||||
| 941 | } | ||||||||||||||||||||||||||||
| 942 | 1 | return \@physicalvols; | |||||||||||||||||||||||||||
| 943 | |||||||||||||||||||||||||||||
| 944 | } | ||||||||||||||||||||||||||||
| 945 | 0 | ▶ | sub get_vg_physicalvol_attr { | ||||||||||||||||||||||||||
|
Subroutine
get_vg_physicalvol_attr: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||||||||||||
| 946 | #return an scalar | ||||||||||||||||||||||||||||
| 947 | #pass vg,phyvol,attr | ||||||||||||||||||||||||||||
| 948 | |||||||||||||||||||||||||||||
| 949 | 0 | my ($self, @subargs) = @_; | |||||||||||||||||||||||||||
| 950 | 0 | my $debug=0; | |||||||||||||||||||||||||||
| 951 | 0 | my $debug2=0; | |||||||||||||||||||||||||||
| 952 | 0 | ▶ | print "I am: $self\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 953 | 0 | ▶ | print "Args: @subargs\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 954 | |||||||||||||||||||||||||||||
| 955 | 0 | my %arglist = ( | |||||||||||||||||||||||||||
| 956 | volume_group => "" , | ||||||||||||||||||||||||||||
| 957 | device_name => "" , | ||||||||||||||||||||||||||||
| 958 | attribute => "" , | ||||||||||||||||||||||||||||
| 959 | @subargs, | ||||||||||||||||||||||||||||
| 960 | ); | ||||||||||||||||||||||||||||
| 961 | 0 | my $vol_group = $arglist{volume_group}; | |||||||||||||||||||||||||||
| 962 | 0 | my $dev_file = $arglist{device_name}; | |||||||||||||||||||||||||||
| 963 | 0 | ▶ | print "Vol_group is : $vol_group\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 964 | 0 | my $attr = $arglist{attribute}; | |||||||||||||||||||||||||||
| 965 | 0 | my $mainkey; | |||||||||||||||||||||||||||
| 966 | my $physical_attr; | ||||||||||||||||||||||||||||
| 967 | 0 | ▶ | print "Vol_group is : $vol_group\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 968 | 0 | $physical_attr = $self->{$vol_group}->{Physical_Vols}->{$dev_file}->{$attr}; | |||||||||||||||||||||||||||
| 969 | 0 | return $physical_attr; | |||||||||||||||||||||||||||
| 970 | |||||||||||||||||||||||||||||
| 971 | } | ||||||||||||||||||||||||||||
| 972 | 1 | ▶ | sub get_vg_lvols { | ||||||||||||||||||||||||||
|
Subroutine
get_vg_lvols: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 973 | #return an array | ||||||||||||||||||||||||||||
| 974 | #pass vg | ||||||||||||||||||||||||||||
| 975 | |||||||||||||||||||||||||||||
| 976 | 1 | my ($self, @subargs) = @_; | |||||||||||||||||||||||||||
| 977 | |||||||||||||||||||||||||||||
| 978 | 1 | my %arglist = ( | |||||||||||||||||||||||||||
| 979 | volume_group => "" , | ||||||||||||||||||||||||||||
| 980 | @subargs, | ||||||||||||||||||||||||||||
| 981 | ); | ||||||||||||||||||||||||||||
| 982 | 1 | my $vol_group = $arglist{volume_group}; | |||||||||||||||||||||||||||
| 983 | 1 | my $debug =0; | |||||||||||||||||||||||||||
| 984 | 1 | my $debug2=0; | |||||||||||||||||||||||||||
| 985 | 1 | my $mainkey; | |||||||||||||||||||||||||||
| 986 | my @logicalvols; | ||||||||||||||||||||||||||||
| 987 | 1 | foreach $mainkey ( sort keys %{ $self->{$vol_group}->{lvols} } ) { | |||||||||||||||||||||||||||
| 988 | 9 | push @logicalvols, $mainkey; | |||||||||||||||||||||||||||
| 989 | } | ||||||||||||||||||||||||||||
| 990 | 1 | return \@logicalvols; | |||||||||||||||||||||||||||
| 991 | |||||||||||||||||||||||||||||
| 992 | } | ||||||||||||||||||||||||||||
| 993 | 5 | ▶ | sub get_vg_lvol_attr_vgdisplay { | ||||||||||||||||||||||||||
|
Subroutine
get_vg_lvol_attr_vgdisplay: called CC=5 SCAR=16.4
Pod
documented
| |||||||||||||||||||||||||||||
| 994 | #return an scalar | ||||||||||||||||||||||||||||
| 995 | #pass vg,lvol,attr | ||||||||||||||||||||||||||||
| 996 | |||||||||||||||||||||||||||||
| 997 | 5 | my ($self, @subargs) = @_; | |||||||||||||||||||||||||||
| 998 | |||||||||||||||||||||||||||||
| 999 | 5 | my %arglist = ( | |||||||||||||||||||||||||||
| 1000 | volume_group => "" , | ||||||||||||||||||||||||||||
| 1001 | logical_vol => "" , | ||||||||||||||||||||||||||||
| 1002 | attribute => "" , | ||||||||||||||||||||||||||||
| 1003 | @subargs, | ||||||||||||||||||||||||||||
| 1004 | ); | ||||||||||||||||||||||||||||
| 1005 | 5 | my $vol_group = $arglist{volume_group}; | |||||||||||||||||||||||||||
| 1006 | 5 | my $logical_vol = $arglist{logical_vol}; | |||||||||||||||||||||||||||
| 1007 | 5 | my $attr = $arglist{attribute}; | |||||||||||||||||||||||||||
| 1008 | 5 | my $debug =0; | |||||||||||||||||||||||||||
| 1009 | 5 | my $debug2=0; | |||||||||||||||||||||||||||
| 1010 | 5 | ▶ | print "vol_group: $vol_group\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 1011 | 5 | ▶ | print "logical_vol: $logical_vol\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 1012 | 5 | ▶ | print "attribute: $attr\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 1013 | 5 | my $lvol_attr; | |||||||||||||||||||||||||||
| 1014 | my $mainkey; | ||||||||||||||||||||||||||||
| 1015 | 5 | $lvol_attr = $self->{$vol_group}->{lvols}->{$logical_vol}->{$attr}; | |||||||||||||||||||||||||||
| 1016 | 5 | ▶ | print "attribute is: $lvol_attr\n" if $debug; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 1017 | 5 | return $lvol_attr; | |||||||||||||||||||||||||||
| 1018 | } | ||||||||||||||||||||||||||||
| 1019 | 0 | ▶ | sub get_vg_alternate_links { | ||||||||||||||||||||||||||
|
Subroutine
get_vg_alternate_links: not called CC=7 SCAR=40.3
Pod
documented
| |||||||||||||||||||||||||||||
| 1020 | #return an array | ||||||||||||||||||||||||||||
| 1021 | #pass vg,pv | ||||||||||||||||||||||||||||
| 1022 | |||||||||||||||||||||||||||||
| 1023 | 0 | my ($self, @subargs) = @_; | |||||||||||||||||||||||||||
| 1024 | |||||||||||||||||||||||||||||
| 1025 | 0 | my %arglist = ( | |||||||||||||||||||||||||||
| 1026 | volume_group => "" , | ||||||||||||||||||||||||||||
| 1027 | device_name => "" , | ||||||||||||||||||||||||||||
| 1028 | attribute => "Alternate_Links" , | ||||||||||||||||||||||||||||
| 1029 | @subargs, | ||||||||||||||||||||||||||||
| 1030 | ); | ||||||||||||||||||||||||||||
| 1031 | 0 | my $vol_group = $arglist{volume_group}; | |||||||||||||||||||||||||||
| 1032 | 0 | my $device_name = $arglist{device_name}; | |||||||||||||||||||||||||||
| 1033 | 0 | my $attr = $arglist{attribute}; | |||||||||||||||||||||||||||
| 1034 | 0 | my $debug =0; | |||||||||||||||||||||||||||
| 1035 | 0 | my $debug2=0; | |||||||||||||||||||||||||||
| 1036 | 0 | my $debug5=0; | |||||||||||||||||||||||||||
| 1037 | 0 | ▶ | print "vol_group: $vol_group\n" if $debug5; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 1038 | 0 | ▶ | print "attribute: $attr\n" if $debug5; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 1039 | 0 | ▶ | print "device_name: $device_name\n" if $debug5; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 1040 | 0 | my @lvol_attr; | |||||||||||||||||||||||||||
| 1041 | 0 | ▶ | if ( defined( $self->{$vol_group}->{Physical_Vols}->{$device_name}->{$attr} ) ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 1042 | 0 | ▶ | print "It was defined, continuing\n" if $debug5; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 1043 | 0 | @lvol_attr = @{ $self->{$vol_group}->{Physical_Vols}->{$device_name}->{$attr} }; | |||||||||||||||||||||||||||
| 1044 | } | ||||||||||||||||||||||||||||
| 1045 | else { | ||||||||||||||||||||||||||||
| 1046 | 0 | ▶ | print "It was NOT defined, continuing\n" if $debug5; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 1047 | 0 | @lvol_attr = ( "NotDefined" ); | |||||||||||||||||||||||||||
| 1048 | } | ||||||||||||||||||||||||||||
| 1049 | 0 | return \@lvol_attr; | |||||||||||||||||||||||||||
| 1050 | } | ||||||||||||||||||||||||||||
| 1051 | |||||||||||||||||||||||||||||
| 1052 | 5 | ▶ | sub get_vg_lvol_attr_lvdisplay { | ||||||||||||||||||||||||||
|
Subroutine
get_vg_lvol_attr_lvdisplay: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||||||||||
| 1053 | #return an scalar | ||||||||||||||||||||||||||||
| 1054 | #pass vg,lvol,attr | ||||||||||||||||||||||||||||
| 1055 | |||||||||||||||||||||||||||||
| 1056 | 5 | my ($self, @subargs) = @_; | |||||||||||||||||||||||||||
| 1057 | |||||||||||||||||||||||||||||
| 1058 | 5 | my %arglist = ( | |||||||||||||||||||||||||||
| 1059 | volume_group => "" , | ||||||||||||||||||||||||||||
| 1060 | logical_vol => "" , | ||||||||||||||||||||||||||||
| 1061 | attribute => "" , | ||||||||||||||||||||||||||||
| 1062 | @subargs, | ||||||||||||||||||||||||||||
| 1063 | ); | ||||||||||||||||||||||||||||
| 1064 | 5 | my $vol_group = $arglist{volume_group}; | |||||||||||||||||||||||||||
| 1065 | 5 | my $logical_vol = $arglist{logical_vol}; | |||||||||||||||||||||||||||
| 1066 | 5 | my $attr = $arglist{attribute}; | |||||||||||||||||||||||||||
| 1067 | 5 | my $debug =0; | |||||||||||||||||||||||||||
| 1068 | 5 | my $debug2=0; | |||||||||||||||||||||||||||
| 1069 | 5 | my $mainkey; | |||||||||||||||||||||||||||
| 1070 | my $lvol_attr; | ||||||||||||||||||||||||||||
| 1071 | 5 | $lvol_attr = $self->{$vol_group}->{lvols}->{$logical_vol}->{lvdata}->{$attr}; | |||||||||||||||||||||||||||
| 1072 | 5 | return $lvol_attr; | |||||||||||||||||||||||||||
| 1073 | } | ||||||||||||||||||||||||||||
| 1074 | |||||||||||||||||||||||||||||
| 1075 | 0 | ▶ | sub get_vg_lvol_stripeorder { | ||||||||||||||||||||||||||
|
Subroutine
get_vg_lvol_stripeorder: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||
| 1076 | #return an array | ||||||||||||||||||||||||||||
| 1077 | #pass vg,lvol,phyvol | ||||||||||||||||||||||||||||
| 1078 | |||||||||||||||||||||||||||||
| 1079 | 0 | my ($self, @subargs) = @_; | |||||||||||||||||||||||||||
| 1080 | |||||||||||||||||||||||||||||
| 1081 | 0 | my %arglist = ( | |||||||||||||||||||||||||||
| 1082 | volume_group => "" , | ||||||||||||||||||||||||||||
| 1083 | logical_vol => "" , | ||||||||||||||||||||||||||||
| 1084 | @subargs, | ||||||||||||||||||||||||||||
| 1085 | ); | ||||||||||||||||||||||||||||
| 1086 | 0 | my $vol_group = $arglist{volume_group}; | |||||||||||||||||||||||||||
| 1087 | 0 | my $logical_vol = $arglist{logical_vol}; | |||||||||||||||||||||||||||
| 1088 | 0 | my $debug =0; | |||||||||||||||||||||||||||
| 1089 | 0 | my $debug2=0; | |||||||||||||||||||||||||||
| 1090 | 0 | my $mainkey; | |||||||||||||||||||||||||||
| 1091 | my @lvol_stripeorder; | ||||||||||||||||||||||||||||
| 1092 | 0 | foreach $mainkey ( sort keys %{ $self->{$vol_group}->{lvols}->{$logical_vol}->{'Ordered_PV'} } ) { | |||||||||||||||||||||||||||
| 1093 | 0 | push @lvol_stripeorder, $self->{$vol_group}->{lvols}->{$logical_vol}->{'Ordered_PV'}->{ $mainkey }; | |||||||||||||||||||||||||||
| 1094 | } | ||||||||||||||||||||||||||||
| 1095 | 0 | return \@lvol_stripeorder; | |||||||||||||||||||||||||||
| 1096 | } | ||||||||||||||||||||||||||||
| 1097 | |||||||||||||||||||||||||||||
| 1098 | 0 | ▶ | sub get_vg_lvol_physicalvols { | ||||||||||||||||||||||||||
|
Subroutine
get_vg_lvol_physicalvols: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||||||||||
| 1099 | #return an array | ||||||||||||||||||||||||||||
| 1100 | #pass vg,lvol,phyvol | ||||||||||||||||||||||||||||
| 1101 | |||||||||||||||||||||||||||||
| 1102 | 0 | my ($self, @subargs) = @_; | |||||||||||||||||||||||||||
| 1103 | |||||||||||||||||||||||||||||
| 1104 | 0 | my %arglist = ( | |||||||||||||||||||||||||||
| 1105 | volume_group => "" , | ||||||||||||||||||||||||||||
| 1106 | logical_vol => "" , | ||||||||||||||||||||||||||||
| 1107 | device_name => "" , | ||||||||||||||||||||||||||||
| 1108 | @subargs, | ||||||||||||||||||||||||||||
| 1109 | ); | ||||||||||||||||||||||||||||
| 1110 | 0 | my $vol_group = $arglist{volume_group}; | |||||||||||||||||||||||||||
| 1111 | 0 | my $logical_vol = $arglist{logical_vol}; | |||||||||||||||||||||||||||
| 1112 | 0 | my $device_name = $arglist{device_name}; | |||||||||||||||||||||||||||
| 1113 | 0 | my $debug =0; | |||||||||||||||||||||||||||
| 1114 | 0 | my $debug2=0; | |||||||||||||||||||||||||||
| 1115 | 0 | my $mainkey; | |||||||||||||||||||||||||||
| 1116 | my @lvol_physvols; | ||||||||||||||||||||||||||||
| 1117 | 0 | foreach $mainkey ( sort keys %{ $self->{$vol_group}->{lvols}->{$logical_vol}->{'PV_Data'} } ) { | |||||||||||||||||||||||||||
| 1118 | 0 | push @lvol_physvols, $mainkey; | |||||||||||||||||||||||||||
| 1119 | } | ||||||||||||||||||||||||||||
| 1120 | 0 | return \@lvol_physvols; | |||||||||||||||||||||||||||
| 1121 | } | ||||||||||||||||||||||||||||
| 1122 | 0 | ▶ | sub get_vg_lvol_physicalvol_attr{ | ||||||||||||||||||||||||||
|
Subroutine
get_vg_lvol_physicalvol_attr: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 1123 | #return an scalar | ||||||||||||||||||||||||||||
| 1124 | #pass vg,lvol,phyvol,attr | ||||||||||||||||||||||||||||
| 1125 | |||||||||||||||||||||||||||||
| 1126 | 0 | my ($self, @subargs) = @_; | |||||||||||||||||||||||||||
| 1127 | |||||||||||||||||||||||||||||
| 1128 | 0 | my %arglist = ( | |||||||||||||||||||||||||||
| 1129 | volume_group => "" , | ||||||||||||||||||||||||||||
| 1130 | logical_vol => "" , | ||||||||||||||||||||||||||||
| 1131 | device_name => "" , | ||||||||||||||||||||||||||||
| 1132 | attribute => "" , | ||||||||||||||||||||||||||||
| 1133 | @subargs, | ||||||||||||||||||||||||||||
| 1134 | ); | ||||||||||||||||||||||||||||
| 1135 | 0 | my $vol_group = $arglist{volume_group}; | |||||||||||||||||||||||||||
| 1136 | 0 | my $logical_vol = $arglist{logical_vol}; | |||||||||||||||||||||||||||
| 1137 | 0 | my $device_name = $arglist{device_name}; | |||||||||||||||||||||||||||
| 1138 | 0 | my $attr = $arglist{attribute}; | |||||||||||||||||||||||||||
| 1139 | 0 | my $debug =0; | |||||||||||||||||||||||||||
| 1140 | 0 | my $debug2=0; | |||||||||||||||||||||||||||
| 1141 | 0 | my $mainkey; | |||||||||||||||||||||||||||
| 1142 | my $lvol_physvol_attr; | ||||||||||||||||||||||||||||
| 1143 | 0 | $lvol_physvol_attr = $self->{$vol_group}->{lvols}->{$logical_vol}->{PV_Data}->{$device_name}->{$attr}; | |||||||||||||||||||||||||||
| 1144 | 0 | return $lvol_physvol_attr; | |||||||||||||||||||||||||||
| 1145 | } | ||||||||||||||||||||||||||||
| 1146 | |||||||||||||||||||||||||||||
| 1147 | ### End | ||||||||||||||||||||||||||||
| 1148 | 1 | 1; | |||||||||||||||||||||||||||
| 1149 | __END__ | ||||||||||||||||||||||||||||