perl script scu and hwmgr combined outputs

From: Binkley Robert - rbinkl (Robert.Binkley@acxiom.com)
Date: Tue May 27 2003 - 11:17:46 EDT


#!/usr/bin/perl

foreach (`scu show edt`)
{
  ($bus,$tar,$lun,$prod_id)=(split())[0,1,2,6];

  if ( $bus =~ /\d+/ && $tar =~ /\d+/ && $lun =~ /\d+/ )
  {
    $location="[$bus/$tar/$lun]";
    $scuhash{$location}=$prod_id;
  }
}

foreach (`hwmgr -show scsi`)
{
  ($dsk,$location)=(split())[7,8];

  if ( $dsk =~ /dsk/ )
  {
    $size=(split(/\s+/,`disklabel -r $dsk|grep " c:"`))[2];
    $size /= 2048;

    $prod_id=$scuhash{$location};

    $scuhash{$location}="$dsk:$prod_id:$size";
  }
}

print "B/T/L Disk Product ID Size (MB)\n";
print "-------- ------ ---------- ---------\n";

foreach $location (sort keys %scuhash)
{
  ($dsk,$prod_id,$size)=split(/:/,$scuhash{$location});

  if ( $dsk =~ /dsk/ )
  {
    printf("%-9s %-7s %-11s %0.2f\n",$location,$dsk,$prod_id,$size);
  }
}

**********************************************************************
The information contained in this communication is
confidential, is intended only for the use of the recipient
named above, and may be legally privileged.
If the reader of this message is not the intended
recipient, you are hereby notified that any dissemination,
distribution, or copying of this communication is strictly
prohibited.
If you have received this communication in error,
please re-send this communication to the sender and
delete the original message or any copy of it from your
computer system. Thank You.



This archive was generated by hypermail 2.1.7 : Sat Apr 12 2008 - 10:49:20 EDT