{"id":502,"date":"2011-01-28T00:30:38","date_gmt":"2011-12-06T05:51:50","guid":{"rendered":"http:\/\/kraftek.com\/blog\/get-a-table-with-hba-info-without-fcinfo\/"},"modified":"2011-01-28T00:30:38","modified_gmt":"2011-12-06T05:51:50","slug":"get-a-table-with-hba-info-without-fcinfo","status":"publish","type":"post","link":"\/blog\/index.php\/get-a-table-with-hba-info-without-fcinfo\/","title":{"rendered":"get a table with HBA info without fcinfo"},"content":{"rendered":"<p>We want a table that maps cX to its wwn and to its device path, like<br \/>\nControllerWW port name<br \/>\nWW node name<br \/>\nDevice Path<br \/>\nc1<br \/>\np:210100e08b27e1 c7 n:200100e08b27e1 c7\/pci@9,700000\/pci@4\/SUNW,qlc@4<br \/>\nSo we wrote a script for it, hbainfo.ksh:<br \/>\n#!\/bin\/ksh<br \/>\nprtpicl -v -c scsi-fcp | egrep &#8216;ww|devfs&#8217; | sed &#8216;s\/:node-wwn\/\/g; s\/:port-wwn\/\/g;s\/:devfs-path\/\/g; s\/ \/\/g&#8217; | nawk<br \/>\n&#8216;ORS=NR%3?&#8221; &#8220;:&#8221;n&#8221;&#8216; &gt; \/tmp\/piclmap.$$<br \/>\n(for c in `cfgadm -al | grep &#8220;fc-&#8221; | awk &#8216;{ print $1 }&#8217;`;do<br \/>\n\/usr\/ucb\/echo -n $c;<br \/>\nluxadm -e dump_map \/dev\/cfg\/${c} | grep Adap |while read l;do<br \/>\nfor w in `echo $l`;do<br \/>\nWC=`echo $w|wc -c`<br \/>\nif [ $WC -eq 17 ];then<br \/>\n\/usr\/ucb\/echo -n &#8221; $w &#8221;<br \/>\nfi<br \/>\ndone<br \/>\necho &#8220;&#8221;<br \/>\ndone<br \/>\ndone<br \/>\n) | while read l;do<br \/>\nW=`echo $l |awk &#8216;{ print $2 }&#8217;`<br \/>\nL=`echo &#8220;$l &#8221; | awk &#8216;{ print $1 &#8221; p:&#8221; $2 &#8221; n:&#8221;$3 }&#8217;`<br \/>\n\/usr\/ucb\/echo -n &#8220;$L &#8221;<br \/>\ngrep $W \/tmp\/piclmap. $$ | awk &#8216;{ print $3 }&#8217;<br \/>\ndone<br \/>\nrm \/tmp\/piclmap. $$<br \/>\nThanks to Hiram Ruiz for the commands<br \/>\n133\/433<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We want a table that maps cX to its wwn and to its device path, like ControllerWW port name WW node name Device Path c1 p:210100e08b27e1 c7 n:200100e08b27e1 c7\/pci@9,700000\/pci@4\/SUNW,qlc@4 So we wrote a script for it, hbainfo.ksh: #!\/bin\/ksh prtpicl -v -c scsi-fcp | egrep &#8216;ww|devfs&#8217; | sed &#8216;s\/:node-wwn\/\/g; s\/:port-wwn\/\/g;s\/:devfs-path\/\/g; s\/ \/\/g&#8217; | nawk &#8216;ORS=NR%3?&#8221; &#8220;:&#8221;n&#8221;&#8216; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-502","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"\/blog\/index.php\/wp-json\/wp\/v2\/posts\/502","targetHints":{"allow":["GET"]}}],"collection":[{"href":"\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=502"}],"version-history":[{"count":0,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/posts\/502\/revisions"}],"wp:attachment":[{"href":"\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=502"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=502"},{"taxonomy":"post_tag","embeddable":true,"href":"\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=502"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}