<?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 script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/ping-script/m-p/2792710#M80173</link>
    <description>Hi Allan,&lt;BR /&gt;&lt;BR /&gt;Actually, down hosts are why you use the "-n" option.  On my 11.0 servers, "ping down_host -n 1" will return (timeout) after 11 seconds.  "-n 3" returns after 13 seconds.&lt;BR /&gt;&lt;BR /&gt;Darrell</description>
    <pubDate>Fri, 23 Aug 2002 18:39:03 GMT</pubDate>
    <dc:creator>Darrell Allen</dc:creator>
    <dc:date>2002-08-23T18:39:03Z</dc:date>
    <item>
      <title>ping script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ping-script/m-p/2792700#M80163</link>
      <description>Hey all,&lt;BR /&gt;&lt;BR /&gt;I would like to write a script that would ping multiple servers. Any help is greatly appreciated. POints will be assigned.</description>
      <pubDate>Fri, 23 Aug 2002 11:03:16 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ping-script/m-p/2792700#M80163</guid>
      <dc:creator>Ragni Singh</dc:creator>
      <dc:date>2002-08-23T11:03:16Z</dc:date>
    </item>
    <item>
      <title>Re: ping script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ping-script/m-p/2792701#M80164</link>
      <description>#!/bin/sh&lt;BR /&gt;&lt;BR /&gt;for server in serv1 serv2 serv3&lt;BR /&gt;do&lt;BR /&gt;        /etc/ping $server -n 3 &amp;gt; $server.ping&lt;BR /&gt;done&lt;BR /&gt;grep -l "100% packet loss" *.ping | cut -d"." -f1&lt;BR /&gt;&lt;BR /&gt;this will give you the list of server you cannot ping&lt;BR /&gt;&lt;BR /&gt;Jean-Luc</description>
      <pubDate>Fri, 23 Aug 2002 11:14:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ping-script/m-p/2792701#M80164</guid>
      <dc:creator>Jean-Luc Oudart</dc:creator>
      <dc:date>2002-08-23T11:14:39Z</dc:date>
    </item>
    <item>
      <title>Re: ping script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ping-script/m-p/2792702#M80165</link>
      <description>I want to ping to 2 IP addresses, and display the output to the screen my ping result. Any help is greatly appreciated.</description>
      <pubDate>Fri, 23 Aug 2002 11:21:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ping-script/m-p/2792702#M80165</guid>
      <dc:creator>Ragni Singh</dc:creator>
      <dc:date>2002-08-23T11:21:03Z</dc:date>
    </item>
    <item>
      <title>Re: ping script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ping-script/m-p/2792703#M80166</link>
      <description>echo " vpart1 \n vpart2 \n vpart3 \n vpart4" | xargs -i ping {} -n 1&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;So if you have your hosts in a file as a list, then&lt;BR /&gt;&lt;BR /&gt;cat THATFILE | xargs -i ping {} -n 1&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Fri, 23 Aug 2002 11:25:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ping-script/m-p/2792703#M80166</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-08-23T11:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: ping script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ping-script/m-p/2792704#M80167</link>
      <description>How about this&lt;BR /&gt;&lt;BR /&gt;for server in server1 server2&lt;BR /&gt;do&lt;BR /&gt;/etc/ping $server -n 3&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Hilary&lt;BR /&gt;</description>
      <pubDate>Fri, 23 Aug 2002 11:26:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ping-script/m-p/2792704#M80167</guid>
      <dc:creator>BFA6</dc:creator>
      <dc:date>2002-08-23T11:26:20Z</dc:date>
    </item>
    <item>
      <title>Re: ping script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ping-script/m-p/2792705#M80168</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Just a suggestion in addition to the good answers already given...&lt;BR /&gt;&lt;BR /&gt;I'd go with "-n 3" to ping each server 3 times instead of just once.  The script I wrote to ping remote locations would often give false failures when only sending 1 packet.  I don't know the last time I had a false failure since I changed to send 3 packets.&lt;BR /&gt;&lt;BR /&gt;It only takes 2 more seconds per location to send 3 packets than to send 1 even if there is no response.&lt;BR /&gt;&lt;BR /&gt;Darrell</description>
      <pubDate>Fri, 23 Aug 2002 11:36:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ping-script/m-p/2792705#M80168</guid>
      <dc:creator>Darrell Allen</dc:creator>
      <dc:date>2002-08-23T11:36:58Z</dc:date>
    </item>
    <item>
      <title>Re: ping script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ping-script/m-p/2792706#M80169</link>
      <description>Darrell,&lt;BR /&gt;&lt;BR /&gt;Very GOOD point!&lt;BR /&gt;&lt;BR /&gt;live free or die&lt;BR /&gt;harry</description>
      <pubDate>Fri, 23 Aug 2002 12:15:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ping-script/m-p/2792706#M80169</guid>
      <dc:creator>harry d brown jr</dc:creator>
      <dc:date>2002-08-23T12:15:06Z</dc:date>
    </item>
    <item>
      <title>Re: ping script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ping-script/m-p/2792707#M80170</link>
      <description>Warning: icmp needs root permissions&lt;BR /&gt;&lt;BR /&gt;Here's an example in perl&lt;BR /&gt;&lt;BR /&gt;l1:/tmp 103 # cat xx&lt;BR /&gt;#!/pro/bin/perl -w&lt;BR /&gt;&lt;BR /&gt;use Net::Ping;&lt;BR /&gt;&lt;BR /&gt;my $icmp = Net::Ping-&amp;gt;new ("icmp", 1);&lt;BR /&gt;my $tcp  = Net::Ping-&amp;gt;new ("tcp",  1);&lt;BR /&gt;my $udp  = Net::Ping-&amp;gt;new ("udp",  1);&lt;BR /&gt;&lt;BR /&gt;my @hosts = qw(&lt;BR /&gt;    l1&lt;BR /&gt;    pc09&lt;BR /&gt;    127.0.0.1&lt;BR /&gt;    );&lt;BR /&gt;&lt;BR /&gt;my %inet;&lt;BR /&gt;for my $ip (@hosts) {&lt;BR /&gt;    $icmp-&amp;gt;ping ($ip) and $inet{$ip}{icmp} = 1;&lt;BR /&gt;    $tcp-&amp;gt;ping  ($ip) and $inet{$ip}{tcp}  = 1;&lt;BR /&gt;    $udp-&amp;gt;ping  ($ip) and $inet{$ip}{udp}  = 1;&lt;BR /&gt;    }&lt;BR /&gt;$icmp-&amp;gt;close;&lt;BR /&gt;$udp-&amp;gt;close;&lt;BR /&gt;$tcp-&amp;gt;close;&lt;BR /&gt;&lt;BR /&gt;print "IP address      ICMP   TCP    UDP\n",&lt;BR /&gt;      "-------------- -----  -----  -----\n";&lt;BR /&gt;for my $ip (@hosts) {&lt;BR /&gt;    exists $inet{$ip} or next;&lt;BR /&gt;    my %p = %{$inet{$ip}};&lt;BR /&gt;    printf "%-14s%6s %6s %6s\n", $ip,&lt;BR /&gt;        $p{icmp} ? "alive" : "-  ",&lt;BR /&gt;        $p{tcp}  ? "alive" : "-  ",&lt;BR /&gt;        $p{udp}  ? "alive" : "-  ";&lt;BR /&gt;    }&lt;BR /&gt;l1:/tmp 104 # perl xx&lt;BR /&gt;IP address      ICMP   TCP    UDP&lt;BR /&gt;-------------- -----  -----  -----&lt;BR /&gt;l1             alive  alive  alive&lt;BR /&gt;pc09           alive  alive  alive&lt;BR /&gt;127.0.0.1      alive  alive  alive&lt;BR /&gt;l1:/tmp 105 #&lt;BR /&gt;</description>
      <pubDate>Fri, 23 Aug 2002 12:37:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ping-script/m-p/2792707#M80170</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2002-08-23T12:37:35Z</dc:date>
    </item>
    <item>
      <title>Re: ping script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ping-script/m-p/2792708#M80171</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I read all these responses, but it seems that everyone has assumed that these server are all WORKING.  If you try and automate this, and a server is down, ping will hang.  I looked at the man pages, and don't see a timeout option.  Maybe someone knows....&lt;BR /&gt;&lt;BR /&gt;...continuing, you have another option:&lt;BR /&gt;&lt;BR /&gt;Let's suppose your on a class C network 11.40.1.xx (same applies for A and B).  You can ping the broadcast address (assume 255)(this might be a bad idea in your environment, but in mine, this isn't a problem).&lt;BR /&gt;&lt;BR /&gt;For example, &lt;BR /&gt;&lt;BR /&gt;/etc/ping 11.40.1.255 -n N &amp;gt; /tmp/myPingFile&lt;BR /&gt;&lt;BR /&gt;Where "N" is larger than the largest number of hosts on your network.  (If you have a large network you may not want to do this).&lt;BR /&gt;&lt;BR /&gt;Any hosts that are down won't echo back.  Then you can read myPingFile, grep out the IP address into nslookup to see what hosts are alive.&lt;BR /&gt;&lt;BR /&gt;Then you can compare this long list to your short list with another grep or something.&lt;BR /&gt;&lt;BR /&gt;Anyway, ping is not a very friendly tool if you don't get a directed response back.&lt;BR /&gt;&lt;BR /&gt;I tend to think about what can go wrong, too!&lt;BR /&gt;&lt;BR /&gt;Good luck!!&lt;BR /&gt;&lt;BR /&gt;- Allan&lt;BR /&gt;</description>
      <pubDate>Fri, 23 Aug 2002 17:19:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ping-script/m-p/2792708#M80171</guid>
      <dc:creator>Allan Pincus</dc:creator>
      <dc:date>2002-08-23T17:19:51Z</dc:date>
    </item>
    <item>
      <title>Re: ping script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ping-script/m-p/2792709#M80172</link>
      <description>Well, if you are concerned about timeouts then the attached perl script, ping.pl addresses that.&lt;BR /&gt;&lt;BR /&gt;ping.pl -t 5 remote_host&lt;BR /&gt;STAT=${?}&lt;BR /&gt;if [[ ${STAT} -eq 0 ]]&lt;BR /&gt;  then&lt;BR /&gt;    echo "Host ok"&lt;BR /&gt;  else&lt;BR /&gt;    echo "Host Bad"&lt;BR /&gt;  fi&lt;BR /&gt;&lt;BR /&gt;and a timeout of 5 seconds is set.&lt;BR /&gt;&lt;BR /&gt;Invoke it as ping.pl -u for full usage.&lt;BR /&gt;</description>
      <pubDate>Fri, 23 Aug 2002 17:25:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ping-script/m-p/2792709#M80172</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-08-23T17:25:15Z</dc:date>
    </item>
    <item>
      <title>Re: ping script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ping-script/m-p/2792710#M80173</link>
      <description>Hi Allan,&lt;BR /&gt;&lt;BR /&gt;Actually, down hosts are why you use the "-n" option.  On my 11.0 servers, "ping down_host -n 1" will return (timeout) after 11 seconds.  "-n 3" returns after 13 seconds.&lt;BR /&gt;&lt;BR /&gt;Darrell</description>
      <pubDate>Fri, 23 Aug 2002 18:39:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ping-script/m-p/2792710#M80173</guid>
      <dc:creator>Darrell Allen</dc:creator>
      <dc:date>2002-08-23T18:39:03Z</dc:date>
    </item>
    <item>
      <title>Re: ping script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ping-script/m-p/2792711#M80174</link>
      <description>Darrell -&lt;BR /&gt;&lt;BR /&gt;Yeah, I see that.  If you have a bunch of hosts, that are down, this would still stink...&lt;BR /&gt;&lt;BR /&gt;- Allan</description>
      <pubDate>Fri, 23 Aug 2002 18:46:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ping-script/m-p/2792711#M80174</guid>
      <dc:creator>Allan Pincus</dc:creator>
      <dc:date>2002-08-23T18:46:19Z</dc:date>
    </item>
    <item>
      <title>Re: ping script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ping-script/m-p/2792712#M80175</link>
      <description>Hi,&lt;BR /&gt;Here you go here is the script:&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh &lt;BR /&gt;LANG=C &lt;BR /&gt;HOSTNAME_FILE=iphosts&lt;BR /&gt;for host in $(cat $HOSTNAME_FILE) &lt;BR /&gt;do &lt;BR /&gt;ping $host -n 1 | grep -q '1 packets received' &lt;BR /&gt;if [ $? = 0 ] &lt;BR /&gt;then &lt;BR /&gt;echo "$host: OK" &lt;BR /&gt;else &lt;BR /&gt;echo "$host: FAIL" &lt;BR /&gt;fi &lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;and here is how it works ..&lt;BR /&gt;iphosts is a file that has the list of hostnames or ip address like so &lt;BR /&gt;&lt;BR /&gt;host1&lt;BR /&gt;host1&lt;BR /&gt;192.168.10.xx&lt;BR /&gt;192.168.10.xx&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;now you run the script and it will check the host and go to the next one you will get the output to the screen. If you modify it a little you can even get the scrip to send you an email&lt;BR /&gt;&lt;BR /&gt;~ Richard&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 23 Aug 2002 18:50:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ping-script/m-p/2792712#M80175</guid>
      <dc:creator>someone_4</dc:creator>
      <dc:date>2002-08-23T18:50:18Z</dc:date>
    </item>
    <item>
      <title>Re: ping script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ping-script/m-p/2792713#M80176</link>
      <description>Just flew over your request: linux' fping seems to be a possible solution:&lt;BR /&gt;- shows if interface is up or down&lt;BR /&gt;- ping with config-file, which you can edit&lt;BR /&gt;etc etc&lt;BR /&gt;&lt;BR /&gt;have a look at it ...&lt;BR /&gt;&lt;BR /&gt;stg</description>
      <pubDate>Tue, 21 Jan 2003 07:10:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ping-script/m-p/2792713#M80176</guid>
      <dc:creator>Stefan_6</dc:creator>
      <dc:date>2003-01-21T07:10:54Z</dc:date>
    </item>
  </channel>
</rss>

