Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

LSLVMembers

by bpoag (Monk)
on Jun 29, 2006 at 17:05 UTC ( [id://558385]=sourcecode: print w/replies, xml ) Need Help??
Category: AIX
Author/Contact Info Bowie J. Poag (bpoag@comcast.net)
Description: LSLVMembers is a simple script that produces a plain-English report of what member hdisks belong to what logical volumes on an AIX box.
#!/usr/bin/perl
##
## LSLVMembers written 062306:1606 by BJP
##
## LSLVMembers displays what member hdisks belong to each logical volu
+me.
##


@lvList = split(/\s+/,`lsvg -o | lsvg -i -l | grep -v : | grep -v ^LV|
+ cut -d\" \" -f1`);


print "\nLSLVMembers: Spinning up..\n";

foreach $item (@lvList)
{
  print "LSLVMembers: \"$item\" encompasses ";

  @lvResults=split(/\s+/,`lslv -l $item`);

  $counter=0;
  $moreComing=0;


  $totalSize=@lvResults;

  while ($counter<=@lvResults)
  {

    if (($lvResults[$counter]=~/hdisk/  || $lvResults[$counter]=~/vpat
+h/) && $counter<$totalSize-5)
    {
      print "$lvResults[$counter], ";
      $moreComing++;
    }

    if (($lvResults[$counter]=~/hdisk/ || $lvResults[$counter]=~/vpath
+/) && $counter>($totalSize-5))
    {
      if ($moreComing>0)
      {
        print "and ";
      }

      print "$lvResults[$counter]. ";
    }

    $counter++;
  }

  print "\n";
}

print "LSLVMembers: Spinning down..\n\n";

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: sourcecode [id://558385]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (8)
As of 2024-04-19 08:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found