Highlighted
kofiboadi
1 Nickel

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

Labels (2)
0 Kudos
8 Replies
PedalHarder
2 Iron

Re: 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

for /f "tokens=1" %i in (dev-cimcc01.txt) do symdev -sid 507 show %i | findstr /I wwn

0 Kudos
kofiboadi
1 Nickel

Re: 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

Thank you you a great bunch. It worked!

0 Kudos
kofiboadi
1 Nickel

Re: 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

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

0 Kudos
kofiboadi
1 Nickel

Re: 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

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



0 Kudos
PaulCork
2 Iron

Re: 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

wwn.png

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.

0 Kudos
kofiboadi
1 Nickel

Re: 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

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

0 Kudos
PaulCork
2 Iron

Re: 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

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 .

0 Kudos
kofiboadi
1 Nickel

Re: 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

ok thanks

0 Kudos