<?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/3446498#M851973</link>
    <description>I would look at a utility called fping.&lt;BR /&gt;&lt;BR /&gt;Far more flexible then just ping.&lt;BR /&gt;Software can be found here &lt;A href="http://hpux.cs.utah.edu/" target="_blank"&gt;http://hpux.cs.utah.edu/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Something we use to check routers, switches and servers.&lt;BR /&gt;&lt;BR /&gt;Basic script&lt;BR /&gt;/opt/fping/sbin/fping -u -f {file of hosts} &amp;gt; /tmp/ping_errors&lt;BR /&gt;&lt;BR /&gt;VAR=`cat /tmp/ping_errors |wc -l`&lt;BR /&gt;if [ $VAR -gt 1 ]&lt;BR /&gt;then&lt;BR /&gt;mailx -s "ping Alert" pager@myairmail.com &amp;lt; /tmp/ping_errors&lt;BR /&gt;&lt;BR /&gt;else&lt;BR /&gt;echo "Everything on line" &amp;gt; /tmp/ping_errors&lt;BR /&gt;</description>
    <pubDate>Mon, 20 Dec 2004 07:21:50 GMT</pubDate>
    <dc:creator>J Busch</dc:creator>
    <dc:date>2004-12-20T07:21:50Z</dc:date>
    <item>
      <title>Ping Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ping-script/m-p/3446496#M851971</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;I have a list of IP addresses. All I want is to ping the each and every IP address from the list/file and should able to send me an SMS message/email in case of ping failure. &lt;BR /&gt;&lt;BR /&gt;Could you please let me know the script for this.&lt;BR /&gt;&lt;BR /&gt;"ping &lt;HOSTNAME&gt; -n 4"&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Nikee&lt;/HOSTNAME&gt;</description>
      <pubDate>Sat, 18 Dec 2004 12:32:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ping-script/m-p/3446496#M851971</guid>
      <dc:creator>Nikee Reddy</dc:creator>
      <dc:date>2004-12-18T12:32:28Z</dc:date>
    </item>
    <item>
      <title>Re: Ping Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ping-script/m-p/3446497#M851972</link>
      <description>The script could look something like this:&lt;BR /&gt;&lt;BR /&gt;IP_LIST="192.168.0.1 192.168.0.2 192.168.0.3"&lt;BR /&gt;for ip in $IP_LIST&lt;BR /&gt;do&lt;BR /&gt;  ping $ip -n 1 | grep -q "100% packet loss"&lt;BR /&gt;  if [ $? -eq 0 ]&lt;BR /&gt;  then&lt;BR /&gt;     mailx -s "Can't ping $ip" mail@company.com&lt;BR /&gt;  fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;Ofcourse, you need to test the above script and &lt;BR /&gt;check for syntax errors as I did not run it on an &lt;BR /&gt;actual machine. Note that you could use hostname&lt;BR /&gt;instead of IP address in the IP_LIST, but make &lt;BR /&gt;sure that nslookup on the hostname returns&lt;BR /&gt;success; otherwise the above script will return &lt;BR /&gt;ping success for non-existing hostnames. Handling&lt;BR /&gt;non-existing hostname should be the enhancement&lt;BR /&gt;to this script.&lt;BR /&gt;&lt;BR /&gt;- Biswajit&lt;BR /&gt;</description>
      <pubDate>Sat, 18 Dec 2004 14:48:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ping-script/m-p/3446497#M851972</guid>
      <dc:creator>Biswajit Tripathy</dc:creator>
      <dc:date>2004-12-18T14:48:23Z</dc:date>
    </item>
    <item>
      <title>Re: Ping Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ping-script/m-p/3446498#M851973</link>
      <description>I would look at a utility called fping.&lt;BR /&gt;&lt;BR /&gt;Far more flexible then just ping.&lt;BR /&gt;Software can be found here &lt;A href="http://hpux.cs.utah.edu/" target="_blank"&gt;http://hpux.cs.utah.edu/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Something we use to check routers, switches and servers.&lt;BR /&gt;&lt;BR /&gt;Basic script&lt;BR /&gt;/opt/fping/sbin/fping -u -f {file of hosts} &amp;gt; /tmp/ping_errors&lt;BR /&gt;&lt;BR /&gt;VAR=`cat /tmp/ping_errors |wc -l`&lt;BR /&gt;if [ $VAR -gt 1 ]&lt;BR /&gt;then&lt;BR /&gt;mailx -s "ping Alert" pager@myairmail.com &amp;lt; /tmp/ping_errors&lt;BR /&gt;&lt;BR /&gt;else&lt;BR /&gt;echo "Everything on line" &amp;gt; /tmp/ping_errors&lt;BR /&gt;</description>
      <pubDate>Mon, 20 Dec 2004 07:21:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ping-script/m-p/3446498#M851973</guid>
      <dc:creator>J Busch</dc:creator>
      <dc:date>2004-12-20T07:21:50Z</dc:date>
    </item>
    <item>
      <title>Re: Ping Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ping-script/m-p/3446499#M851974</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I have attached you a small example, using Net:Ping &lt;BR /&gt;and two hosts to ping.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards,Stan</description>
      <pubDate>Mon, 20 Dec 2004 08:38:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ping-script/m-p/3446499#M851974</guid>
      <dc:creator>Stanimir</dc:creator>
      <dc:date>2004-12-20T08:38:57Z</dc:date>
    </item>
    <item>
      <title>Re: Ping Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/ping-script/m-p/3446500#M851975</link>
      <description>Hi Nikee,&lt;BR /&gt; &lt;BR /&gt;the Net::Ping module that Stanimir mentioned is well worth noting.&lt;BR /&gt;Other than scripts that use the system ping command that use ICMP packages and thus require root privileges (have a look at the setuid bit of /usr/sbin/ping) the Net::Ping is much more flexible.&lt;BR /&gt;Therefore I would rather chose TCP or UDP (the default of net::Ping) for transport.&lt;BR /&gt;Just specify the transport as an argument in the constructor call.&lt;BR /&gt;We for instance have many hosts in firewalled LANs, and the firewalls silently drop everything that isn't 22/tcp (and other required services like Domain, NTP etc.)&lt;BR /&gt;So there's never an echo reply on an ICMP echo request.&lt;BR /&gt;With Net::Ping you can specify the SSH port 22 and chose TCP as transport, and can "ping" all those hosts (together with a control that an sshd is responding.&lt;BR /&gt;If you require more sophistication to "Fool" your firewalls then I'd suggest to use nmap&lt;BR /&gt;(&lt;A href="http://www.insecure.org/nmap/)" target="_blank"&gt;http://www.insecure.org/nmap/)&lt;/A&gt;&lt;BR /&gt;It lets you chose all sorts of handshakes or only send SYN packets.&lt;BR /&gt;See its manpage for details.</description>
      <pubDate>Mon, 20 Dec 2004 09:03:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/ping-script/m-p/3446500#M851975</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2004-12-20T09:03:45Z</dc:date>
    </item>
  </channel>
</rss>

