<?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 scripting and ping in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-and-ping/m-p/2765777#M895321</link>
    <description>Hi Script Gurus :)&lt;BR /&gt;&lt;BR /&gt;OK I wanna do a ping but only once.&lt;BR /&gt;what I do is ping [IPADRESSS} 56 1&lt;BR /&gt;it works fine but how can I verify if it is not working? I have to send an interrupt when it fails.&lt;BR /&gt;How can I do this in a script&lt;BR /&gt;&lt;BR /&gt;Thanks in advance&lt;BR /&gt;&lt;BR /&gt;Andi</description>
    <pubDate>Wed, 17 Jul 2002 08:51:42 GMT</pubDate>
    <dc:creator>Andi Rigauer</dc:creator>
    <dc:date>2002-07-17T08:51:42Z</dc:date>
    <item>
      <title>scripting and ping</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-and-ping/m-p/2765777#M895321</link>
      <description>Hi Script Gurus :)&lt;BR /&gt;&lt;BR /&gt;OK I wanna do a ping but only once.&lt;BR /&gt;what I do is ping [IPADRESSS} 56 1&lt;BR /&gt;it works fine but how can I verify if it is not working? I have to send an interrupt when it fails.&lt;BR /&gt;How can I do this in a script&lt;BR /&gt;&lt;BR /&gt;Thanks in advance&lt;BR /&gt;&lt;BR /&gt;Andi</description>
      <pubDate>Wed, 17 Jul 2002 08:51:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-and-ping/m-p/2765777#M895321</guid>
      <dc:creator>Andi Rigauer</dc:creator>
      <dc:date>2002-07-17T08:51:42Z</dc:date>
    </item>
    <item>
      <title>Re: scripting and ping</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-and-ping/m-p/2765778#M895322</link>
      <description>Hi Andi,&lt;BR /&gt;There are a lot of posts about this. Just do a "script ping" search on the forums.&lt;BR /&gt;&lt;BR /&gt;One good example :&lt;BR /&gt;&lt;A href="http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x7401a24d9abcd4118fef0090279cd0f9,00.html" target="_blank"&gt;http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x7401a24d9abcd4118fef0090279cd0f9,00.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Tom</description>
      <pubDate>Wed, 17 Jul 2002 08:58:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-and-ping/m-p/2765778#M895322</guid>
      <dc:creator>Tom Geudens</dc:creator>
      <dc:date>2002-07-17T08:58:45Z</dc:date>
    </item>
    <item>
      <title>Re: scripting and ping</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-and-ping/m-p/2765779#M895323</link>
      <description>Hi Andi,&lt;BR /&gt;&lt;BR /&gt;you can simply check the return code of your ping- command:&lt;BR /&gt;&lt;BR /&gt;ping ip_adress 56 1&lt;BR /&gt;&lt;BR /&gt;if test $? -eq 0&lt;BR /&gt;then&lt;BR /&gt;     :&lt;BR /&gt;else&lt;BR /&gt;     exit 1&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;this should do it for you.&lt;BR /&gt;&lt;BR /&gt;Allways stay on the bright side of life!&lt;BR /&gt;&lt;BR /&gt;Peter&lt;BR /&gt;</description>
      <pubDate>Wed, 17 Jul 2002 09:08:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-and-ping/m-p/2765779#M895323</guid>
      <dc:creator>Peter Kloetgen</dc:creator>
      <dc:date>2002-07-17T09:08:49Z</dc:date>
    </item>
    <item>
      <title>Re: scripting and ping</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-and-ping/m-p/2765780#M895324</link>
      <description>Andi&lt;BR /&gt;&lt;BR /&gt;host_name=hosts &lt;BR /&gt;for host in $(cat $host_name) &lt;BR /&gt;do &lt;BR /&gt;/etc/ping $host -n 1 | grep -q '1 packets received' &lt;BR /&gt;if [ $? = 0 ] &lt;BR /&gt;then &lt;BR /&gt;echo "$host" &amp;gt;&amp;gt; /success &lt;BR /&gt;else &lt;BR /&gt;echo "$host" &amp;gt;&amp;gt; /failure &lt;BR /&gt;fi &lt;BR /&gt;done &lt;BR /&gt;&lt;BR /&gt;Your variable host_name contains the host names in the file hosts that you wish to ping&lt;BR /&gt;&lt;BR /&gt;grep -q - waits for the return of 1 packet received then goes to the next host in the file&lt;BR /&gt;&lt;BR /&gt;$? is the return value &lt;BR /&gt;&lt;BR /&gt;0 = succesful ping&lt;BR /&gt;1 = unsuccesful ping&lt;BR /&gt;&lt;BR /&gt;HTH &lt;BR /&gt;&lt;BR /&gt;Steve</description>
      <pubDate>Wed, 17 Jul 2002 09:24:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-and-ping/m-p/2765780#M895324</guid>
      <dc:creator>steven Burgess_2</dc:creator>
      <dc:date>2002-07-17T09:24:27Z</dc:date>
    </item>
    <item>
      <title>Re: scripting and ping</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-and-ping/m-p/2765781#M895325</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;  it is of course a personal matter which  solution you prefer. The attached script checks on "100% package loss" in the ping attempt.&lt;BR /&gt;  In case the attached script is used for pinging more than a single machine, it is important to delete the file to which the output of the ping command is redirected: you have to make sure that the content of this file actually comes from the machine you ping.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;&lt;BR /&gt;John K. &lt;BR /&gt;</description>
      <pubDate>Wed, 17 Jul 2002 09:56:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-and-ping/m-p/2765781#M895325</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2002-07-17T09:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: scripting and ping</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-and-ping/m-p/2765782#M895329</link>
      <description>Thanks a lot for your answers,&lt;BR /&gt;but This I allready knew, the thing I wanted to know is how I can set a timeout for a ping.&lt;BR /&gt;let's say it should try it for 1 second and if the ping does not come back the return value should be 1.</description>
      <pubDate>Wed, 17 Jul 2002 10:22:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-and-ping/m-p/2765782#M895329</guid>
      <dc:creator>Andi Rigauer</dc:creator>
      <dc:date>2002-07-17T10:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: scripting and ping</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-and-ping/m-p/2765783#M895330</link>
      <description>ping has no timeout parameters so if you would like tot do something like that you should use something like 'time' in a script to run together with the other scripting effectively sending a SIGKILL od SIGHUPP tot he process of ping to stop it of it exceeds the given time ....</description>
      <pubDate>Wed, 17 Jul 2002 10:59:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-and-ping/m-p/2765783#M895330</guid>
      <dc:creator>sven verhaegen</dc:creator>
      <dc:date>2002-07-17T10:59:41Z</dc:date>
    </item>
    <item>
      <title>Re: scripting and ping</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-and-ping/m-p/2765784#M895331</link>
      <description>Unlike AIX and other unices, HP-UX's ping does not have a flag to specify wait time. According the man page, the default wait is 1 second.&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;mark</description>
      <pubDate>Wed, 17 Jul 2002 12:24:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-and-ping/m-p/2765784#M895331</guid>
      <dc:creator>Mark Greene_1</dc:creator>
      <dc:date>2002-07-17T12:24:41Z</dc:date>
    </item>
    <item>
      <title>Re: scripting and ping</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-and-ping/m-p/2765785#M895332</link>
      <description>Here is one method that addresses all your concerns:&lt;BR /&gt;&lt;BR /&gt;This will timeout after 5 seconds; silently returns 0 if ok&lt;BR /&gt;ping.pl -t 5 remotehost&lt;BR /&gt;STAT=$?&lt;BR /&gt;if [ ${STAT} -eq 0 ]&lt;BR /&gt;then&lt;BR /&gt;  echo "Ping ok"&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;ping.pl -u will display full usage.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 17 Jul 2002 12:35:17 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-and-ping/m-p/2765785#M895332</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-07-17T12:35:17Z</dc:date>
    </item>
    <item>
      <title>Re: scripting and ping</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-and-ping/m-p/2765786#M895333</link>
      <description>Hi Andi&lt;BR /&gt;&lt;BR /&gt;I've tried it &lt;BR /&gt;ping IP -n1&lt;BR /&gt;will break after some time if the IP is not pingalbe. So I'd suggest to grep for the line package loss and check if it is 0% or 100%?&lt;BR /&gt;&lt;BR /&gt;ping sensles_ip -n 1 |grep "packet loss" |awk '{print $7}' |cut -f1 -d"%"&lt;BR /&gt;&lt;BR /&gt;will answer with 100&lt;BR /&gt;&lt;BR /&gt;ping reachable_ip -n 1 |grep "packet loss" |awk '{print $7}' |cut -f1 -d"%"&lt;BR /&gt;&lt;BR /&gt;will give you 0&lt;BR /&gt;&lt;BR /&gt;You could then compare the result with an if statement.&lt;BR /&gt;&lt;BR /&gt;What do you think.&lt;BR /&gt;HTH&lt;BR /&gt;Rainer&lt;BR /&gt;</description>
      <pubDate>Thu, 18 Jul 2002 07:50:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-and-ping/m-p/2765786#M895333</guid>
      <dc:creator>rainer doelker</dc:creator>
      <dc:date>2002-07-18T07:50:47Z</dc:date>
    </item>
    <item>
      <title>Re: scripting and ping</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-and-ping/m-p/2765787#M895334</link>
      <description>I find that a single ping is quite unreliable.  I use three or more packets with something along the lines of:&lt;BR /&gt;&lt;BR /&gt;/usr/sbin/ping x.x.x.x -n 3 | /usr/bin/grep "100% packet loss" &amp;gt; /dev/null &amp;amp;&amp;amp; echo Down! || echo Up!</description>
      <pubDate>Thu, 18 Jul 2002 20:06:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-and-ping/m-p/2765787#M895334</guid>
      <dc:creator>A. Daniel King_1</dc:creator>
      <dc:date>2002-07-18T20:06:46Z</dc:date>
    </item>
    <item>
      <title>Re: scripting and ping</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/scripting-and-ping/m-p/2765788#M895335</link>
      <description>Also check this link&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://bizforums.itrc.hp.com/cm/QuestionAnswer/0,,0xe7627d4cf554d611abdb0090277a778c,00.html" target="_blank"&gt;http://bizforums.itrc.hp.com/cm/QuestionAnswer/0,,0xe7627d4cf554d611abdb0090277a778c,00.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks</description>
      <pubDate>Thu, 18 Jul 2002 20:40:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/scripting-and-ping/m-p/2765788#M895335</guid>
      <dc:creator>T G Manikandan</dc:creator>
      <dc:date>2002-07-18T20:40:11Z</dc:date>
    </item>
  </channel>
</rss>

