<?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: shell scriptf for ping in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/shell-scriptf-for-ping/m-p/3635320#M105035</link>
    <description>Hi Shiv ,&lt;BR /&gt;&lt;BR /&gt;Here is a ping script attached , please run that in cron , and it will check your servers always...and you will have a good sleep. For any system down , it will page you.&lt;BR /&gt;&lt;BR /&gt;copy to a directory and put the path there.&lt;BR /&gt;&lt;BR /&gt;Add in crontab :&lt;BR /&gt;------------------------------------------&lt;BR /&gt;10,20,30,40,50,59 * * * * /home/shiv/upstat  &amp;gt; /dev/null 2&amp;gt;&amp;amp;1 &lt;BR /&gt;--------------------------------------------&lt;BR /&gt;Put all server names, one by one , in servers.list&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Enjoy,&lt;BR /&gt;Cheers,&lt;BR /&gt;Raj.</description>
    <pubDate>Tue, 27 Sep 2005 09:15:31 GMT</pubDate>
    <dc:creator>Raj D.</dc:creator>
    <dc:date>2005-09-27T09:15:31Z</dc:date>
    <item>
      <title>shell scriptf for ping</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-scriptf-for-ping/m-p/3635310#M105025</link>
      <description>Dear Sirs;&lt;BR /&gt;&lt;BR /&gt;I need to know shell script which performs ping to couple of servers every 15 minutes and records the output in a file.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Shiv</description>
      <pubDate>Tue, 27 Sep 2005 00:56:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-scriptf-for-ping/m-p/3635310#M105025</guid>
      <dc:creator>Shivkumar</dc:creator>
      <dc:date>2005-09-27T00:56:27Z</dc:date>
    </item>
    <item>
      <title>Re: shell scriptf for ping</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-scriptf-for-ping/m-p/3635311#M105026</link>
      <description>Refer the following simple script&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#!/sbin/sh&lt;BR /&gt;i=1&lt;BR /&gt;while [ $i -eq 1 ]&lt;BR /&gt;do&lt;BR /&gt;for str in $hosts&lt;BR /&gt;do&lt;BR /&gt;echo "" &amp;gt;&amp;gt;output_file&lt;BR /&gt;ping $str &amp;gt;&amp;gt;output_file 2&amp;gt;&amp;amp;1&lt;BR /&gt;if [ $? -ne 0 ]&lt;BR /&gt;then&lt;BR /&gt;echo "There is problem while nslookup $str" &amp;gt;&amp;gt;output_file 2&amp;gt;&amp;amp;1&lt;BR /&gt;i=0&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;sleep 900&lt;BR /&gt;done</description>
      <pubDate>Tue, 27 Sep 2005 01:00:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-scriptf-for-ping/m-p/3635311#M105026</guid>
      <dc:creator>VEL_1</dc:creator>
      <dc:date>2005-09-27T01:00:13Z</dc:date>
    </item>
    <item>
      <title>Re: shell scriptf for ping</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-scriptf-for-ping/m-p/3635312#M105027</link>
      <description>&lt;BR /&gt;Sorry. Ignore my previous reply.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#!/sbin/sh&lt;BR /&gt;&lt;BR /&gt;hosts="abc.xx.com xyz.ab.com"&lt;BR /&gt;&lt;BR /&gt;i=1&lt;BR /&gt;while [ $i -eq 1 ]&lt;BR /&gt;do&lt;BR /&gt;for str in $hosts&lt;BR /&gt;do&lt;BR /&gt;echo "" &amp;gt;&amp;gt;output_file&lt;BR /&gt;ping $str &amp;gt;&amp;gt;output_file 2&amp;gt;&amp;amp;1&lt;BR /&gt;if [ $? -ne 0 ]&lt;BR /&gt;then&lt;BR /&gt;echo "There is problem while nslookup $str" &amp;gt;&amp;gt;output_file 2&amp;gt;&amp;amp;1&lt;BR /&gt;i=0&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;sleep 900&lt;BR /&gt;done</description>
      <pubDate>Tue, 27 Sep 2005 01:00:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-scriptf-for-ping/m-p/3635312#M105027</guid>
      <dc:creator>VEL_1</dc:creator>
      <dc:date>2005-09-27T01:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: shell scriptf for ping</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-scriptf-for-ping/m-p/3635313#M105028</link>
      <description>#!/bin/ksh&lt;BR /&gt;# Input&lt;BR /&gt;server1=&lt;BR /&gt;server2=&lt;BR /&gt;stime=900&lt;BR /&gt;&lt;BR /&gt;while [ 1 ]&lt;BR /&gt;do&lt;BR /&gt;&lt;BR /&gt;date &amp;gt;&amp;gt; /tmp/ping_$server1.log&lt;BR /&gt;ping $server1 -n 1 &amp;gt;&amp;gt;/tmp/ping_$server1.log&lt;BR /&gt;[[ $? -eq 0 ]] &amp;amp;&amp;amp; echo "Ping success " || echo "Ping failure" &amp;gt;&amp;gt;/tmp/ping_$server1.log&lt;BR /&gt;date &amp;gt;&amp;gt; /tmp/ping_$server2.log&lt;BR /&gt;ping $server2 -n 1 &amp;gt;&amp;gt;/tmp/ping_$server2.log&lt;BR /&gt;[[ $? -eq 0 ]] &amp;amp;&amp;amp; echo "Ping success" || echo "Ping failure" &amp;gt;&amp;gt;/tmp/ping_$server2.log&lt;BR /&gt;&lt;BR /&gt; sleep 900&lt;BR /&gt;&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;hth.</description>
      <pubDate>Tue, 27 Sep 2005 01:01:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-scriptf-for-ping/m-p/3635313#M105028</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-09-27T01:01:00Z</dc:date>
    </item>
    <item>
      <title>Re: shell scriptf for ping</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-scriptf-for-ping/m-p/3635314#M105029</link>
      <description>Raj,&lt;BR /&gt;&lt;BR /&gt;You try of,&lt;BR /&gt;&lt;BR /&gt;ping $str &amp;gt;&amp;gt;output_file 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;will not end ;). Use count with ping.&lt;BR /&gt;&lt;BR /&gt;hth.</description>
      <pubDate>Tue, 27 Sep 2005 01:01:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-scriptf-for-ping/m-p/3635314#M105029</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-09-27T01:01:25Z</dc:date>
    </item>
    <item>
      <title>Re: shell scriptf for ping</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-scriptf-for-ping/m-p/3635315#M105030</link>
      <description>Shiv,&lt;BR /&gt;&lt;BR /&gt;If you are going to setup these scripts in productive environment plz use cron + scripting as,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;# Input - Must&lt;BR /&gt;server1=&lt;BR /&gt;server2=&lt;BR /&gt;stime=900&lt;BR /&gt;&lt;BR /&gt;date &amp;gt;&amp;gt; /tmp/ping_$server1.log&lt;BR /&gt;ping $server1 -n 1 &amp;gt;&amp;gt;/tmp/ping_$server1.log&lt;BR /&gt;[[ $? -eq 0 ]] &amp;amp;&amp;amp; echo "Ping success " || echo "Ping failure" &amp;gt;&amp;gt;/tmp/ping_$server1.log 2&amp;gt;&amp;amp;1&lt;BR /&gt;date &amp;gt;&amp;gt; /tmp/ping_$server2.log&lt;BR /&gt;ping $server2 -n 1 &amp;gt;&amp;gt;/tmp/ping_$server2.log&lt;BR /&gt;[[ $? -eq 0 ]] &amp;amp;&amp;amp; echo "Ping success" || echo "Ping failure" &amp;gt;&amp;gt;/tmp/ping_$server2.log 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;# end&lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;# Cron Tab Setting&lt;BR /&gt;0,15,30,45 * * * * /tmp/ping.ksh 1&amp;gt;/dev/null 2&amp;gt;&amp;amp;1</description>
      <pubDate>Tue, 27 Sep 2005 01:03:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-scriptf-for-ping/m-p/3635315#M105030</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-09-27T01:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: shell scriptf for ping</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-scriptf-for-ping/m-p/3635316#M105031</link>
      <description>No need to use stime as you can use sleep 900 in your script.. Crisp &amp;amp; Concise ;)&lt;BR /&gt;&lt;BR /&gt;-Arun</description>
      <pubDate>Tue, 27 Sep 2005 01:04:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-scriptf-for-ping/m-p/3635316#M105031</guid>
      <dc:creator>Arunvijai_4</dc:creator>
      <dc:date>2005-09-27T01:04:27Z</dc:date>
    </item>
    <item>
      <title>Re: shell scriptf for ping</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-scriptf-for-ping/m-p/3635317#M105032</link>
      <description>&lt;BR /&gt;Sorry. Thought of solaris platform.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 27 Sep 2005 01:05:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-scriptf-for-ping/m-p/3635317#M105032</guid>
      <dc:creator>VEL_1</dc:creator>
      <dc:date>2005-09-27T01:05:07Z</dc:date>
    </item>
    <item>
      <title>Re: shell scriptf for ping</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-scriptf-for-ping/m-p/3635318#M105033</link>
      <description>Sounds like you are doing some monitoring....why not purchase OVO?&lt;BR /&gt;&lt;BR /&gt;If you can't afford it, have a look at Big Brother:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.bb4.org/" target="_blank"&gt;http://www.bb4.org/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Rgds...Geoff</description>
      <pubDate>Tue, 27 Sep 2005 07:49:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-scriptf-for-ping/m-p/3635318#M105033</guid>
      <dc:creator>Geoff Wild</dc:creator>
      <dc:date>2005-09-27T07:49:20Z</dc:date>
    </item>
    <item>
      <title>Re: shell scriptf for ping</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-scriptf-for-ping/m-p/3635319#M105034</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;This is my script use for one project.&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;&amp;gt; /home/rajeshsb/sysstat.log&lt;BR /&gt;&amp;gt; /home/rajeshsb/downlist&lt;BR /&gt;for sys in `cat /home/rajeshsb/sys.list`&lt;BR /&gt;do&lt;BR /&gt;/etc/ping $sys -n 2 |grep ms &amp;gt;&amp;gt; /home/rajeshsb/sysstat.log&lt;BR /&gt;if [ $? -ne 0 ]&lt;BR /&gt;then&lt;BR /&gt;   echo "$sys is down" &amp;gt;&amp;gt; /home/rajeshsb/downlist;&lt;BR /&gt;else&lt;BR /&gt;   echo "$sys is up" &amp;gt; /dev/null;&lt;BR /&gt;fi&lt;BR /&gt;done&lt;BR /&gt;if [ -s /home/rajeshsb/downlist ]&lt;BR /&gt;then&lt;BR /&gt;   cat /home/rajeshsb/downlist| mailx -s "Warning! Down System details" rajeshsb@india.hp.com&lt;BR /&gt;mailx -s "Warning! Down System details"  rajeshsb@india.hp.com  &amp;lt; /home/rajeshsb/downlist&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;Usage:&lt;BR /&gt;The script "sysstat.sh" reads the list of systems from file "/home/rajeshsb/sys.list"&lt;BR /&gt;It logs as well sends the email to me&lt;BR /&gt;Keep on add the systems into sys.list.&lt;BR /&gt;&lt;BR /&gt;Just schedule the scritp in cron.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Rajesh&lt;BR /&gt;</description>
      <pubDate>Tue, 27 Sep 2005 08:23:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-scriptf-for-ping/m-p/3635319#M105034</guid>
      <dc:creator>Rajesh SB</dc:creator>
      <dc:date>2005-09-27T08:23:26Z</dc:date>
    </item>
    <item>
      <title>Re: shell scriptf for ping</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-scriptf-for-ping/m-p/3635320#M105035</link>
      <description>Hi Shiv ,&lt;BR /&gt;&lt;BR /&gt;Here is a ping script attached , please run that in cron , and it will check your servers always...and you will have a good sleep. For any system down , it will page you.&lt;BR /&gt;&lt;BR /&gt;copy to a directory and put the path there.&lt;BR /&gt;&lt;BR /&gt;Add in crontab :&lt;BR /&gt;------------------------------------------&lt;BR /&gt;10,20,30,40,50,59 * * * * /home/shiv/upstat  &amp;gt; /dev/null 2&amp;gt;&amp;amp;1 &lt;BR /&gt;--------------------------------------------&lt;BR /&gt;Put all server names, one by one , in servers.list&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Enjoy,&lt;BR /&gt;Cheers,&lt;BR /&gt;Raj.</description>
      <pubDate>Tue, 27 Sep 2005 09:15:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-scriptf-for-ping/m-p/3635320#M105035</guid>
      <dc:creator>Raj D.</dc:creator>
      <dc:date>2005-09-27T09:15:31Z</dc:date>
    </item>
    <item>
      <title>Re: shell scriptf for ping</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-scriptf-for-ping/m-p/3635321#M105036</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;Try instead the fping program. It is much better for this kind of tests.&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://3d2f.com/programs/2-515-fping-download.shtml" target="_blank"&gt;http://3d2f.com/programs/2-515-fping-download.shtml&lt;/A&gt;</description>
      <pubDate>Tue, 27 Sep 2005 09:46:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-scriptf-for-ping/m-p/3635321#M105036</guid>
      <dc:creator>Leif Halvarsson_2</dc:creator>
      <dc:date>2005-09-27T09:46:37Z</dc:date>
    </item>
    <item>
      <title>Re: shell scriptf for ping</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-scriptf-for-ping/m-p/3635322#M105037</link>
      <description>Shiv,&lt;BR /&gt;&lt;BR /&gt;You should be running the ping script from a server , which not in your server list. So ir will monitor all server.&lt;BR /&gt;&lt;BR /&gt;The command to be use :&lt;BR /&gt;&lt;BR /&gt;# ping -c n servername &lt;BR /&gt;[ n is number of ping counts , servername is = SERVER ]&lt;BR /&gt;&lt;BR /&gt;ex: &lt;BR /&gt;# ping -c 3 dbserver&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;Raj.&lt;BR /&gt;</description>
      <pubDate>Tue, 27 Sep 2005 13:40:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-scriptf-for-ping/m-p/3635322#M105037</guid>
      <dc:creator>Raj D.</dc:creator>
      <dc:date>2005-09-27T13:40:58Z</dc:date>
    </item>
  </channel>
</rss>

