This is script is for printing the EMC psedo device with corresponding LUN ID and physical device path.
Make sure, powermt command is in your env path.
Download the script Click Here
#!/usr/bin/perl
Download the script Click Here
Download the script Click Here
Make sure, powermt command is in your env path.
Download the script Click Here
#!/usr/bin/perl
#Auther : Latheefp@gmail.com
#Purpose: Printing the Emc Power Devices With LUN ID
my $PSUE;
my $LUN;
my $DISK;
my @array;
my $PHY;
my $OldPSUE;
my $count;
my $LEN;
print "=================================================\n Pseudo name :LUN ID:PhysicalDIsks\n=================================================\n";
open(FILE, "/etc/powermt display dev=all|");
while () {
chomp;
if ( /Pseudo name/ )
{
$_=~s/name=|Pseudo//g;
$PSUE=$_;
$LEN=`echo $PSUE|wc -c`;
if ($LEN < 15)
{
for ($count=$LEN; $count<=15; $count++)
{
$PSUE="$PSUE ";
}
}
}
if ( /Logical device/ ) {
$_=~s/Logical device ID=//g;
$LUN=$_;
}
if ( /pci/ ) {
$_=~s/Logical device ID=//g;
@array = split (/\s+/, $_);
$PHY="$array[2] : $PHY";
}
if (/^$/) {
if ($OldPSUE ne $PSUE)
{
print "$PSUE : $LUN: $PHY \n";
}
$PHY="";
$OldPSUE=$PSUE;
}
}
close(FILE);
Download the script Click Here
This script can pint an output as below.
root@Host1# ./EMCtoLUN.pl
=================================================
Pseudo name :LUN ID:PhysicalDIsks
=================================================
emcpower22a : 0547: c2t5006048452A5C208d414s0 : c1t5006048452A5C207d414s0 :
emcpower21a : 054D: c2t5006048452A5C208d415s0 : c1t5006048452A5C207d415s0 :
emcpower9a : 058C: c2t5006048452A5C208d220s0 : c1t5006048452A5C207d220s0 :
emcpower8a : 0592: c2t5006048452A5C208d221s0 : c1t5006048452A5C207d221s0 :
emcpower7a : 0598: c2t5006048452A5C208d222s0 : c1t5006048452A5C207d222s0 :
emcpower4a : 094D: c2t5006048452A5C208d321s0 : c1t5006048452A5C207d340s0 :
emcpower17a : 095C: c2t5006048452A5C208d295s0 : c1t5006048452A5C207d295s0 :
emcpower16a : 0962: c2t5006048452A5C208d389s0 : c1t5006048452A5C207d389s0 :
emcpower15a : 09EE: c2t5006048452A5C208d390s0 : c1t5006048452A5C207d390s0 :
emcpower20a : 0B78: c2t5006048452A5C208d403s0 : c1t5006048452A5C207d403s0 :
emcpower18a : 0BA0: c2t5006048452A5C208d405s0 : c1t5006048452A5C207d405s0 :
emcpower19a : 0EC7: c2t5006048452A5C208d404s0 : c1t5006048452A5C207d404s0 :
emcpower30a : 0EDF: c2t5006048452A5C208d406s0 : c1t5006048452A5C207d406s0 :
emcpower29a : 0EF7: c2t5006048452A5C208d407s0 : c1t5006048452A5C207d407s0 :
emcpower28a : 0F0F: c2t5006048452A5C208d408s0 : c1t5006048452A5C207d408s0 :
emcpower27a : 0F2B: c2t5006048452A5C208d409s0 : c1t5006048452A5C207d409s0 :
emcpower26a : 0F43: c2t5006048452A5C208d410s0 : c1t5006048452A5C207d410s0 :
emcpower25a : 0F5B: c2t5006048452A5C208d411s0 : c1t5006048452A5C207d411s0 :
emcpower24a : 0F73: c2t5006048452A5C208d412s0 : c1t5006048452A5C207d412s0 :
emcpower23a : 0F8B: c2t5006048452A5C208d413s0 : c1t5006048452A5C207d413s0 :
emcpower14a : 1023: c2t5006048452A5C208d391s0 : c1t5006048452A5C207d391s0 :
emcpower13a : 1029: c2t5006048452A5C208d392s0 : c1t5006048452A5C207d392s0 :
emcpower12a : 102F: c2t5006048452A5C208d393s0 : c1t5006048452A5C207d393s0 :
emcpower3a : 10EF: c2t5006048452A5C208d322s0 : c1t5006048452A5C207d341s0 :
emcpower2a : 10F3: c2t5006048452A5C208d323s0 : c1t5006048452A5C207d342s0 :
emcpower1a : 10F7: c2t5006048452A5C208d340s0 : c1t5006048452A5C207d343s0 :
emcpower0a : 10F9: c2t5006048452A5C208d341s0 : c1t5006048452A5C207d344s0 :
emcpower11a : 120E: c2t5006048452A5C208d394s0 : c1t5006048452A5C207d394s0 :
emcpower10a : 1215: c2t5006048452A5C208d395s0 : c1t5006048452A5C207d395s0 :
emcpower6a : 136C: c2t5006048452A5C208d343s0 : c1t5006048452A5C207d351s0 :
emcpower5a : 1372: c2t5006048452A5C208d344s0 : c1t5006048452A5C207d352s0 :
Download the script Click Here
No comments:
Post a Comment