<?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 script in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/shell-script/m-p/3635303#M104971</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt; Use the following script.&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;  nslookup $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 10&lt;BR /&gt;done</description>
    <pubDate>Tue, 27 Sep 2005 00:52:12 GMT</pubDate>
    <dc:creator>VEL_1</dc:creator>
    <dc:date>2005-09-27T00:52:12Z</dc:date>
    <item>
      <title>shell script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script/m-p/3635301#M104969</link>
      <description>Dear Sirs;&lt;BR /&gt;&lt;BR /&gt;I need to know a shell script which does a nslookup on the names abc.xx.com and xyz.ab.com every 10 minutes and records the output in a file.&lt;BR /&gt;&lt;BR /&gt;Please suggest the script.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Shiv&lt;BR /&gt;</description>
      <pubDate>Tue, 27 Sep 2005 00:44:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script/m-p/3635301#M104969</guid>
      <dc:creator>Shivkumar</dc:creator>
      <dc:date>2005-09-27T00:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: shell script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script/m-p/3635302#M104970</link>
      <description>#!/bin/ksh&lt;BR /&gt;# User input&lt;BR /&gt;LOGFILE=/tmp/nslookup.log&lt;BR /&gt;host1=abc.xx.com&lt;BR /&gt;host2=xyz.ab.com&lt;BR /&gt;stime=600&lt;BR /&gt;&lt;BR /&gt;while [ 1 ]&lt;BR /&gt;do&lt;BR /&gt;  nslookup -q $host1&amp;gt;&amp;gt; $LOGFILE&lt;BR /&gt;  nslookup -q $host2 &amp;gt;&amp;gt; $LOGFILE&lt;BR /&gt;  sleep $stime&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;exit 0&lt;BR /&gt;# END #&lt;BR /&gt;&lt;BR /&gt;It will update in to /tmp/nslookup.log. You can change user inputs.&lt;BR /&gt;&lt;BR /&gt;# Running script&lt;BR /&gt;# chmod u+x script.ksh&lt;BR /&gt;# ./script.ksh &amp;amp;&lt;BR /&gt;# tail -f /tmp/nslookup.log&lt;BR /&gt;&lt;BR /&gt;hth.</description>
      <pubDate>Tue, 27 Sep 2005 00:51:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script/m-p/3635302#M104970</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-09-27T00:51:51Z</dc:date>
    </item>
    <item>
      <title>Re: shell script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script/m-p/3635303#M104971</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt; Use the following script.&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;  nslookup $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 10&lt;BR /&gt;done</description>
      <pubDate>Tue, 27 Sep 2005 00:52:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script/m-p/3635303#M104971</guid>
      <dc:creator>VEL_1</dc:creator>
      <dc:date>2005-09-27T00:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: shell script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script/m-p/3635304#M104972</link>
      <description>You can setup cron + script also as,&lt;BR /&gt;&lt;BR /&gt;#!/bin/ksh&lt;BR /&gt;# User input&lt;BR /&gt;# script.ksh&lt;BR /&gt;LOGFILE=/tmp/nslookup.log&lt;BR /&gt;ERRLOG=/tmp/nslookup.err&lt;BR /&gt;host1=abc.xx.com&lt;BR /&gt;host2=xyz.ab.com&lt;BR /&gt;&lt;BR /&gt;touch $ERRLOG $LOGFILE&lt;BR /&gt;nslookup -q $host1&amp;gt;&amp;gt; $LOGFILE 2&amp;gt;&amp;gt;$ERRLOG&lt;BR /&gt;nslookup -q $host2 &amp;gt;&amp;gt; $LOGFILE 2&amp;gt;&amp;gt;$ERRLOG&lt;BR /&gt;&lt;BR /&gt;exit 0&lt;BR /&gt;# END #&lt;BR /&gt;&lt;BR /&gt;# Crontab Setting&lt;BR /&gt;0,10,20,30,40,50 * * * * /tmp/script.ksh 1&amp;gt;/dev/null 2&amp;gt;&amp;amp;1&lt;BR /&gt;&lt;BR /&gt;hth.</description>
      <pubDate>Tue, 27 Sep 2005 00:55:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script/m-p/3635304#M104972</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2005-09-27T00:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: shell script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shell-script/m-p/3635305#M104973</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;you can also have a look at Openview products for some advance monitoring and notification features... however, you will have to pay for this.&lt;BR /&gt;&lt;BR /&gt;kind regards&lt;BR /&gt;yogeeraj</description>
      <pubDate>Tue, 27 Sep 2005 01:33:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shell-script/m-p/3635305#M104973</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2005-09-27T01:33:46Z</dc:date>
    </item>
  </channel>
</rss>

