Unsolved
This post is more than 5 years old
20 Posts
0
2446
How can I do this in Windows Solutions Enabler? en1mp5t@essbkup5:/home/en1mp5t/cr-CIM>cat dev-cimcc01.txt | while read x > do > sudo symdev -sid 507 show $x | grep -i wwn > done
How can I do this in Windows Solutions Enabler?
en1mp5t@essbkup5:/home/en1mp5t/cr-CIM>cat dev-cimcc01.txt | while read x
> do
> sudo symdev -sid 507 show $x | grep -i wwn
> done
This will read and execute the sym command by reading from the file dev-cimcc01.tx. the file contains a list of lun IDs
Thanks
kofiboadi
20 Posts
0
February 19th, 2017 20:00
Thank you you a great bunch. It worked!
kofiboadi
20 Posts
0
February 19th, 2017 20:00
So this is what I get. can I have it in a way that it just runs and doesnt repeat the line "C:\Users\kboadi>symdev -sid 45 show 26A8 | findstr /I wwn" for each content in the file it reads.
C:\Users\kboadi>for /f "tokens=1" %i in (ddd.txt) do symdev -sid 45 show %i | fi
ndstr /I wwn
C:\Users\kboadi>symdev -sid 45 show 26A8 | findstr /I wwn
Encapsulated WWN : N/A
Device WWN : 60000970000195700745533032364138
Device WWN : 60000970000195700745533032364138
C:\Users\kboadi>symdev -sid 45 show 26A9 | findstr /I wwn
Encapsulated WWN : N/A
Device WWN : 60000970000195700745533032364139
Device WWN : 60000970000195700745533032364139
C:\Users\kboadi>symdev -sid 45 show 26AA | findstr /I wwn
Encapsulated WWN : N/A
Device WWN : 60000970000195700745533032364141
Device WWN : 60000970000195700745533032364141
C:\Users\kboadi>symdev -sid 45 show 26AB | findstr /I wwn
Encapsulated WWN : N/A
Device WWN : 60000970000195700745533032364142
Device WWN : 60000970000195700745533032364142
C:\Users\kboadi>symdev -sid 45 show 2740 | findstr /I wwn
Encapsulated WWN : N/A
Device WWN : 60000970000195700745533032373430
Device WWN : 60000970000195700745533032373430
C:\Users\kboadi>symdev -sid 45 show 2741 | findstr /I wwn
Encapsulated WWN : N/A
Device WWN : 60000970000195700745533032373431
Device WWN : 60000970000195700745533032373431
C:\Users\kboadi>symdev -sid 45 show 2742 | findstr /I wwn
Encapsulated WWN : N/A
Device WWN : 60000970000195700745533032373432
Device WWN : 60000970000195700745533032373432
C:\Users\kboadi>symdev -sid 45 show 2743 | findstr /I wwn
Encapsulated WWN : N/A
Device WWN : 60000970000195700745533032373433
PedalHarder
465 Posts
0
February 19th, 2017 20:00
for /f "tokens=1" %i in (dev-cimcc01.txt) do symdev -sid 507 show %i | findstr /I wwn
kofiboadi
20 Posts
0
February 19th, 2017 20:00
And if I want to pipe it to uniq , how does windows do that also? Like
sudo symdev -sid 507 show $x | grep -i wwn |uniq
rawstorage
419 Posts
0
February 20th, 2017 02:00
Why not just add the -wwn flag onto syminq or symdev show surely this is the easiest way if the devices are already in a group then you can add -sg flag as shown above.
kofiboadi
20 Posts
0
February 20th, 2017 06:00
Thanks that works too. But I still wanna know how to pass to unique in windows. I need it for other scenarios.
Sent from my iPhone
rawstorage
419 Posts
0
February 20th, 2017 08:00
not sure what tools you have installed on your windows box but if I was to do this with cywin, I would use
symdev -sid xxx -sg sgname list -wwn | grep -i tdev | awk '{print $1, $4}' this will give you both the symdev name and wwn stripped off, you could just display $4 to get only the wwn, the WWN will be unique on this output and what is presented to the host. On the dymdev show you will get back the internal and external WWN, this is for SRDF Metro and NDM usage, the symdev show will always show you the external identity .
kofiboadi
20 Posts
0
February 20th, 2017 08:00
ok thanks