1748139 Members
3841 Online
108758 Solutions
New Discussion юеВ

SYM Devices ID's

 
SOLVED
Go to solution
Prashant Zanwar_4
Respected Contributor

SYM Devices ID's

I am sure many folks around would have symmetrix array connected to host.
Here it would be probably easy for folks, if I ask,

- I have multiple paths to metadevices, say 2-3
I want to collect all three devices on a single like having similar SYMID.

==============================================
/dev/rdsk/c12t0d0 0000 04A:0 01C:C2 2-Way Mir N/Grp'd VCM WD 23
/dev/rdsk/c12t0d1 0003 04A:0 01C:C0 2-Way Mir N/Grp'd RW 3
/dev/rdsk/c12t0d7 01CF 04A:0 01D:C3 2-Way Mir N/Grp'd RW 8714
/dev/rdsk/c12t1d0 0043 04A:0 01C:C0 2-Way Mir Grp'd (M) RW 17428
/dev/rdsk/c12t1d1 0045 04A:0 01A:C0 2-Way Mir N/Grp'd (M) RW 17428
/dev/rdsk/c12t1d2 0047 04A:0 16A:C1 2-Way Mir N/Grp'd (M) RW 17428
/dev/rdsk/c12t1d3 0049 04A:0 16C:C1 2-Way Mir Grp'd (M) RW 17428
/dev/rdsk/c12t1d7 0051 04A:0 16C:C3 2-Way Mir Grp'd (M) RW 17428
/dev/rdsk/c12t2d0 0053 04A:0 01C:C6 2-Way Mir Grp'd (M) RW 17428
/dev/rdsk/c12t2d1 0055 04A:0 01A:C4 2-Way Mir Grp'd (M) RW 17428
/dev/rdsk/c12t2d2 0057 04A:0 16A:C5 2-Way Mir Grp'd (M) RW 17428
/dev/rdsk/c12t2d3 0059 04A:0 16C:C5 2-Way Mir Grp'd (M) RW 17428
/dev/rdsk/c12t2d4 005B 04A:0 16B:C6 2-Way Mir Grp'd (M) RW 17428
/dev/rdsk/c12t2d5 005D 04A:0 16D:C6 2-Way Mir Grp'd (M) RW 17428
/dev/rdsk/c12t2d6 005F 04A:0 01D:C7 2-Way Mir Grp'd (M) RW 17428
/dev/rdsk/c12t2d7 0061 04A:0 01B:C7 2-Way Mir Grp'd (M) RW 17428
/dev/rdsk/c12t3d0 0063 04A:0 01D:D0 2-Way Mir Grp'd (M) RW 17428
/dev/rdsk/c12t3d1 0065 04A:0 01B:D0 2-Way Mir Grp'd (M) RW 17428

/dev/rdsk/c18t0d0 0000 13A:0 01C:C2 2-Way Mir N/Grp'd VCM WD 23
/dev/rdsk/c18t0d1 0007 13A:0 16A:C1 2-Way Mir N/Grp'd RW 3
/dev/rdsk/c18t0d7 01CF 13A:0 01D:C3 2-Way Mir N/Grp'd RW 8714
/dev/rdsk/c18t1d0 0043 13A:0 01C:C0 2-Way Mir Grp'd (M) RW 17428
/dev/rdsk/c18t1d1 0045 13A:0 01A:C0 2-Way Mir N/Grp'd (M) RW 17428
/dev/rdsk/c18t1d2 0047 13A:0 16A:C1 2-Way Mir N/Grp'd (M) RW 17428
/dev/rdsk/c18t1d3 0049 13A:0 16C:C1 2-Way Mir Grp'd (M) RW 17428
/dev/rdsk/c18t1d7 0051 13A:0 16C:C3 2-Way Mir Grp'd (M) RW 17428
/dev/rdsk/c18t2d0 0053 13A:0 01C:C6 2-Way Mir Grp'd (M) RW 17428
/dev/rdsk/c18t2d1 0055 13A:0 01A:C4 2-Way Mir Grp'd (M) RW 17428
/dev/rdsk/c18t2d2 0057 13A:0 16A:C5 2-Way Mir Grp'd (M) RW 17428
/dev/rdsk/c18t2d3 0059 13A:0 16C:C5 2-Way Mir Grp'd (M) RW 17428
/dev/rdsk/c18t2d4 005B 13A:0 16B:C6 2-Way Mir Grp'd (M) RW 17428
/dev/rdsk/c18t2d5 005D 13A:0 16D:C6 2-Way Mir Grp'd (M) RW 17428
/dev/rdsk/c18t2d6 005F 13A:0 01D:C7 2-Way Mir Grp'd (M) RW 17428
/dev/rdsk/c18t2d7 0061 13A:0 01B:C7 2-Way Mir Grp'd (M) RW 17428
/dev/rdsk/c18t3d0 0063 13A:0 01D:D0 2-Way Mir Grp'd (M) RW 17428
/dev/rdsk/c18t3d1 0065 13A:0 01B:D0 2-Way Mir Grp'd (M) RW 17428
===========================================

this is created thru query

sympd -sid 0451 list,

If you observe above, devices are same, like C18 is alternate to C12...

What I want to do is,

if 0043 appears in second column, and repeats again at later in output, i want to club column 1 ($1) for this device, with first output occured. Rest i can ignore.

For example :

/dev/rdsk/c12t3d1 0065 04A:0 01B:D0 2-Way Mir Grp'd (M) RW 17428

/dev/rdsk/c18t3d0 0063 13A:0 01D:D0 2-Way Mir Grp'd (M) RW 17428

these are similar,

i want to print

c12t3d1_c18t3d0 0063 2-Way Mir Grp'd (M) RW 17428

I think it's possible in one single command,
using some awk trick, getline or something..
not sure how to acheive..

I am able to club all similar one after other..
how to take them in one line and produce desire result, if some one can help, will be great.

Thanks
Prashant
















"Intellect distinguishes between the possible and the impossible; reason distinguishes between the sensible and the senseless. Even the possible can be senseless."
6 REPLIES 6
Prashant Zanwar_4
Respected Contributor

Re: SYM Devices ID's

Sorry for putting it wrong:
Above example becomes:

/dev/rdsk/c18t3d1 0065 13A:0 01B:D0 2-Way Mir Grp'd (M) RW 17428

/dev/rdsk/c12t3d1 0065 04A:0 01B:D0 2-Way Mir Grp'd (M) RW 17428

then

c18t3d1_c12t3d1 2-Way Mir Grp'd (M) RW 17428


Thanks, please reply..

This is needed to avoind any accidents while choosing free PV's from list.

Thanks and regards
Prashant
"Intellect distinguishes between the possible and the impossible; reason distinguishes between the sensible and the senseless. Even the possible can be senseless."
James R. Ferguson
Acclaimed Contributor
Solution

Re: SYM Devices ID's

Hi Prashant:

The attached perl script should do what you want.

Regards!

...JRF...
James R. Ferguson
Acclaimed Contributor

Re: SYM Devices ID's

Hi Prashant:

Oops, I forgot to tell you how to run it!

# ./syminq.pl file

(or):

# sympd -sid 0451 list | ./syminq.pl

Regards!

...JRF...
Prashant Zanwar_4
Respected Contributor

Re: SYM Devices ID's

That works great..
I really appreacite quick response.
Thanks a bunch..

If possible, can u also tell the way to put VGNAME in the end against the disk used in particular VG?
That will be just a excellant thing..

Thanks
Prashant
"Intellect distinguishes between the possible and the impossible; reason distinguishes between the sensible and the senseless. Even the possible can be senseless."
Prashant Zanwar_4
Respected Contributor

Re: SYM Devices ID's

That works great..
I really appreacite quick response.
Thanks a bunch..

I wanted this to be modified further and let the output also have a used disk ID=VGNAME of that disk, if disk is not used, should show as free..

If possible please post answer fot this requirement too..

Thanks
Prashant
"Intellect distinguishes between the possible and the impossible; reason distinguishes between the sensible and the senseless. Even the possible can be senseless."
James R. Ferguson
Acclaimed Contributor

Re: SYM Devices ID's

Hi (again) Prashant:

OK, a new version is attached which should meet your last requirements. Please try it.

Regards!


...JRF...