<?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: Script for Network Ping Status. in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-network-ping-status/m-p/5184166#M460422</link>
    <description>Hi Laurent,&lt;BR /&gt;After modification the script as suggested by you. The script is running but even though i am able to ping the servers. It is sending me the mail "10.133.12.6 not responding"&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;# all the system to ping:&lt;BR /&gt;ALLSYSTEM="10.133.12.29 10.133.12.6"&lt;BR /&gt;&lt;BR /&gt;monmail="narendra.uttekar@xxxx.com"&lt;BR /&gt;pingit()&lt;BR /&gt;{&lt;BR /&gt;ping $1 -n 1 -m 1 &amp;gt;/dev/null&lt;BR /&gt;curval=$?&lt;BR /&gt;echo "$1 not responding" |mailx -s "system monitoring: $1 status" $2&lt;BR /&gt;return $curval&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;for i in $ALLSYSTEM&lt;BR /&gt;do&lt;BR /&gt;pingit $i $monmail&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Mon, 29 Jun 2009 12:39:03 GMT</pubDate>
    <dc:creator>Narendra Uttekar</dc:creator>
    <dc:date>2009-06-29T12:39:03Z</dc:date>
    <item>
      <title>Script for Network Ping Status.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-network-ping-status/m-p/5184161#M460417</link>
      <description>Hi,&lt;BR /&gt;I am not good in script writing, Can anyone help me out to write a script for network ping status i.e. i want to ping for 15 servers and if ping replies back with"relpy from server" then i don't want that output to be e-mailed, but if ping replies back with "request timed out" then it should send me and mail for that host unreachable.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Narendra</description>
      <pubDate>Mon, 29 Jun 2009 06:22:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-network-ping-status/m-p/5184161#M460417</guid>
      <dc:creator>Narendra Uttekar</dc:creator>
      <dc:date>2009-06-29T06:22:19Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Network Ping Status.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-network-ping-status/m-p/5184162#M460418</link>
      <description>#!/usr/bin/ksh&lt;BR /&gt;# all the system to ping:&lt;BR /&gt;ALLSYSTEM="192.168.0.1 " \&lt;BR /&gt;          "192.168.0.2 " \&lt;BR /&gt;          "192.168.0.3 "&lt;BR /&gt;&lt;BR /&gt;monmail="myaddress@mystystem"&lt;BR /&gt;pingit()&lt;BR /&gt;{&lt;BR /&gt;  ping $1 -n 1 -m 1 &amp;gt;/dev/null&lt;BR /&gt;  curval=$?&lt;BR /&gt;  echo "$1 not responding" |mailx -s "system monitoring: $1 status" $2&lt;BR /&gt;  return $curval&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;for i in $ALLSYSTEM&lt;BR /&gt;do&lt;BR /&gt;  pingit $i $monmail&lt;BR /&gt;done&lt;BR /&gt;</description>
      <pubDate>Mon, 29 Jun 2009 08:13:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-network-ping-status/m-p/5184162#M460418</guid>
      <dc:creator>Laurent Menase</dc:creator>
      <dc:date>2009-06-29T08:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Network Ping Status.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-network-ping-status/m-p/5184163#M460419</link>
      <description>Hi,&lt;BR /&gt;I tried ur script getting error as below,&lt;BR /&gt;hostname:[/home]# ./pingstatus&lt;BR /&gt;./pingstatus[3]: 10.133.12.6:  not found&lt;BR /&gt;hostname:[/home]# cat pingstatus&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;# all the system to ping:&lt;BR /&gt;ALLSYSTEM="10.133.12.29" \&lt;BR /&gt;"10.133.12.6" \&lt;BR /&gt;"10.133.12.26"&lt;BR /&gt;&lt;BR /&gt;monmail="narendra.uttekar@xxxx.com"&lt;BR /&gt;pingit()&lt;BR /&gt;{&lt;BR /&gt;ping $1 -n 1 -m 1 &amp;gt;/dev/null&lt;BR /&gt;curval=$?&lt;BR /&gt;echo "$1 not responding" |mailx -s "system monitoring: $1 status" $2&lt;BR /&gt;return $curval&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;for i in $ALLSYSTEM&lt;BR /&gt;do&lt;BR /&gt;pingit $i $monmail&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;I also tried with giving space between "10.133.12.6 " \ ,But still result same.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Narendra&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 29 Jun 2009 09:18:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-network-ping-status/m-p/5184163#M460419</guid>
      <dc:creator>Narendra Uttekar</dc:creator>
      <dc:date>2009-06-29T09:18:30Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Network Ping Status.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-network-ping-status/m-p/5184164#M460420</link>
      <description>yes indeed &lt;BR /&gt;it is ALLSYSTEM="sys1 \&lt;BR /&gt;sys2 \&lt;BR /&gt;sys3 \&lt;BR /&gt;sys4"&lt;BR /&gt;&lt;BR /&gt;or ALLSYSTEM="sys1 sys2 sys3 sys4"&lt;BR /&gt;&lt;BR /&gt;when doing ALLSYSTEM="x " \&lt;BR /&gt;"y "&lt;BR /&gt;there is a space between "x " and "y "&lt;BR /&gt;so it tries to execute "y "&lt;BR /&gt;&lt;BR /&gt;when doing&lt;BR /&gt;"x"\&lt;BR /&gt;"y"\&lt;BR /&gt;"z"&lt;BR /&gt;it is like "xyz"&lt;BR /&gt;so the 3 possibilities are&lt;BR /&gt;"x "\&lt;BR /&gt;"y "\&lt;BR /&gt;"z "&lt;BR /&gt;or&lt;BR /&gt;"x \&lt;BR /&gt; y \&lt;BR /&gt; y"&lt;BR /&gt;or "x y z"&lt;BR /&gt;</description>
      <pubDate>Mon, 29 Jun 2009 09:41:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-network-ping-status/m-p/5184164#M460420</guid>
      <dc:creator>Laurent Menase</dc:creator>
      <dc:date>2009-06-29T09:41:04Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Network Ping Status.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-network-ping-status/m-p/5184165#M460421</link>
      <description>Shalom,&lt;BR /&gt;&lt;BR /&gt;A very interesting document on this topic:&lt;BR /&gt;&lt;A href="http://www.docs.hp.com/en/J5683-90002/J5683-90002.pdf" target="_blank"&gt;http://www.docs.hp.com/en/J5683-90002/J5683-90002.pdf&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Also, ping has a timeout feature that you should build into the script to make it more tolerant of temporary network issues.&lt;BR /&gt;&lt;BR /&gt;SEP</description>
      <pubDate>Mon, 29 Jun 2009 10:16:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-network-ping-status/m-p/5184165#M460421</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2009-06-29T10:16:35Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Network Ping Status.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-network-ping-status/m-p/5184166#M460422</link>
      <description>Hi Laurent,&lt;BR /&gt;After modification the script as suggested by you. The script is running but even though i am able to ping the servers. It is sending me the mail "10.133.12.6 not responding"&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;# all the system to ping:&lt;BR /&gt;ALLSYSTEM="10.133.12.29 10.133.12.6"&lt;BR /&gt;&lt;BR /&gt;monmail="narendra.uttekar@xxxx.com"&lt;BR /&gt;pingit()&lt;BR /&gt;{&lt;BR /&gt;ping $1 -n 1 -m 1 &amp;gt;/dev/null&lt;BR /&gt;curval=$?&lt;BR /&gt;echo "$1 not responding" |mailx -s "system monitoring: $1 status" $2&lt;BR /&gt;return $curval&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;for i in $ALLSYSTEM&lt;BR /&gt;do&lt;BR /&gt;pingit $i $monmail&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 29 Jun 2009 12:39:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-network-ping-status/m-p/5184166#M460422</guid>
      <dc:creator>Narendra Uttekar</dc:creator>
      <dc:date>2009-06-29T12:39:03Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Network Ping Status.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-network-ping-status/m-p/5184167#M460423</link>
      <description>Shalom,&lt;BR /&gt;&lt;BR /&gt;This thread may help.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=103638" target="_blank"&gt;http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=103638&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://hpux.connect.org.uk/hppd/hpux/Networking/Misc/ping-99.10/man.html" target="_blank"&gt;http://hpux.connect.org.uk/hppd/hpux/Networking/Misc/ping-99.10/man.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;try adding -t &lt;TIMEOUT&gt; value to your ping.&lt;BR /&gt;&lt;BR /&gt;The default timeout does not give sufficient time for the answer to return to your ping command.&lt;BR /&gt;&lt;BR /&gt;Also, put a set -x in the script and lets get some diagnostic data.&lt;BR /&gt;&lt;BR /&gt;SEP&lt;/TIMEOUT&gt;</description>
      <pubDate>Mon, 29 Jun 2009 12:48:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-network-ping-status/m-p/5184167#M460423</guid>
      <dc:creator>Steven E. Protter</dc:creator>
      <dc:date>2009-06-29T12:48:57Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Network Ping Status.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-network-ping-status/m-p/5184168#M460424</link>
      <description>syslist="10.133.12.29 10.133.12.6"&lt;BR /&gt;notifyemail=narendra.uttekar@xxxx.com&lt;BR /&gt;for server in $syslist&lt;BR /&gt;do&lt;BR /&gt;rand=$RANDOM&lt;BR /&gt;ping $server -n 3 -m 1 &amp;gt; /var/tmp/tempfile.$ran} 2&amp;gt;&amp;amp;1&lt;BR /&gt;grep "100% packet loss" /var/tmp/tempfile.$ran}&lt;BR /&gt;r=${?}&lt;BR /&gt;if [ $r -eq 0 ]&lt;BR /&gt;then&lt;BR /&gt;echo "Server ${server} failed ping test}|mailx -s "Ping Test Status" $notifyemail&lt;BR /&gt;fi&lt;BR /&gt;rm /var/tmp/tempfile.$ran}&lt;BR /&gt;done</description>
      <pubDate>Mon, 29 Jun 2009 13:03:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-network-ping-status/m-p/5184168#M460424</guid>
      <dc:creator>Mel Burslan</dc:creator>
      <dc:date>2009-06-29T13:03:45Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Network Ping Status.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-network-ping-status/m-p/5184169#M460425</link>
      <description>sorry .. typo error on lines 6 &amp;amp; 7&lt;BR /&gt;&lt;BR /&gt;ran}&lt;BR /&gt;&lt;BR /&gt;should have been &lt;BR /&gt;&lt;BR /&gt;{ran}&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 29 Jun 2009 13:05:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-network-ping-status/m-p/5184169#M460425</guid>
      <dc:creator>Mel Burslan</dc:creator>
      <dc:date>2009-06-29T13:05:15Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Network Ping Status.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-network-ping-status/m-p/5184170#M460426</link>
      <description>indeed second mistake:&lt;BR /&gt;&lt;BR /&gt;pingit()&lt;BR /&gt;{&lt;BR /&gt;  ping $1 -n 1 -m 1 &amp;gt;/dev/null 2&amp;gt;&amp;amp;1 &lt;BR /&gt;  if [ $? = 0 ]&lt;BR /&gt;  then&lt;BR /&gt;   return&lt;BR /&gt;  fi &lt;BR /&gt;  echo "$1 not responding" |mailx -s "system monitoring: $1 status" $2&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;-m 1 parameter will put a timeout of 1 second.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 29 Jun 2009 13:20:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-network-ping-status/m-p/5184170#M460426</guid>
      <dc:creator>Laurent Menase</dc:creator>
      <dc:date>2009-06-29T13:20:40Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Network Ping Status.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-network-ping-status/m-p/5184171#M460427</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Mel: I think you mean:&lt;BR /&gt;&lt;BR /&gt;# ran=$RANDOM&lt;BR /&gt;&lt;BR /&gt;...since it's the 'ran' variable you later reference :-)&lt;BR /&gt;&lt;BR /&gt;That said, you can make a unique temporary file with the basename and pid of the process.  A trap can be used to automatically remove it too:&lt;BR /&gt;&lt;BR /&gt;MYNAME=${0##*/}&lt;BR /&gt;MYLOG=/var/tmp}/${MYNAME}.${$}&lt;BR /&gt;trap 'rm -f ${MYLOG}' EXIT&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...&lt;BR /&gt;</description>
      <pubDate>Mon, 29 Jun 2009 13:27:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-network-ping-status/m-p/5184171#M460427</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-06-29T13:27:29Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Network Ping Status.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-network-ping-status/m-p/5184172#M460428</link>
      <description>Sorry... JRFs right... I should not try attempting to put together scripts before I consume my daily allowance of caffeeine.&lt;BR /&gt;&lt;BR /&gt;Also another missing curly bracket I noticed here:&lt;BR /&gt;&lt;BR /&gt;rm /var/tmp/tempfile.$ran}&lt;BR /&gt;&lt;BR /&gt;should be &lt;BR /&gt;&lt;BR /&gt;rm /var/tmp/tempfile.${ran} &lt;BR /&gt;&lt;BR /&gt;copy and pastis easyf yowrote the first instance right. Otherwise it cascades the errors.</description>
      <pubDate>Mon, 29 Jun 2009 17:32:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-network-ping-status/m-p/5184172#M460428</guid>
      <dc:creator>Mel Burslan</dc:creator>
      <dc:date>2009-06-29T17:32:15Z</dc:date>
    </item>
    <item>
      <title>Re: Script for Network Ping Status.</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-network-ping-status/m-p/5184173#M460429</link>
      <description>Hi All,&lt;BR /&gt;Thanks a lot for the solution.&lt;BR /&gt;</description>
      <pubDate>Tue, 30 Jun 2009 05:39:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-network-ping-status/m-p/5184173#M460429</guid>
      <dc:creator>Narendra Uttekar</dc:creator>
      <dc:date>2009-06-30T05:39:12Z</dc:date>
    </item>
  </channel>
</rss>

