#!/bin/perl
@luns = `/usr/sbin/luxadm probe | grep Logical | sed -e 's/.*\://g'|grep rdsk`;
foreach $lun (@luns) {
chomp($lun);
$lun2 = $lun;
$lun2 =~ s/\/dev\/rdsk\///g;
print "Disk:$lun2\t";
@luxadm = `/usr/sbin/luxadm display $lun`;
$pathcount = 0;
foreach $luxadm (@luxadm) {
chomp($luxadm);
if ($luxadm =~ /State/) {
$luxadm =~ s/State//g;
$luxadm =~ s/^\s+//;
print "Path$pathcount:$luxadm\t";
$pathcount++;
}
}
print "\n";
}
The output from the script will look something like the output below:
#perl pathfinder.pl
Disk:c6t60060E80054337000000433700000526d0s2 Path0:ONLINE Path1:ONLINE Path2:ONLINE Path3:ONLINE
Disk:c6t60060E80054337000000433700000527d0s2 Path0:ONLINE Path1:ONLINE Path2:ONLINE Path3:ONLINE
Disk:c6t60060E80054337000000433700000301d0s2 Path0:ONLINE Path1:ONLINE Path2:ONLINE Path3:ONLINE
Disk:c6t60060E80054337000000433700000300d0s2 Path0:ONLINE Path1:ONLINE Path2:ONLINE Path3:ONLINE
Disk:c6t60060E80054337000000433700000278d0s2 Path0:ONLINE Path1:ONLINE Path2:ONLINE Path3:ONLINE
Disk:c6t60060E80054337000000433700000277d0s2 Path0:ONLINE Path1:ONLINE Path2:ONLINE Path3:ONLINE
Disk:c6t60060E80054337000000433700000275d0s2 Path0:ONLINE Path1:ONLINE Path2:ONLINE Path3:ONLINE
#