{"id":141,"date":"2010-06-09T17:31:29","date_gmt":"2010-06-09T22:31:29","guid":{"rendered":"http:\/\/www.hpux.ws\/?p=141"},"modified":"2010-06-10T15:39:43","modified_gmt":"2010-06-10T20:39:43","slug":"system-io-layout-emc-specific","status":"publish","type":"post","link":"https:\/\/www.hpux.ws\/?p=141","title":{"rendered":"System I\/O layout (EMC specific)"},"content":{"rendered":"<p>This is a script designed to document the layout of a system. It is EMC specific and requires the output of the inq command, which I store in \/tmp\/inq.txt<\/p>\n<p>It can however be adapted to non EMC disk systems. It correctly shows the port\/lba layout and status of  network and fiber I\/O the way it appears on the outside of the system. Two tables are included to permit lookups of the port\/lba information. It has worked on blades, and is certified for rp8420 and superdome systems.<\/p>\n<p>It has only been tested on HP-UX 11.31.<\/p>\n<p>&#8230; please stand by&#8230;.update in progress&#8230;<\/p>\n<p>DF=&#8221;super.translate.dat&#8221;<br \/>\nMA=&#8221;router.macadd.dat&#8221;<\/p>\n<p>typeset MYDIR=\/var\/tmp\/syslayout<br \/>\ntypeset MYPAGE=mypage<br \/>\ntypeset MYDATA=mydata<br \/>\ntypeset IDX_HTML=syslayout.html<\/p>\n<p>writehtml (){<br \/>\nwhile [ $# -gt 0 ]<br \/>\ndo<br \/>\necho &#8220;&lt;td&gt;${1}&lt;\/td&gt;&#8221; &gt;&gt; ${IDX_HTML}<\/p>\n<p>shift<br \/>\ndone<br \/>\necho &#8220;&lt;tr&gt;&#8221; &gt;&gt; ${IDX_HTML}<br \/>\n}<\/p>\n<p>cat -&lt;&lt;!EOF &gt; ${IDX_HTML}<br \/>\n&lt;!DOCTYPE HTML PUBLIC &#8220;-\/\/W3C\/\/DTD HTML 4.0 Transitional\/\/EN&#8221;&gt;<br \/>\n&lt;title&gt;Dana IT Unix System documentation&lt;\/title&gt;<br \/>\n&lt;BODY&gt;<br \/>\n&lt;TABLE style=&#8221;WIDTH: 100%; COLOR: rgb(0,0,0); TEXT-ALIGN: left&#8221; cellSpacing=2<br \/>\ncellPadding=2 border=0&gt;<br \/>\n&lt;TBODY&gt;<br \/>\n&lt;TR&gt;<br \/>\n&lt;td width=&#8221;200&#8243;&gt;&lt;img<br \/>\nstyle=&#8221;border-width: 0px; margin: 0px; padding: 0px;&#8221; alt=&#8221;Dana&#8221;<br \/>\nsrc=&#8221;dana_logo.jpg&#8221;&gt; &lt;\/td&gt;<br \/>\n&lt;td style=&#8221;font-weight: bold;&#8221;&gt;&lt;big&gt;&lt;big&gt;Dana<br \/>\nIT<br \/>\nUnix:<br \/>\nDocumentation&lt;\/big&gt;&lt;\/big&gt;&lt;\/td&gt;<\/p>\n<p>&lt;TD style=&#8221;VERTICAL-ALIGN: top; TEXT-ALIGN: center&#8221; colSpan=7&gt;&lt;BIG<br \/>\nstyle=&#8221;FONT-FAMILY: helvetica,arial,sans-serif&#8221;&gt;&lt;BIG&gt;Dana IT system I\/O Layout.&lt;\/BIG&gt;&lt;\/BIG&gt;&lt;BR&gt;&lt;\/TD&gt;&lt;\/TR&gt;<br \/>\n!EOF<\/p>\n<p># colum layout # Path\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 slot MAC Address\u00a0\u00a0\u00a0 lan\u00a0 ipaddress\u00a0\u00a0\u00a0\u00a0\u00a0 vlan\u00a0\u00a0 linkstatus<\/p>\n<p>sysname=$(uname -n)<br \/>\nthis_cell=$(vparstatus -p $sysname -v |awk &#8216;\/Boot processor\/ {print $4}&#8217; |awk -F&#8217;\\.&#8217; &#8216;{print $1}&#8217;)<\/p>\n<p># echo $this_cell<\/p>\n<p>this_par=$(parstatus -c 0 |awk &#8216;\/cell&#8217;$this_cell&#8217;\/ {print $9}&#8217;)<\/p>\n<p>nparname=$(\/usr\/sbin\/parstatus -P |awk &#8220;\/^$this_par\/ {if(pname == 1) {print}};\/Partition Name\/ {pname=1}&#8221;|awk &#8216;\/&#8217;$this_par&#8217; \/ {print $6}&#8217;)<\/p>\n<p>#echo &#8220;Diag nparname: ${nparname}&#8221;<\/p>\n<p>complexname=$(\/usr\/sbin\/parstatus -X |awk &#8220;\/Complex Name\/&#8221;)<br \/>\ncellind=&#8221;cell${this_par}&#8221;<\/p>\n<p>nparinfo=$(\/usr\/sbin\/parstatus -P |awk &#8220;\/^$this_par\/ {if(pname == 1) {print}};\/Partition Name\/ {pname=1}&#8221;)<br \/>\n# model needs to be determineed<br \/>\nOS=$(uname -r)<br \/>\nif [ &#8220;$OS&#8221; = &#8220;B.11.31&#8221; ]<br \/>\nthen<br \/>\nmod=$(model | awk &#8216;{ print $5 }&#8217;)<br \/>\nelse<br \/>\nmod=$(model | awk -F\/ &#8216;{ print $3}&#8217;)<br \/>\nfi<\/p>\n<p>hn=$(hostname)<\/p>\n<p>this_cell=$(vparstatus -p ${hn} -v |awk &#8216;\/Boot processor\/ {print $4}&#8217; |awk -F&#8217;\\.&#8217; &#8216;{print $1}&#8217;)<\/p>\n<p>echo $this_cell<\/p>\n<p>this_par=$(parstatus -c 0 |awk &#8216;\/cell&#8217;$this_cell&#8217;\/ {print $9}&#8217;)<\/p>\n<p>\/usr\/sbin\/parstatus -P |awk &#8220;\/cell\/ {if(pname == 1) {print}};\/Partition Name\/ {pname=1}&#8221;|awk &#8216;\/&#8217;$this_par&#8217; \/ {print $6}&#8217;<\/p>\n<p>hn=$(hostname)<br \/>\nlhn=&#8221;${hn}.dana.com&#8221;<br \/>\necho &#8220;Host name: ${lhn}&#8221;<br \/>\nwritehtml &#8220;Host name:&#8221; ${lhn}<br \/>\necho &#8220;Model number is: $mod&#8221;<br \/>\nwritehtml &#8220;Model number:&#8221; ${mod}<br \/>\n#echo &#8220;&lt;td&gt;$complexname&lt;\/td&gt;&lt;td&gt;$nparname&lt;\/td&gt;&lt;tr&gt;&#8221; &gt;&gt;\u00a0 ${IDX_HTML}<br \/>\nwritehtml &#8220;${complexname}&#8221; ${nparname}<br \/>\necho &#8220;Model number is: $mod&#8221;<br \/>\npbootpath=$(parstatus -p 0 -V |awk -F: &#8216;\/Primary Boot Path\/ {print $2}&#8217;)<\/p>\n<p>echo &#8220;Primary boot path: ${pbootpath}&#8221;<br \/>\nwritehtml &#8220;Primary boot path:&#8221; ${pbootpath}<br \/>\n#echo &#8220;&lt;td&gt;$complexname&lt;\/td&gt;&lt;td&gt;$nparnam&lt;\/td&gt;&lt;tr&gt;&#8221; &gt;&gt;\u00a0 ${IDX_HTML}<br \/>\n# echo &#8220;&lt;td&gt;Path&lt;\/td&gt;&lt;td&gt;slot&lt;\/td&gt;&lt;td&gt;MAC Address&lt;\/td&gt;&lt;td&gt;lan&lt;\/td&gt;&lt;td&gt;IP Address&lt;\/td&gt;&lt;td&gt;vlan&lt;\/td&gt;&lt;td&gt;Link Status&lt;\/td&gt;&lt;tr&gt;&#8221; &gt;&gt;\u00a0 ${IDX_HTML}<br \/>\nwritehtml Path slot MAC_Address lan IP_Address vlan Link_Status<\/p>\n<p>#echo &#8220;$nparinfo&#8221;<br \/>\n# echo &#8220;Path\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 slot MAC\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 lan\u00a0\u00a0\u00a0\u00a0 check\u00a0\u00a0\u00a0 ip&#8221;<br \/>\n# 2\/0\/5\/1\/0\/6\/1 4 0x002264E4948B lan1 10.8.128.162<br \/>\necho\u00a0 &#8220;Path\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 slot MAC Address\u00a0\u00a0\u00a0 lan\u00a0 ipaddress\u00a0\u00a0\u00a0\u00a0\u00a0 vlan\u00a0\u00a0 linkstatus&#8221;<\/p>\n<p>\/usr\/sbin\/ioscan -fnk | awk &#8216;\/^lan\/ {print $3}&#8217; |while read -r path<br \/>\ndo<br \/>\nip=&#8221;&#8221;;<br \/>\necho $path\u00a0 | sed &#8216;s\/\\\/\/ \/g&#8217; | read p1 p2 p3 p4 p5 p6 p7<br \/>\nmacaddy=$(lanscan | awk &#8216;{if($1 == &#8220;&#8216;${path}'&#8221;) print $2}&#8217;)<br \/>\nlanid=$(lanscan | awk &#8216;{if($1 == &#8220;&#8216;${path}'&#8221;) print $5}&#8217;)<br \/>\nplan=$(lanscan | awk &#8216;{if($1 == &#8220;&#8216;${path}'&#8221;) print $3}&#8217;)<br \/>\nlchk=$(\/usr\/sbin\/linkloop -i $plan $macaddy 2&gt;\/dev\/null | grep &#8220;OK&#8221;)<br \/>\n# If linkloop produces postive results then see if there is an ip address<br \/>\nip=&#8221;IP not set&#8221;<br \/>\nif [ -n &#8220;$lchk&#8221; ]<br \/>\nthen<br \/>\n# echo &#8220;lchk not null. running ifconfig command&#8221;<br \/>\nip=$(\/usr\/sbin\/ifconfig $lanid | grep netmask | awk &#8216;{print $2}&#8217;)<br \/>\nfi<br \/>\n# roll through the router table and see if you can establish<br \/>\n# linkloop with the gateway<br \/>\nDRMAC=&#8221;No link..&#8221;<br \/>\nDVLAN=&#8221;Not found&#8221;<br \/>\n#while [[ &#8220;$value&#8221; != &#8220;val1&#8221; || &#8220;$value&#8221; != &#8220;val2&#8221; || &#8220;$value&#8221; != &#8220;val3&#8221; ]]<br \/>\nwhile read -r DL<br \/>\ndo<br \/>\nrmacaddy=$(echo $DL | awk -F: &#8216;{print $2}&#8217;)<br \/>\nrvlan=$(echo $DL | awk -F: &#8216;{print $3}&#8217;)<br \/>\nrlchk=$(\/usr\/sbin\/linkloop -i $plan $rmacaddy 2&gt;\/dev\/null | grep &#8220;OK&#8221;)<br \/>\nif [ -n &#8220;$rlchk&#8221; ]<br \/>\nthen<br \/>\n# echo &#8220;rlchk not null. setting vlan information.&#8221;<br \/>\nDRMAC=${rmacaddy}<br \/>\nDVLAN=${rvlan}<br \/>\nbreak;<br \/>\nfi<br \/>\ndone &lt; $MA<\/p>\n<p>#\u00a0 echo &#8220;${path} ${p7} ${macaddy} ${lanid} ${lchk} ${ip} &#8221;<br \/>\n#p1=$(echo $path | awk -F\/ &#8216;{print $1}&#8217;);<br \/>\n#p2=$(echo $path | awk -F\/ &#8216;{print $2}&#8217;);<br \/>\n#p3=$(echo $path | awk -F\/ &#8216;{print $3}&#8217;);<br \/>\n#p4=$(echo $path | awk -F\/ &#8216;{print $4}&#8217;);<br \/>\n#p5=$(echo $path | awk -F\/ &#8216;{print $5}&#8217;);<br \/>\n#p6=$(echo $path | awk -F\/ &#8216;{print $6}&#8217;);<br \/>\n#p7=$(echo $path | awk -F\/ &#8216;{print $7}&#8217;);<\/p>\n<p>portpath=$(echo $path | awk -F\/ &#8216;{print $3}&#8217;)<br \/>\nactualport=$(awk -F: &#8216;{if($2 == &#8220;&#8216;${portpath}'&#8221; &amp;&amp; $3 == &#8220;&#8216;$mod'&#8221;) print $1}&#8217; ${DF})<\/p>\n<p># echo &#8220;Actual path: ${p1} ${p2} ${p3} ${p4} ${p5} ${p6} ${p7}\u00a0 ${actualport} ${ip} ${macaddy} ${lanid} ${ip}&#8221;<br \/>\necho &#8220;${path} ${actualport} ${macaddy} ${lanid} ${ip}\u00a0\u00a0 ${DVLAN}\u00a0\u00a0 ${DRMAC}&#8221;<br \/>\n# echo &#8220;&lt;td&gt;${path}&lt;\/td&gt;&lt;td&gt;${actualport}&lt;\/td&gt;&lt;td&gt;${macaddy}&lt;\/td&gt;&lt;td&gt;${lanid}&lt;\/td&gt;&lt;td&gt;${ip}&lt;\/td&gt;&lt;td&gt;${DVLAN}&lt;\/td&gt;&lt;td&gt;${DRMAC}&lt;\/td&gt;&lt;tr&gt;&#8221; &gt;&gt; ${IDX_HTML}<br \/>\nwritehtml ${path} ${actualport} ${macaddy} ${lanid} ${ip} ${DVLAN} ${DRMAC}<br \/>\ndone<\/p>\n<p>echo &#8220;Fiber Channel&#8230;.&#8221;<br \/>\n# echo &#8220;&lt;td&gt;Fiber Channel&#8230;.&lt;\/td&gt;&lt;tr&gt;&#8221; &gt;&gt; ${IDX_HTML}<br \/>\nwritehtml\u00a0 &#8220;Fiber Channel&#8221;<br \/>\necho &#8220;PATH\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 slot Device&#8230; Status spd Hardware address&#8221;<br \/>\n# echo &#8220;&lt;td&gt;PATH&lt;\/td&gt;&lt;td&gt;slot&lt;\/td&gt;&lt;td&gt;Device&lt;\/td&gt;&lt;td&gt;Status&lt;\/td&gt;&lt;td&gt;speed&lt;\/td&gt;&lt;td&gt;Hardware address&lt;\/td&gt;&lt;tr&gt;&#8221; &gt;&gt;\u00a0 ${IDX_HTML}<br \/>\nwritehtml PATH slot Device Status speed Hardware address<br \/>\n#\/usr\/sbin\/ioscan -fnCfc | grep fcd | awk &#8216;{print $3}&#8217; |while read -r path<br \/>\n\/usr\/sbin\/ioscan -fnk | awk &#8216;\/^fc \/ {hw=$3;getline;print hw,$1}&#8217; |while read -r hw devfile<br \/>\ndo<br \/>\n#\u00a0\u00a0 echo &#8220;diag ${hw} dev file &#8230; ${devfile}&#8221;<br \/>\nport=$(echo $hw | awk -F\/ &#8216;{print $3}&#8217;)<br \/>\nOSTAT=$(fcmsutil $devfile | awk &#8216;\/ONLINE\/\u00a0 {print $4}&#8217;)<br \/>\nLSPD=$(fcmsutil $devfile | awk &#8216;\/Link Speed\/\u00a0 {print $4}&#8217;)<br \/>\nWWN=$(fcmsutil $devfile | awk &#8216;\/N_Port Port World Wide Name\/\u00a0 {print $7}&#8217;)<br \/>\n#\u00a0 OSTAT=$(fcmsutil \/dev\/fcd1 | awk &#8216;\/ONLINE\/\u00a0 {print $4}&#8217;)<br \/>\n#\u00a0 LSPD=$(fcmsutil \/dev\/fcd1 | awk &#8216;\/Link Speed\/\u00a0 {print $4}&#8217;)<br \/>\n#\u00a0 WWN=$(fcmsutil \/dev\/fcd1 | awk &#8216;\/N_Port Port World Wide Name\/\u00a0 {print $7}&#8217;)<br \/>\nactualport=$(awk -F: &#8216;{if($2 == &#8220;&#8216;${port}'&#8221; &amp;&amp; $3 == &#8220;&#8216;$mod'&#8221;) print $1}&#8217; ${DF})<br \/>\necho &#8220;$hw ${actualport} $devfile ${OSTAT} ${LSPD} ${WWN}&#8221;<br \/>\n#echo &#8220;&lt;td&gt;$hw&lt;\/td&gt;&lt;td&gt;${actualport}&lt;\/td&gt; &lt;td&gt;$devfile&lt;\/td&gt;&lt;td&gt;${OSTAT}&lt;\/td&gt;&lt;td&gt;${LSPD}&lt;\/td&gt; &lt;td&gt;${WWN}&lt;\/td&gt;&lt;tr&gt;&#8221; &gt;&gt;\u00a0 ${IDX_HTML}<br \/>\nwritehtml ${hw} ${actualport} ${devfile} ${OSTAT} ${LSPD} ${WWN}<br \/>\ndone<\/p>\n<p>#awk -F: &#8216;{printf(&#8220;%8s %5s %4s\\n&#8221;,$1,$3,$4)}&#8217; steve<br \/>\n#2\/0\/5\/1\/0\/6\/0<br \/>\n#2\/0\/5\/1\/0\/6\/1<\/p>\n<p>cat -&lt;&lt; !EOF &gt;&gt; ${IDX_HTML}<br \/>\n&lt;TR&gt;&lt;\/TR&gt;&lt;\/TBODY&gt;&lt;\/TABLE&gt;&lt;\/BODY&gt;&lt;\/HTML&gt;<br \/>\n!EOF<\/p>\n<p>chmod a+r ${IDX_HTML}<br \/>\n# Added to copy the data file to my home directory for diagnosis.<br \/>\ncp syslayout.html \/home\/sprotte<br \/>\nchmod a+r \/home\/sprotte\/syslayout.html<\/p>\n<p>super.translate.dat<br \/>\n&#8212;&#8211;<br \/>\nroot@gitop2:\/root # more \/usr\/global\/etc\/super.translate.dat<br \/>\n11:8:SD64B<br \/>\n10:9:SD64B<br \/>\n9:10:SD64B<br \/>\n8:12:SD64B<br \/>\n7:13:SD64B<br \/>\n6:14:SD64B<br \/>\n5:6:SD64B<br \/>\n4:5:SD64B<br \/>\n3:4:SD64B<br \/>\n2:2:SD64B<br \/>\n1:1:SD64B<br \/>\n0:0:SD64B<br \/>\n1:8:rp8420<br \/>\n2:10:rp8420<br \/>\n3:12:rp8420<br \/>\n4:14:rp8420<br \/>\n5:6:rp8420<br \/>\n6:4:rp8420<br \/>\n7:2:rp8420<br \/>\n8:1:rp8420<\/p>\n<p>more \/usr\/global\/etc\/router.macadd.dat<br \/>\nFormat:<\/p>\n<p>IP Address : MAC Address : vlan# : Description<br \/>\n:0x00000c07ac0a:vlan9:HP-UX Production<\/p>\n<p>Obviously this data varies from place the place. The Mac address of the router is used to check network connectivity with the linkloop command<br \/>\n<!--adsense--><!--adsense--><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a script designed to document the layout of a system. It is EMC specific and requires the output of the inq command, which I store in \/tmp\/inq.txt It can however be adapted to non EMC disk systems. It correctly shows the port\/lba layout and status of network and fiber I\/O the way it [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"_kadence_starter_templates_imported_post":false,"footnotes":""},"categories":[],"tags":[],"class_list":["post-141","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/www.hpux.ws\/index.php?rest_route=\/wp\/v2\/posts\/141"}],"collection":[{"href":"https:\/\/www.hpux.ws\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hpux.ws\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hpux.ws\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hpux.ws\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=141"}],"version-history":[{"count":0,"href":"https:\/\/www.hpux.ws\/index.php?rest_route=\/wp\/v2\/posts\/141\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.hpux.ws\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=141"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hpux.ws\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=141"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hpux.ws\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=141"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}