<?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 return code on 11.i in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/ping-return-code-on-11-i/m-p/4865549#M558162</link>
    <description>Hi Nicolas,&lt;BR /&gt;&lt;BR /&gt;Yes. Your question was very well understood. The solution is the patch we mentioned. See for ex.,&lt;BR /&gt;&lt;BR /&gt;$ /etc/ping bla -n 1&lt;BR /&gt;/etc/ping: unknown host bla&lt;BR /&gt;$ echo $?&lt;BR /&gt;1&lt;BR /&gt;$ /etc/ping somehost -n 1&lt;BR /&gt;PING somehost.mydomain.com: 64 byte packets&lt;BR /&gt;&lt;BR /&gt;----somehost.mydomain.com PING Statistics----&lt;BR /&gt;1 packets transmitted, 0 packets received, 100% packet loss&lt;BR /&gt;$ echo $?&lt;BR /&gt;2&lt;BR /&gt;$ /etc/ping goodhost -n 1&lt;BR /&gt;PING goodhost.mydomain.com: 64 byte packets&lt;BR /&gt;64 bytes from xx.xx.xx.xx: icmp_seq=0. time=1. ms&lt;BR /&gt;&lt;BR /&gt;---- goodhost.mydomain.com PING Statistics----&lt;BR /&gt;1 packets transmitted, 1 packets received, 0% packet loss&lt;BR /&gt;round-trip (ms)  min/avg/max = 1/1/1&lt;BR /&gt;$ echo $?&lt;BR /&gt;0&lt;BR /&gt;$&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
    <pubDate>Fri, 15 Oct 2004 11:50:11 GMT</pubDate>
    <dc:creator>Sridhar Bhaskarla</dc:creator>
    <dc:date>2004-10-15T11:50:11Z</dc:date>
    <item>
      <title>ping return code on 11.i</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ping-return-code-on-11-i/m-p/4865543#M558156</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I'm writing a monitoring script and I need the return code of a ping. The problem is, ping always returns 0 wether it's successfull or not! I found a patch that fixes this on a hp-ux 10.20 system: PHNE_24260. Now I need a similar patch on an 11.i system. I couldn't find anything on the table of equivalency. Has anybody found a solution for this?&lt;BR /&gt;</description>
      <pubDate>Fri, 15 Oct 2004 10:31:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ping-return-code-on-11-i/m-p/4865543#M558156</guid>
      <dc:creator>Nicolas_17</dc:creator>
      <dc:date>2004-10-15T10:31:45Z</dc:date>
    </item>
    <item>
      <title>Re: ping return code on 11.i</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ping-return-code-on-11-i/m-p/4865544#M558157</link>
      <description>This was the problem in 10.20 but 11, 11i already has fix to this and no need to have any patches.&lt;BR /&gt;&lt;BR /&gt;man ping will show you the return code details in 11i&lt;BR /&gt;&lt;BR /&gt;-USA..</description>
      <pubDate>Fri, 15 Oct 2004 10:39:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ping-return-code-on-11-i/m-p/4865544#M558157</guid>
      <dc:creator>Uday_S_Ankolekar</dc:creator>
      <dc:date>2004-10-15T10:39:19Z</dc:date>
    </item>
    <item>
      <title>Re: ping return code on 11.i</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ping-return-code-on-11-i/m-p/4865545#M558158</link>
      <description>Hi Nicolas,&lt;BR /&gt;&lt;BR /&gt;I think path PHNE_27382 on 11i fixes that problem. the latest patch in that category is PHNE_31247.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www1.itrc.hp.com/service/patch/patchDetail.do?BC=patch.breadcrumb.main" target="_blank"&gt;http://www1.itrc.hp.com/service/patch/patchDetail.do?BC=patch.breadcrumb.main&lt;/A&gt;|patch.breadcrumb.pdb|patch.breadcrumb.search|&amp;amp;patchid=PHNE_31247&amp;amp;context=hpux:800:11:11&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;&lt;BR /&gt;Regds&lt;BR /&gt;</description>
      <pubDate>Fri, 15 Oct 2004 10:39:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ping-return-code-on-11-i/m-p/4865545#M558158</guid>
      <dc:creator>Sanjay_6</dc:creator>
      <dc:date>2004-10-15T10:39:44Z</dc:date>
    </item>
    <item>
      <title>Re: ping return code on 11.i</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ping-return-code-on-11-i/m-p/4865546#M558159</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;My 11i does return various codes for various failures. My system is upto June 2004 level.&lt;BR /&gt;&lt;BR /&gt;I believe the patch PHNE_27382 fixes it. I would see if there is any superceding patch to it and the dependencies.&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Fri, 15 Oct 2004 10:39:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ping-return-code-on-11-i/m-p/4865546#M558159</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2004-10-15T10:39:55Z</dc:date>
    </item>
    <item>
      <title>Re: ping return code on 11.i</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ping-return-code-on-11-i/m-p/4865547#M558160</link>
      <description>Actually, it's a bit more complicated. ping by default runs forever until signaled or if -n was specified, for that many tries. Since there is only one number returned, if 5 pings were sent, to which ping response should the return code apply? Or if 33% of the packets failed, should the return code be 33? The return codes are listed at the bottom of the man page and are for failures to get the IPaddress resolved or unrechable network (subnet error), etc. If the remote end does not respond, this is not part of the return code.&lt;BR /&gt; &lt;BR /&gt;So you'll have to code the ping test to use a single test (-n 1) and I would also add the -m option to force a timneout, especially if several hosts are being tested in a script. NOTE: The ping options are quite position sensitive! -I and -v come before the hostname/IP, followed by -n and -m must be preceeded by -n first.&lt;BR /&gt;</description>
      <pubDate>Fri, 15 Oct 2004 11:37:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ping-return-code-on-11-i/m-p/4865547#M558160</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2004-10-15T11:37:50Z</dc:date>
    </item>
    <item>
      <title>Re: ping return code on 11.i</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ping-return-code-on-11-i/m-p/4865548#M558161</link>
      <description>ok, I wasn't clear on what i meant about return codes. Ping does return a 0 if it succeeds and a 1 if it fails because it doesn't know the host I'm trying to reach. &lt;BR /&gt;&lt;BR /&gt;But it returns 0 if the host exists in the /etc/hosts, even if it can't reach it. That's my problem.&lt;BR /&gt;&lt;BR /&gt;example: &lt;BR /&gt;&lt;BR /&gt;server:/# ping localhost -n 2&lt;BR /&gt;PING localhost: 64 byte packets&lt;BR /&gt;64 bytes from 127.0.0.1: icmp_seq=0. time=0. ms&lt;BR /&gt;64 bytes from 127.0.0.1: icmp_seq=1. time=0. ms&lt;BR /&gt;&lt;BR /&gt;----localhost PING Statistics----&lt;BR /&gt;2 packets transmitted, 2 packets received, 0% packet loss&lt;BR /&gt;round-trip (ms)  min/avg/max = 0/0/0&lt;BR /&gt;&lt;BR /&gt;server:/# echo $?&lt;BR /&gt;0&lt;BR /&gt;&lt;BR /&gt;Now if i try to ping an address that localhost knows but can't reach for unknown/irrelevant reasons:&lt;BR /&gt;&lt;BR /&gt;server:/# ping whatever.hell.ca -n 2&lt;BR /&gt;PING whatever.hell.ca: 64 byte packets&lt;BR /&gt;&lt;BR /&gt;----whatever.hell.ca PING Statistics----&lt;BR /&gt;2 packets transmitted, 0 packets received, 100% packet loss&lt;BR /&gt;&lt;BR /&gt;server:/# echo $?&lt;BR /&gt;0&lt;BR /&gt;&lt;BR /&gt;Notice the 0 again.&lt;BR /&gt;&lt;BR /&gt;The reason i brought this to the forums is that i don't have that problem on linux. I'm transforming a script that works on a linux box so it can work on hp-ux. That's all.&lt;BR /&gt;&lt;BR /&gt;Thanks for your help guys.</description>
      <pubDate>Fri, 15 Oct 2004 11:40:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ping-return-code-on-11-i/m-p/4865548#M558161</guid>
      <dc:creator>Nicolas_17</dc:creator>
      <dc:date>2004-10-15T11:40:46Z</dc:date>
    </item>
    <item>
      <title>Re: ping return code on 11.i</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ping-return-code-on-11-i/m-p/4865549#M558162</link>
      <description>Hi Nicolas,&lt;BR /&gt;&lt;BR /&gt;Yes. Your question was very well understood. The solution is the patch we mentioned. See for ex.,&lt;BR /&gt;&lt;BR /&gt;$ /etc/ping bla -n 1&lt;BR /&gt;/etc/ping: unknown host bla&lt;BR /&gt;$ echo $?&lt;BR /&gt;1&lt;BR /&gt;$ /etc/ping somehost -n 1&lt;BR /&gt;PING somehost.mydomain.com: 64 byte packets&lt;BR /&gt;&lt;BR /&gt;----somehost.mydomain.com PING Statistics----&lt;BR /&gt;1 packets transmitted, 0 packets received, 100% packet loss&lt;BR /&gt;$ echo $?&lt;BR /&gt;2&lt;BR /&gt;$ /etc/ping goodhost -n 1&lt;BR /&gt;PING goodhost.mydomain.com: 64 byte packets&lt;BR /&gt;64 bytes from xx.xx.xx.xx: icmp_seq=0. time=1. ms&lt;BR /&gt;&lt;BR /&gt;---- goodhost.mydomain.com PING Statistics----&lt;BR /&gt;1 packets transmitted, 1 packets received, 0% packet loss&lt;BR /&gt;round-trip (ms)  min/avg/max = 1/1/1&lt;BR /&gt;$ echo $?&lt;BR /&gt;0&lt;BR /&gt;$&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Fri, 15 Oct 2004 11:50:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ping-return-code-on-11-i/m-p/4865549#M558162</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2004-10-15T11:50:11Z</dc:date>
    </item>
    <item>
      <title>Re: ping return code on 11.i</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ping-return-code-on-11-i/m-p/4865550#M558163</link>
      <description>I see! so i guess i have an old version of ping. But that patch is serious stuff. I don't think it's worth it...just for this ping issue i mean. Anyways, i fixed my script in the meantime to work around the problem.</description>
      <pubDate>Fri, 15 Oct 2004 12:01:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ping-return-code-on-11-i/m-p/4865550#M558163</guid>
      <dc:creator>Nicolas_17</dc:creator>
      <dc:date>2004-10-15T12:01:10Z</dc:date>
    </item>
    <item>
      <title>Re: ping return code on 11.i</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ping-return-code-on-11-i/m-p/4865551#M558164</link>
      <description>No reason the keep this thread alive...</description>
      <pubDate>Mon, 26 Sep 2005 09:29:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ping-return-code-on-11-i/m-p/4865551#M558164</guid>
      <dc:creator>Nicolas_17</dc:creator>
      <dc:date>2005-09-26T09:29:37Z</dc:date>
    </item>
  </channel>
</rss>

