<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Script to identify alternate PV links in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-identify-alternate-pv-links/m-p/4648470#M380010</link>
    <description>Hi Steven,&lt;BR /&gt;&lt;BR /&gt;    Thank you very much for the scripts. I am yet  to try these. I do have servers with inq utility installed on them. I believe this will save a lot of time for me. Thanks again&lt;BR /&gt;&lt;BR /&gt;Note: I am not closing this thread now..Anybody who have better suggestions please post :)</description>
    <pubDate>Thu, 17 Jun 2010 09:18:27 GMT</pubDate>
    <dc:creator>unixnewbie</dc:creator>
    <dc:date>2010-06-17T09:18:27Z</dc:date>
    <item>
      <title>Script to identify alternate PV links</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-identify-alternate-pv-links/m-p/4648466#M380006</link>
      <description>I would like to know whether any of the HP-UX gurus here has got a script/one liner to identify alternate PV links easily ? If so could you please share it ?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.</description>
      <pubDate>Wed, 16 Jun 2010 12:12:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-identify-alternate-pv-links/m-p/4648466#M380006</guid>
      <dc:creator>unixnewbie</dc:creator>
      <dc:date>2010-06-16T12:12:39Z</dc:date>
    </item>
    <item>
      <title>Re: Script to identify alternate PV links</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-identify-alternate-pv-links/m-p/4648467#M380007</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;Using:&lt;BR /&gt;&lt;BR /&gt;# vgdisplay -v &lt;BR /&gt;&lt;BR /&gt;...will show alternate links under the "Physical volumes" stanza.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Wed, 16 Jun 2010 12:39:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-identify-alternate-pv-links/m-p/4648467#M380007</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2010-06-16T12:39:20Z</dc:date>
    </item>
    <item>
      <title>Re: Script to identify alternate PV links</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-identify-alternate-pv-links/m-p/4648468#M380008</link>
      <description>Hi JRF,&lt;BR /&gt;&lt;BR /&gt;Thanks for that.. But I need some thing more than that.. I am in the process of documenting the hardware configuration/usage of a number of servers. As a part of it I need the number of disks  and the alternate PV links to each disks on a given server.So I am looking for a script/one liner which I can execute and collect the data with out looking in to the VG configuration.</description>
      <pubDate>Wed, 16 Jun 2010 13:01:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-identify-alternate-pv-links/m-p/4648468#M380008</guid>
      <dc:creator>unixnewbie</dc:creator>
      <dc:date>2010-06-16T13:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: Script to identify alternate PV links</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-identify-alternate-pv-links/m-p/4648469#M380009</link>
      <description>&lt;!--!*#--&gt;Shalom,&lt;BR /&gt;&lt;BR /&gt;I have a few EMC centric scripts that might help.&lt;BR /&gt;&lt;BR /&gt;Some modification is required.&lt;BR /&gt;&lt;BR /&gt;bdf | awk -F\/ '{print $3}' | sort -u | while read -r dv&lt;BR /&gt;do&lt;BR /&gt; echo "VG:${dv}"&lt;BR /&gt; vgdisplay -v $dv | grep "PV Name" | grep -v "Alternate Link"| awk -F\/ '{print&lt;BR /&gt;  $4}' | while read -r dn&lt;BR /&gt;  do&lt;BR /&gt;      diskdev=$(grep $dn /tmp/inq.txt | awk -F\/ '{print $4}');&lt;BR /&gt;      emcdev=$(grep $dn /tmp/inq.txt | awk -F: '{print $5}');&lt;BR /&gt;      emcsize=$(grep $dn /tmp/inq.txt | awk -F: '{print $6}');&lt;BR /&gt;  done&lt;BR /&gt;  echo "Device: ${diskdev} EMCdev: ${emcdev} EMCSIZE: ${emcsize}"&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;&lt;BR /&gt;ITF="interim.disk.list.data"&lt;BR /&gt;&lt;BR /&gt;cp diskrep.txt ${ITF}&lt;BR /&gt;&lt;BR /&gt;bdf | awk '{print $1}' | awk -F\/ '{print $3}' | sort -u | grep -v "^$" | while read -r vg&lt;BR /&gt;do&lt;BR /&gt;        echo ${vg}&lt;BR /&gt;        vgdisplay -v $vg | awk '/PV Name/' | grep -v "Alternate Link" | awk '{print $3}' | while read -r dn&lt;BR /&gt;        do&lt;BR /&gt;        echo "disk: ${dn}"&lt;BR /&gt;        p1="dev"&lt;BR /&gt;        p3=$(echo $dn | awk -F\/ '{print $4}')&lt;BR /&gt;        p2="rdsk"&lt;BR /&gt;        dinfostring="/${p1}/${p2}/${p3}"&lt;BR /&gt;        dsize=$(diskinfo ${dinfostring}| grep "size:" | awk '{print $2}')&lt;BR /&gt;        symid=$(grep ${dinfostring} /tmp/inq.txt | awk -F: '{print $5}')&lt;BR /&gt;        echo "source: ${dinfostring} size: $dsize (kb) symid: $symid"&lt;BR /&gt;        # get the destination disk by size create interim file&lt;BR /&gt;        # 1 get sim id and device of a disk of the same size from the file&lt;BR /&gt;#           echo "About to grep dsize: ${dsize}"&lt;BR /&gt;           DL=$(grep ${dsize} ${ITF} | head -1)&lt;BR /&gt;#          echo "data line is: ${DL}"&lt;BR /&gt;           if [ "$DL" = "" ]&lt;BR /&gt;           then &lt;BR /&gt;              print No Match Found for disk ${dn}&lt;BR /&gt;              continue&lt;BR /&gt;           fi&lt;BR /&gt;           dsimid=$(echo $DL | awk '{ print $5}')&lt;BR /&gt;           dsdisk=$(echo $DL | awk '{ print $1}')&lt;BR /&gt;        echo "dest: ${dsdisk} id: ${dsimid}"&lt;BR /&gt;        grep -v $dsimid ${ITF} &amp;gt; tfile&lt;BR /&gt;        cp tfile ${ITF}&lt;BR /&gt;        done    &lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;This last one is really good and can actually extend your volume group to include alternate links.&lt;BR /&gt;&lt;BR /&gt;None of these scripts are good enough for my blog yet, and they are sadly going to need modification to work with systems that do not have the EMC inq utility.&lt;BR /&gt;&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;inq &amp;gt; /tmp/inq.out &lt;BR /&gt;LF="log.txt"&lt;BR /&gt;vgname=$1&lt;BR /&gt;# vgdisplay -v $vgname | awk -F/ '!/Alternate/ &amp;amp;&amp;amp; /PV Name/ {print }' &lt;BR /&gt;vgdisplay -v $vgname | awk -F/ '!/Alternate/ &amp;amp;&amp;amp; /PV Name/ {print $4}' | while read dname &lt;BR /&gt;do &lt;BR /&gt;#  awk -F: '/\/dev\/rdsk\/'$dname'/ {print }'&lt;BR /&gt;  sid=$(awk -F: '/\/dev\/rdsk\/'$dname'/ {print $5}' /tmp/inq.out )&lt;BR /&gt;  echo "sid is ${sid} dname is ${dname}"&lt;BR /&gt;  # for newdsk in $(awk -F: '{if($5 == "'${sid}'") {print $1} }' /tmp/inq.out | sed 's/rdsk/dsk/g')&lt;BR /&gt;#  awk -v dsid=${sid} -F:  '/'$sid'/ {print}' /tmp/inq.out &lt;BR /&gt;#   grep ${sid} /tmp/inq.out | awk -F: '{print "vgextend vg08 ",$1}'  | sed 's/rdsk/dsk/g'&lt;BR /&gt;  VGI="/tmp/${vgname}.dat"&lt;BR /&gt;  vgdisplay -v ${vgname} | awk '/PV Name/ {print $3}' &amp;gt; ${VGI}     &lt;BR /&gt;  for newdsk in $(grep ${sid} /tmp/inq.out |awk '{print $1}' | sed 's/rdsk/dsk/g')&lt;BR /&gt;  do&lt;BR /&gt;        # see if disk is present before running vgexend.&lt;BR /&gt;        present=$(grep ${newdsk} ${VGI} | wc -l)&lt;BR /&gt;        print vgextend ${vgname} ${newdsk} present: $present&lt;BR /&gt;        if [ $present -eq 1 ]&lt;BR /&gt;        then&lt;BR /&gt;          echo "Disk $newdsk present in $vgname doing nothing"&lt;BR /&gt;        else&lt;BR /&gt;          echo "Disk $newdsk NOT present in $vgname extending volume group"&lt;BR /&gt;          vgreduce -l $vgname $newdsk&lt;BR /&gt;          vgextend $vgname $newdsk&lt;BR /&gt;        fi&lt;BR /&gt;#        echo $newdisk &amp;gt;&amp;gt; $LF&lt;BR /&gt;  done&lt;BR /&gt;done&lt;BR /&gt;</description>
      <pubDate>Wed, 16 Jun 2010 13:18:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-identify-alternate-pv-links/m-p/4648469#M380009</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2010-06-16T13:18:53Z</dc:date>
    </item>
    <item>
      <title>Re: Script to identify alternate PV links</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-identify-alternate-pv-links/m-p/4648470#M380010</link>
      <description>Hi Steven,&lt;BR /&gt;&lt;BR /&gt;    Thank you very much for the scripts. I am yet  to try these. I do have servers with inq utility installed on them. I believe this will save a lot of time for me. Thanks again&lt;BR /&gt;&lt;BR /&gt;Note: I am not closing this thread now..Anybody who have better suggestions please post :)</description>
      <pubDate>Thu, 17 Jun 2010 09:18:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-identify-alternate-pv-links/m-p/4648470#M380010</guid>
      <dc:creator>unixnewbie</dc:creator>
      <dc:date>2010-06-17T09:18:27Z</dc:date>
    </item>
    <item>
      <title>Re: Script to identify alternate PV links</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-identify-alternate-pv-links/m-p/4648471#M380011</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;If you have "symcli" (emc):&lt;BR /&gt;&lt;BR /&gt;# symvg list -v|more&lt;BR /&gt;&lt;BR /&gt;Volume Group Name : /dev/vgxxxxx&lt;BR /&gt;Volume Group Type : HP-UX LVM&lt;BR /&gt;&lt;BR /&gt;    Volume Group State             : Enabled&lt;BR /&gt;&lt;BR /&gt;    Volume Group Attributes        : Multipathed devices&lt;BR /&gt;&lt;BR /&gt;    Group's Physical Extent Size   : 4096k&lt;BR /&gt;&lt;BR /&gt;    Max Number of Devices in Group :  32&lt;BR /&gt;    Max Number of Volumes in Group : 255&lt;BR /&gt;&lt;BR /&gt;    Number of Devices in Group     :   4&lt;BR /&gt;    Number of Volumes in Group     :  26&lt;BR /&gt;&lt;BR /&gt;    Physical Device Members (4):&lt;BR /&gt;        {&lt;BR /&gt;        -------------------------------------------------------&lt;BR /&gt;                                                           Cap&lt;BR /&gt;        PdevName                  Array  Dev  Att. Sts     (MB)&lt;BR /&gt;        -------------------------------------------------------&lt;BR /&gt;        /dev/rdsk/c34t1d2         02627  06E5 (S)  RW      8632&lt;BR /&gt;        /dev/rdsk/c34t1d3         02627  06E6 (S)  RW      8632&lt;BR /&gt;        /dev/rdsk/c34t1d4         02627  06E7 (S)  RW      8632&lt;BR /&gt;        /dev/rdsk/c34t1d5         02627  06E8 (S)  RW      8632&lt;BR /&gt;        }&lt;BR /&gt;&lt;BR /&gt;rgs,</description>
      <pubDate>Thu, 17 Jun 2010 09:24:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-identify-alternate-pv-links/m-p/4648471#M380011</guid>
      <dc:creator>rariasn</dc:creator>
      <dc:date>2010-06-17T09:24:52Z</dc:date>
    </item>
    <item>
      <title>Re: Script to identify alternate PV links</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-to-identify-alternate-pv-links/m-p/4648472#M380012</link>
      <description>unixnewbie, #vgdisplay -v|grep -e "VG Name" -e dsk #Cheers.</description>
      <pubDate>Thu, 17 Jun 2010 09:29:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-to-identify-alternate-pv-links/m-p/4648472#M380012</guid>
      <dc:creator>Raj D.</dc:creator>
      <dc:date>2010-06-17T09:29:53Z</dc:date>
    </item>
  </channel>
</rss>

