tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
* perl script scu and hwmgr combined outputs
@ 2003-05-27 15:17 Binkley Robert - rbinkl
  0 siblings, 0 replies; only message in thread
From: Binkley Robert - rbinkl @ 2003-05-27 15:17 UTC (permalink / raw)


#!/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.



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-05-27 15:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-05-27 15:17 perl script scu and hwmgr combined outputs Binkley Robert - rbinkl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox