diff --git a/luninfo b/luninfo index 81f70b5..452d284 100755 --- a/luninfo +++ b/luninfo @@ -33,6 +33,7 @@ # Version 1.18 Relax regex for getting fc adapter firmware version # Version 1.19 added support for Purestorage Flash array # Version 1.20 stderr redirection for pcmpath +# Version 1.21 added support for Nimble Storage boxes use strict; use warnings; @@ -43,7 +44,7 @@ use List::Util qw( max ); use XML::Simple; # for config file #use Data::Dumper; -my $luninfo_version="1.20"; +my $luninfo_version="1.21"; my $cfgfile="/etc/luninfo.cfg"; @@ -483,7 +484,7 @@ sub identify_purestorage { # Important: The box or array id does not change when a lun is moved later on to another box! Take care! # see https://www.codyhosterman.com/2016/01/vmfs-snapshots-and-the-flasharray-part-iv-how-to-correlate-a-vmfs-to-a-flasharray-volume/ # and https://www.codyhosterman.com/2018/02/volume-matching-via-the-api-in-purity-5-0/ - if ( defined $disksref->{$d}->{'unique_id'} and $disksref->{$d}->{'unique_id'}=~ m/.....624A9370((................)(........))..FlashArray04PUREfcp/ ) { + if ( defined $disksref->{$d}->{'unique_id'} and $disksref->{$d}->{'unique_id'}=~ m/.....624A9370((................)(........))..FlashArray..PUREfcp/ ) { $disksref->{$d}->{'box'}=$2; # ???? $disksref->{$d}->{'uuid'}="$1"; my $tmpsuid=$3; @@ -500,6 +501,32 @@ sub identify_purestorage { return 0; # false } +# identify Nimble volumes +sub identify_nimblevolume { + my $disksref = shift; + my $d = shift; + + # nimblevolume + + # tested with Nimble box (unknown version). ODM package necessary! + # 372024b0c462a17e9aa76c9ce9004c7b937406Server06Nimblefcp + # the numbers in front of Server and Nimble seem to be the length of the following string, let's not depend on that 8-) + if ( defined $disksref->{$d}->{'unique_id'} and $disksref->{$d}->{'unique_id'}=~ m/....((................)6c9ce(...........))..Server..Nimblefcp/ ) { + $disksref->{$d}->{'box'}=$3; + $disksref->{$d}->{'uuid'}="$1"; + $disksref->{$d}->{'suid'}="$2"; + $disksref->{$d}->{'box_type'}="NIMB"; + if ( defined $disksref->{$d}->{'lun_id'} ) { + if ( $disksref->{$d}->{'lun_id'} =~ m/0x(?:([\da-f]+)0{12}|0)\b/ ) { # either 0 or value without 12 zeros + $disksref->{$d}->{'scsi_id'}= defined $1 ? hex($1):0; + } + } + return 1; # true + } + return 0; # false +} + + # option -i, -d, -p (only because of PCM) # read disk parameters of all disks, mostly -d, because of lun_id -> also -c sub get_all_lun_params { @@ -545,6 +572,9 @@ sub get_all_lun_params { elsif (/puredisk/) { identify_purestorage(\%disks, $disk); } + elsif (/nimblevolume/) { + identify_nimblevolume(\%disks, $disk); + } #elsif (/1814/) { # there is no unique_id on DS4800 type boxes, but a ieee_volname (e.g. 600A0B800011FA78000035D648C5DBA1) # don't know how to get the box serial from ieee_volname @@ -552,8 +582,9 @@ sub get_all_lun_params { # on vscsi lpars, the ieee_volname is inside uniqe_id: 3520600A0B800011FA78000035D648C5DBA105VDASD03AIXvscsi #} elsif (/vdisk/) { # vSCSI disks - identify_2145(\%disks, $disk) or identify_purestorage(\%disks, $disk) or + identify_nimblevolume(\%disks, $disk) or + identify_2145(\%disks, $disk) or identify_2107(\%disks, $disk); # we don't know a method to get the real scsi-id of vscsi devices, set it to "-" @@ -561,8 +592,9 @@ sub get_all_lun_params { } elsif (/mpioosdisk/) { # generic AIX MPIO - identify_2145(\%disks, $disk) or identify_purestorage(\%disks, $disk) or + identify_nimblevolume(\%disks, $disk) or + identify_2145(\%disks, $disk) or identify_2107(\%disks, $disk); } @@ -573,6 +605,10 @@ sub get_all_lun_params { elsif (/scsd/) { # parallel or serial SCSI disk (subclass would be scsi and sas) delete $disks{$disk}; # we are not interested in those -> remove from hash } + elsif (/osdisk/) { # generic disk without ODM package or driver + print STDERR "Generic $disks{$disk}->{'type'} for disk $disk is not supported! Please install MPIO ODM or driver!\n"; + delete $disks{$disk}; # we are not interested in those -> remove from hash + } elsif (/sisarray/) { # SAS RAID arrays delete $disks{$disk}; # we are (currently) not interested in those -> remove from hash } else {