<?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: ping status (extracting hostname) in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/ping-status/m-p/6247363#M496259</link>
    <description>&lt;P&gt;&amp;gt;awk -F: -v network="IDC-Secure SER" '--&amp;gt;it will grep the field matching with IDC-Secure SER.&lt;/P&gt;&lt;P&gt;&amp;gt;$0 ~ network { print $5, $6 }&amp;nbsp; -&amp;gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;$0 is the whole line, when I didn't know your exact file format.&amp;nbsp; For your new format we should use $7.&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;~&amp;nbsp; Is the match (ERE) operator.&amp;nbsp; If you want an exact match, you can just use:&lt;/P&gt;&lt;P&gt;$7 == network&lt;/P&gt;</description>
    <pubDate>Thu, 24 Oct 2013 23:51:37 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2013-10-24T23:51:37Z</dc:date>
    <item>
      <title>ping status</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ping-status/m-p/6237563#M496250</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i am writing script for checking the ping status for all servers from centralized server.&lt;/P&gt;&lt;P&gt;i am using the below script and there is no problem in the script&lt;BR /&gt;---------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;cat pingcheck.sh&lt;/P&gt;&lt;P&gt;for HOST in `&lt;FONT color="#ff0000"&gt;cat /home/madhu/userdetail/hostdetails.txt&lt;/FONT&gt;`&lt;BR /&gt;do&lt;BR /&gt;echo "&amp;nbsp; "&lt;BR /&gt;ping $HOST -n 5 &amp;gt; /home/madhu/log/All.log&lt;/P&gt;&lt;P&gt;if [ $? -ne 0 ]; then&lt;BR /&gt;echo "host $HOST not responding" &amp;gt; /home/madhu/log/failure.log&lt;BR /&gt;STAT="*Not Responding*"&lt;BR /&gt;else&lt;BR /&gt;echo "host $HOST responding" &amp;gt; /home/madhu/log/success.log&lt;BR /&gt;STAT="Responding"&lt;BR /&gt;fi&lt;BR /&gt;echo&amp;nbsp; "${HOST} ${STAT}"&lt;BR /&gt;done&lt;BR /&gt;echo " "&lt;BR /&gt;echo " "&lt;BR /&gt;echo "&amp;nbsp; Enter any Key:\c"&lt;BR /&gt;read dmy&lt;BR /&gt;--------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;$ cat &lt;FONT color="#ff0000"&gt;/home/madhu/userdetail/hostdetails.txt&lt;/FONT&gt;&lt;BR /&gt;Netwok segment-1&lt;BR /&gt;host1&lt;BR /&gt;host2&lt;/P&gt;&lt;P&gt;---------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but I need to do few modifications as below,&lt;/P&gt;&lt;P&gt;we have more than 10 different network.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so we can't have 10 hostlist files&amp;nbsp; &lt;FONT color="#ff0000"&gt;--&amp;gt; /home/madhu/userdetail/hostdetails.txt&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but as per the above script,I have to use 10 different host files.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but my thought is to have something like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#800000"&gt;$ cat /home/madhu/userdetail/hostdetails.txt&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;[Netwok segment-1]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;host1&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;host2&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;[Netwok segment-2]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;host3&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#800000"&gt;host4&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have to do some modification in script while refering to hostdetails.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I&amp;nbsp;want to&amp;nbsp;use one hostfile entry for all networks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so when I check ping status for Netwok segment-1,script should refer only to hosts matching&lt;BR /&gt;to pattern &lt;FONT color="#800000"&gt;[Netwok segment-1]&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;need help in modifying the script based on the pattern matching from referring&lt;BR /&gt;to single host file entry&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;--Madhu&lt;/P&gt;</description>
      <pubDate>Wed, 16 Oct 2013 12:24:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ping-status/m-p/6237563#M496250</guid>
      <dc:creator>madhucertify</dc:creator>
      <dc:date>2013-10-16T12:24:12Z</dc:date>
    </item>
    <item>
      <title>Re: ping status (extracting hostname)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ping-status/m-p/6238291#M496251</link>
      <description>&lt;P&gt;You need to use proper indentation so you can understand your script.&amp;nbsp; Also remove evil cats:&lt;/P&gt;&lt;P&gt;for HOST in $(&amp;lt; /home/madhu/userdetail/hostdetails.txt); do&lt;BR /&gt;&amp;nbsp;&amp;nbsp; echo&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ping $HOST -n 5 &amp;gt; /home/madhu/log/All.log&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your log will only have the last output, unless you append.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;$ cat &lt;FONT color="#000000"&gt;/home/madhu/userdetail/hostdetails.txt&lt;/FONT&gt;&lt;BR /&gt;Network segment-1&lt;BR /&gt;host1&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Did you want to process this first line or skip it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;$ cat /home/madhu/userdetail/hostdetails.txt&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;[Network segment-1]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;host1&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;host2&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;[Network segment-2]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;host3&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;host4&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;It would be much easier to process if you had it like:&lt;BR /&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;[Network segment-1] &lt;/FONT&gt;&lt;FONT color="#000000"&gt;host1&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;[Network segment-1]&lt;/FONT&gt;&lt;/FONT&gt; host2&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;[Network segment-2] &lt;/FONT&gt;&lt;FONT color="#000000"&gt;host3&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;[Network segment-2]&lt;/FONT&gt;&lt;/FONT&gt; host4&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;Do you literally have "&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;[Network segment-2]&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;"&amp;nbsp; Or some other name but with that punctuation?&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;But if you want to process your format you could do:&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;awk -v segment="Network segment-2" '&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;BEGIN { found = 0 }&lt;BR /&gt;substr($0, 1, 1) == "[" {&amp;nbsp; # start of segment&lt;BR /&gt;&amp;nbsp;&amp;nbsp; if ($0 ~ segment) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; found = 1&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; next&lt;BR /&gt;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp; if (found) exit # no more&lt;BR /&gt;&amp;nbsp;&amp;nbsp; next&lt;BR /&gt;}&lt;BR /&gt;found {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; print $0&lt;BR /&gt;}' /home/madhu/userdetail/hostdetails.txt | while read HOST; do&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;&amp;nbsp; echo&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ping $HOST -n 5 &amp;gt; /home/madhu/log/All.log&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;...&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;done&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2013 23:47:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ping-status/m-p/6238291#M496251</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2013-10-24T23:47:04Z</dc:date>
    </item>
    <item>
      <title>Re: ping status</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ping-status/m-p/6238549#M496252</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Modified Script :&lt;/P&gt;&lt;P&gt;------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;awk -v segment="Network segment-2" '&lt;/P&gt;&lt;P&gt;BEGIN { found = 0 }&lt;BR /&gt;substr($0, 1, 1) == "[" {&amp;nbsp; # start of segment&lt;BR /&gt;if ($0 ~ segment) {&lt;BR /&gt;found = 1&lt;BR /&gt;next&lt;BR /&gt;}&lt;BR /&gt;if (found) exit # no more&lt;BR /&gt;next&lt;BR /&gt;}&lt;BR /&gt;found {&lt;BR /&gt;print $0&lt;BR /&gt;}' /home/madhu/userdetail/hostdetails.txt | while read HOST; do&lt;/P&gt;&lt;P&gt;echo ping $HOST -n 5 &amp;gt; /home/madhu/log/All.log&lt;BR /&gt;done&lt;/P&gt;&lt;P&gt;----------------------------------------------------&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;see the below output:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;$ sh -x pincheck.sh&lt;BR /&gt;+ awk -v segment=Network segment-2&lt;/P&gt;&lt;P&gt;BEGIN { found = 0 }&lt;BR /&gt;substr($0, 1, 1) == "[" {&amp;nbsp; # start of segment&lt;BR /&gt;if ($0 ~ segment) {&lt;BR /&gt;found = 1&lt;BR /&gt;next&lt;BR /&gt;}&lt;BR /&gt;if (found) exit # no more&lt;BR /&gt;next&lt;BR /&gt;}&lt;BR /&gt;found {&lt;BR /&gt;print $0&lt;BR /&gt;} /home/madhu/userdetail/hostdetails.txt&lt;BR /&gt;+ read HOST&lt;/P&gt;&lt;P&gt;*********************************************************&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;No log is appended to /home/madhu/log/All.log&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I guess host file is not reading correctly from /home/madhu/userdetail/hostdetails.txt.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;Did you want to process this first line or skip it?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to skip.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;there are so many Data Center and each data center has many network name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so I have to check ping status for each network in each Data Center.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so when I am checking ping status for Data Center1 and network segment1,other hosts entry in different network&lt;/P&gt;&lt;P&gt;should not be taken as input from hostfile.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;gt;Do you literally have "[Network segment-2]"&amp;nbsp; Or some other name but with that punctuation?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"[Network segment-2]"---- I gave it for Example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;originally it will be as something like IDC-Secure SER&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;IDC-Data Center Name&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;similarly I have IDC-Secure None and with other names.&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2013 08:24:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ping-status/m-p/6238549#M496252</guid>
      <dc:creator>madhucertify</dc:creator>
      <dc:date>2013-10-17T08:24:23Z</dc:date>
    </item>
    <item>
      <title>Re: ping status (extracting hostname)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ping-status/m-p/6239687#M496253</link>
      <description>&lt;P&gt;&amp;gt;I guess host file is not reading correctly from /home/madhu/userdetail/hostdetails.txt.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to see a more realistic version of that file.&amp;nbsp; I'm assuming there are "[" in column 1.&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2013 23:47:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ping-status/m-p/6239687#M496253</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2013-10-24T23:47:18Z</dc:date>
    </item>
    <item>
      <title>Re: ping status</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ping-status/m-p/6239703#M496254</link>
      <description>&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;HI&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;[Network segment-1] &lt;/FONT&gt;&lt;FONT color="#000000"&gt;host1&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;[Network segment-1]&lt;/FONT&gt;&lt;/FONT&gt; host2&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;[Network segment-2] &lt;/FONT&gt;&lt;FONT color="#000000"&gt;host3&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;[Network segment-2]&lt;/FONT&gt;&lt;/FONT&gt; host4&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;&amp;gt;&amp;gt;I need to see a more realistic version of that file.&amp;nbsp; I'm assuming there are "[" in column 1&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;[IDC-Secure SER] tes00101&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;[IDC-Secure SER] tes00201&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;[EDC-SER] pgn00101&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;-- madhu&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Oct 2013 08:45:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ping-status/m-p/6239703#M496254</guid>
      <dc:creator>madhucertify</dc:creator>
      <dc:date>2013-10-18T08:45:01Z</dc:date>
    </item>
    <item>
      <title>Re: ping status (extracting hostname)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ping-status/m-p/6240445#M496255</link>
      <description>&lt;P&gt;&amp;gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;[IDC-Secure SER] tes00101&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My original script works on your original format.&amp;nbsp; Try this one:&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;awk -v segment="&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;IDC-Secure SER&lt;/FONT&gt;&lt;/FONT&gt;" '&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;$0 ~ segment { print $NF }&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;' /home/madhu/userdetail/hostdetails.txt | while read HOST; do&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ping $HOST -n 5 &amp;gt; /home/madhu/log/All.log&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;&lt;FONT color="#000000"&gt;...&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2013 23:47:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ping-status/m-p/6240445#M496255</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2013-10-24T23:47:29Z</dc:date>
    </item>
    <item>
      <title>Re: ping status</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ping-status/m-p/6245407#M496256</link>
      <description>&lt;P&gt;Hi Dennis,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Your sugesstion worked fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I modified the script as below,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-------&lt;/P&gt;&lt;P&gt;&amp;gt;/home/madhu/log/Pingstatus.log&lt;BR /&gt;awk -v segment="IDC-Secure SER" '&lt;/P&gt;&lt;P&gt;$0 ~ segment { print $NF }&lt;/P&gt;&lt;P&gt;' /home/madhu/userdetail/hostdetails.txt | while read HOST; do&lt;BR /&gt;ping $HOST -n 5 &amp;gt; /home/madhu/log/All.log&lt;/P&gt;&lt;P&gt;if [ $? -ne 0 ]; then&lt;BR /&gt;echo "host $HOST not responding"&lt;BR /&gt;STAT="\033[41m\033[37m *Failure* \033[0m"&lt;BR /&gt;else&lt;BR /&gt;echo "host $HOST responding"&lt;BR /&gt;STAT="*Success*"&lt;BR /&gt;fi&lt;BR /&gt;echo&amp;nbsp; "|${HOST} ${STAT}|"&lt;BR /&gt;echo&amp;nbsp; "|${HOST} ${STAT}|" &amp;gt;&amp;gt; /home/madhu/log/pingstatus.log&lt;BR /&gt;done&lt;BR /&gt;echo " "&lt;BR /&gt;echo " "&lt;BR /&gt;echo "&amp;nbsp; Enter any Key:\c"&lt;BR /&gt;read dmy&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;---------------------&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;above script is working fine and no problem in it .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but there is some changes in my host file enrty -&amp;gt; /home/madhu/userdetail/hostdetails.txt&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;previously it was&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[IDC-Secure SER] tes00101&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but now as per recommendation my host file should be like as below ,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;---------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;name:details:NO:ipaddress:hostname:status:network&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;tes00101:prod:NO:10.01.23.45:tes00101:production:IDC-Secure SER&lt;/P&gt;&lt;P&gt;---------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;as per the original script,host name should be greped based on the network area,but I also need to display the sixth field in the ouput along with the hostname and ping status.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;original script output will be as similar to below&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;tes00101 *success*&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but now,I have to make changes in the output as below,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;--------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;tes00101 *success* prodction (sixth field should be taken from host entry file.&lt;/P&gt;&lt;P&gt;---------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-madhu&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2013 13:43:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ping-status/m-p/6245407#M496256</guid>
      <dc:creator>madhucertify</dc:creator>
      <dc:date>2013-10-23T13:43:10Z</dc:date>
    </item>
    <item>
      <title>Re: ping status (extracting hostname)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ping-status/m-p/6245903#M496257</link>
      <description>&lt;P&gt;&amp;gt;tes00101:prod:NO:10.01.23.45:tes00101:production:IDC-Secure SER&lt;/P&gt;&lt;P&gt;&amp;gt;I also need to display the sixth field in the output along with the hostname and ping status.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;awk -F: -v network="IDC-Secure SER" '&lt;/P&gt;&lt;P&gt;$0 ~ network { print $5, $6 }&lt;/P&gt;&lt;P&gt;' /home/madhu/userdetail/hostdetails.txt | while read HOST H_STATUS; do&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; echo&amp;nbsp; "${HOST} ${STAT} ${H_STATUS}"&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2013 23:47:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ping-status/m-p/6245903#M496257</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2013-10-24T23:47:41Z</dc:date>
    </item>
    <item>
      <title>Re: ping status</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ping-status/m-p/6246977#M496258</link>
      <description>&lt;P&gt;HI Dennis,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1.awk -F: -v network="IDC-Secure SER" '&lt;/P&gt;&lt;P&gt;2.$0 ~ network { print $5, $6 }&lt;/P&gt;&lt;P&gt;3.' /home/madhu/userdetail/hostdetails.txt | while read HOST H_STATUS; do&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;--&amp;gt;above changes worked fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;can you explain me what you have done.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;awk -F: -v network="IDC-Secure SER" '--&amp;gt;it will grep the filed matching with IDC-Secure SER.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$0 ~ network { print $5, $6 }&amp;nbsp; -&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;$0 --&amp;gt; it refers to the file name (/home/madhu/userdetail/hostdetails.txt)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;~ -&amp;gt; refers to the parent dir.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;but i am not sure with the second line.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you explain it ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-madhu&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2013 15:24:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ping-status/m-p/6246977#M496258</guid>
      <dc:creator>madhucertify</dc:creator>
      <dc:date>2013-10-24T15:24:36Z</dc:date>
    </item>
    <item>
      <title>Re: ping status (extracting hostname)</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ping-status/m-p/6247363#M496259</link>
      <description>&lt;P&gt;&amp;gt;awk -F: -v network="IDC-Secure SER" '--&amp;gt;it will grep the field matching with IDC-Secure SER.&lt;/P&gt;&lt;P&gt;&amp;gt;$0 ~ network { print $5, $6 }&amp;nbsp; -&amp;gt;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;$0 is the whole line, when I didn't know your exact file format.&amp;nbsp; For your new format we should use $7.&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;~&amp;nbsp; Is the match (ERE) operator.&amp;nbsp; If you want an exact match, you can just use:&lt;/P&gt;&lt;P&gt;$7 == network&lt;/P&gt;</description>
      <pubDate>Thu, 24 Oct 2013 23:51:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ping-status/m-p/6247363#M496259</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2013-10-24T23:51:37Z</dc:date>
    </item>
  </channel>
</rss>

