<?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: A korn shell Script for test up/down nodes in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/a-korn-shell-script-for-test-up-down-nodes/m-p/3963732#M757754</link>
    <description>&lt;BR /&gt;&lt;BR /&gt;I won't use the $OUTFILE just the $OUTFILE2.&lt;BR /&gt;&lt;BR /&gt;I tried to made those changes you sent to me but didn't worked it out. The script got an error.When i put the script back, it worked.</description>
    <pubDate>Tue, 20 Mar 2007 15:25:20 GMT</pubDate>
    <dc:creator>Bitraptor</dc:creator>
    <dc:date>2007-03-20T15:25:20Z</dc:date>
    <item>
      <title>A korn shell Script for test up/down nodes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/a-korn-shell-script-for-test-up-down-nodes/m-p/3963725#M757747</link>
      <description>I need to develop, test, and implement a utility for polling all computing devices via ICMP Ping and alerting via OVO for nodes which do not respond and write it to a file so that OVO may read and generate an alert.(Opcnode command).I've already developed and tested one that i have, but i need to optimize it. The script is the following&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;##################################################&lt;BR /&gt;#&lt;BR /&gt;# Check status of OVO agent - Ping Test Only&lt;BR /&gt;#  &lt;BR /&gt;##################################################&lt;BR /&gt; &lt;BR /&gt;INFILE=$1&lt;BR /&gt; &lt;BR /&gt;if [[ -z $1 || ! -f $1 ]]; then&lt;BR /&gt;   echo "Pls specify a valid input filename"&lt;BR /&gt;   exit 9&lt;BR /&gt;fi&lt;BR /&gt; &lt;BR /&gt;OUTFILE=/home/aa6491/agent_ping_test.out&lt;BR /&gt;OUTFILE2=/home/aa6491/agent_ping_test.rpt&lt;BR /&gt; &lt;BR /&gt;/momauto/managers/OV/log #this is the right path where the files should be written to.&lt;BR /&gt; &lt;BR /&gt;&amp;gt; $OUTFILE&lt;BR /&gt;&amp;gt; $OUTFILE2&lt;BR /&gt; &lt;BR /&gt;Total_Nodes=`wc -l $INFILE | awk '{print $1}'`&lt;BR /&gt;Node_Num=0&lt;BR /&gt; &lt;BR /&gt;echo `date +"%x %X"` "Node PING test started for $Total_Nodes configured nodes"&lt;BR /&gt; &lt;BR /&gt;for nodename in `cat $INFILE`; do&lt;BR /&gt;   (( Node_Num = $Node_Num + 1 ))&lt;BR /&gt;   ping $nodename -n 1 &amp;gt;/dev/null 2&amp;gt;/dev/null&lt;BR /&gt;   RC=$?&lt;BR /&gt;   if [[ $RC -ne 0 ]]; then&lt;BR /&gt;      echo `date +"%x %X"` "$nodename:Agent $Node_Num of $Total_Nodes, did not respond to ICMP ping" | tee -a $OUTFILE2&lt;BR /&gt;   else&lt;BR /&gt;      echo `date +"%x %X"` "$nodename:Agent $Node_Num of $Total_Nodes, did respond to ICMP ping" | tee -a $OUTFILE2&lt;BR /&gt;   fi&lt;BR /&gt;done&lt;BR /&gt; &lt;BR /&gt;echo `date +"%x %X"` "Node PING test complete"&lt;BR /&gt; &lt;BR /&gt;exit 0&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Do you guys have any other suggestions on how i should be modifying and implementing new features to this script? Do you have any other new script suggestion for this case? It's URGENT. I would appreciate any help. Thanks.&lt;BR /&gt;</description>
      <pubDate>Fri, 16 Mar 2007 16:08:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/a-korn-shell-script-for-test-up-down-nodes/m-p/3963725#M757747</guid>
      <dc:creator>Bitraptor</dc:creator>
      <dc:date>2007-03-16T16:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: A korn shell Script for test up/down nodes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/a-korn-shell-script-for-test-up-down-nodes/m-p/3963726#M757748</link>
      <description>I give up.  What's "URGENT"?  Why do you wish&lt;BR /&gt;to change the script you have?  What new&lt;BR /&gt;features do you want?  For what kinds of&lt;BR /&gt;suggestions are you looking?</description>
      <pubDate>Fri, 16 Mar 2007 20:06:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/a-korn-shell-script-for-test-up-down-nodes/m-p/3963726#M757748</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2007-03-16T20:06:49Z</dc:date>
    </item>
    <item>
      <title>Re: A korn shell Script for test up/down nodes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/a-korn-shell-script-for-test-up-down-nodes/m-p/3963727#M757749</link>
      <description>Only a few trivial changes:&lt;BR /&gt;Total_Nodes=$(wc -l &amp;lt; $INFILE)&lt;BR /&gt;&lt;BR /&gt;And replace archaic `` by $() throughout.&lt;BR /&gt;&lt;BR /&gt;You don't need the "$" in (( )):&lt;BR /&gt; (( Node_Num = $Node_Num + 1 ))&lt;BR /&gt;&lt;BR /&gt;No need for cat:&lt;BR /&gt;for nodename in $(&amp;lt; $INFILE); do&lt;BR /&gt;&lt;BR /&gt;You set $INFILE at the top.  You then check $1, you should be consistent and use $INFILE.  And in your error message, you should echo $INFILE so the error is reinforced by the bad name.</description>
      <pubDate>Fri, 16 Mar 2007 22:48:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/a-korn-shell-script-for-test-up-down-nodes/m-p/3963727#M757749</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-03-16T22:48:26Z</dc:date>
    </item>
    <item>
      <title>Re: A korn shell Script for test up/down nodes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/a-korn-shell-script-for-test-up-down-nodes/m-p/3963728#M757750</link>
      <description>If I had to _use_ this script, my first&lt;BR /&gt;complaint might be that it does not allow the&lt;BR /&gt;input file to include any comments, which is&lt;BR /&gt;bad for at least two reasons.  (Or blank&lt;BR /&gt;lines?)</description>
      <pubDate>Sat, 17 Mar 2007 09:12:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/a-korn-shell-script-for-test-up-down-nodes/m-p/3963728#M757750</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2007-03-17T09:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: A korn shell Script for test up/down nodes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/a-korn-shell-script-for-test-up-down-nodes/m-p/3963729#M757751</link>
      <description>&lt;BR /&gt;&lt;BR /&gt;Hi Dennis&lt;BR /&gt;&lt;BR /&gt;Thank you very much for your help. I could ask you only one more thing. How ecxatly would you build this script having mine as an example? I mean, could you write it down throughout with your considerable optimizations? If there will be some explanation on the optimization i would be glad, it's been quite a whil i haven't ben into korn shell script. I'll implement this in the next few weeks in a very large enviroment for a HP client. Thank you one more time Dennis and i wait for your feedback.</description>
      <pubDate>Mon, 19 Mar 2007 09:03:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/a-korn-shell-script-for-test-up-down-nodes/m-p/3963729#M757751</guid>
      <dc:creator>Bitraptor</dc:creator>
      <dc:date>2007-03-19T09:03:54Z</dc:date>
    </item>
    <item>
      <title>Re: A korn shell Script for test up/down nodes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/a-korn-shell-script-for-test-up-down-nodes/m-p/3963730#M757752</link>
      <description>Do I have this right?  You have a paying&lt;BR /&gt;client, you don't know how to do the job, and&lt;BR /&gt;you can't even implement the suggestions you&lt;BR /&gt;already have, so you want someone else to do&lt;BR /&gt;your whole job for you for free (or for a few&lt;BR /&gt;ITRC points)?  Or do I misunderstand?&lt;BR /&gt;&lt;BR /&gt;Perhaps you should hire a (sub-) contractor&lt;BR /&gt;who _does_ know how to do your job.  (But,&lt;BR /&gt;hey, if you can get someone to do your job&lt;BR /&gt;for nothing, it's ok with me.)</description>
      <pubDate>Mon, 19 Mar 2007 15:39:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/a-korn-shell-script-for-test-up-down-nodes/m-p/3963730#M757752</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2007-03-19T15:39:36Z</dc:date>
    </item>
    <item>
      <title>Re: A korn shell Script for test up/down nodes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/a-korn-shell-script-for-test-up-down-nodes/m-p/3963731#M757753</link>
      <description>&amp;gt;How exactly would you build this script having mine as an example?&lt;BR /&gt;&lt;BR /&gt;Well, yours seems to do what it says.  (I don't see any use of $OUTFILE.)&lt;BR /&gt;&lt;BR /&gt;You do know that just because you can ping a system doesn't mean it isn't hung?</description>
      <pubDate>Mon, 19 Mar 2007 17:11:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/a-korn-shell-script-for-test-up-down-nodes/m-p/3963731#M757753</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-03-19T17:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: A korn shell Script for test up/down nodes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/a-korn-shell-script-for-test-up-down-nodes/m-p/3963732#M757754</link>
      <description>&lt;BR /&gt;&lt;BR /&gt;I won't use the $OUTFILE just the $OUTFILE2.&lt;BR /&gt;&lt;BR /&gt;I tried to made those changes you sent to me but didn't worked it out. The script got an error.When i put the script back, it worked.</description>
      <pubDate>Tue, 20 Mar 2007 15:25:20 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/a-korn-shell-script-for-test-up-down-nodes/m-p/3963732#M757754</guid>
      <dc:creator>Bitraptor</dc:creator>
      <dc:date>2007-03-20T15:25:20Z</dc:date>
    </item>
    <item>
      <title>Re: A korn shell Script for test up/down nodes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/a-korn-shell-script-for-test-up-down-nodes/m-p/3963733#M757755</link>
      <description>&amp;gt;I tried to made those changes you sent to me but didn't worked it out. The script got an error.&lt;BR /&gt;&lt;BR /&gt;Can you attach your script so I can look at the error?  And provide error message.</description>
      <pubDate>Tue, 20 Mar 2007 22:02:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/a-korn-shell-script-for-test-up-down-nodes/m-p/3963733#M757755</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-03-20T22:02:42Z</dc:date>
    </item>
    <item>
      <title>Re: A korn shell Script for test up/down nodes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/a-korn-shell-script-for-test-up-down-nodes/m-p/3963734#M757756</link>
      <description>&lt;BR /&gt;Hi Dennis,&lt;BR /&gt;&lt;BR /&gt;I'm sending you the file attached. See what you can get from it. If you make any modifications and or get it optimized, let me know.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
      <pubDate>Wed, 21 Mar 2007 08:43:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/a-korn-shell-script-for-test-up-down-nodes/m-p/3963734#M757756</guid>
      <dc:creator>Bitraptor</dc:creator>
      <dc:date>2007-03-21T08:43:58Z</dc:date>
    </item>
    <item>
      <title>Re: A korn shell Script for test up/down nodes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/a-korn-shell-script-for-test-up-down-nodes/m-p/3963735#M757757</link>
      <description>&amp;gt;If you make any modifications and or get it optimized, let me know.&lt;BR /&gt;&lt;BR /&gt;I changed:&lt;BR /&gt;Total_Nodes=$(wc -l &amp;lt; $INFILE)&lt;BR /&gt;for nodename in $(&amp;lt; $INFILE); do&lt;BR /&gt;&lt;BR /&gt;(Note this will allow multiple hosts on one line but your wc won't count them.  You could change to wc -w.)&lt;BR /&gt;&lt;BR /&gt;Each line with `date` to:&lt;BR /&gt;echo $(date +"%x %X") ...&lt;BR /&gt;&lt;BR /&gt;There were two lines with: | &amp;gt;&amp;gt; $OUTFILE2&lt;BR /&gt;&lt;BR /&gt;I assumed you didn't remove the tee completely?&lt;BR /&gt;&lt;BR /&gt;echo $(date +"%x %X") "$nodename:Agent $Node_Num of $Total_Nodes, did not respond to ICMP ping" &amp;gt;&amp;gt; $OUTFILE2</description>
      <pubDate>Thu, 22 Mar 2007 05:12:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/a-korn-shell-script-for-test-up-down-nodes/m-p/3963735#M757757</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-03-22T05:12:06Z</dc:date>
    </item>
    <item>
      <title>Re: A korn shell Script for test up/down nodes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/a-korn-shell-script-for-test-up-down-nodes/m-p/3963736#M757758</link>
      <description>&lt;BR /&gt;Yes, i didn't remove the "tee" for the "$OUTFILE" just to see the testing results on the screen in real time.I'll be doing this when i implemtent the script in the production enviroment. The 2 lines containing &amp;gt;&amp;gt;OUFILE2 are for diffrent purposes if haven't pay enough atention:&lt;BR /&gt;&lt;BR /&gt;if [[ $RC -ne 0 ]]; then&lt;BR /&gt;      echo `date +"%x %X"` "$nodename:Agent $Node_Num of $Total_Nodes, did not respond to ICMP ping" | &amp;gt;&amp;gt; $OUTFILE2&lt;BR /&gt;   else&lt;BR /&gt;      echo `date +"%x %X"` "$nodename:Agent $Node_Num of $Total_Nodes, did respond to ICMP ping" | &amp;gt;&amp;gt; $OUTFILE2&lt;BR /&gt;   fi&lt;BR /&gt;done&lt;BR /&gt;&lt;BR /&gt;----- one is for the nodes which responds and other wich doesn't. -------&lt;BR /&gt;&lt;BR /&gt;- Look , i tried to make those changes you made and as i stated before in the last post, for some readon it didn't work out.&lt;BR /&gt;&lt;BR /&gt;could you send the attached file with the changes you made on it for me be able to test it out?!&lt;BR /&gt;&lt;BR /&gt;ThX</description>
      <pubDate>Thu, 22 Mar 2007 08:02:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/a-korn-shell-script-for-test-up-down-nodes/m-p/3963736#M757758</guid>
      <dc:creator>Bitraptor</dc:creator>
      <dc:date>2007-03-22T08:02:29Z</dc:date>
    </item>
    <item>
      <title>Re: A korn shell Script for test up/down nodes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/a-korn-shell-script-for-test-up-down-nodes/m-p/3963737#M757759</link>
      <description>&lt;BR /&gt;&lt;BR /&gt;Yes, i didn't remove the "tee" from the script yet for the the single reason i want to see the output on the screen in real time as the script runs,ok? This will be done later.&lt;BR /&gt;&lt;BR /&gt;As for the changes you've made on the script for some reason it didn't work it out, as i stated in the last post, when i made those changes (Total_Nodes/ for nodename , etc)i got an error when the scritp ran.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Regarding the 2 "&amp;gt;&amp;gt;OUTFILES2" , they are for different purposes.One for the nodes wich reponde to the ping and the other for the ones wich do not,ok.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Could you attach a file with your changes so that i can test it out completly?&lt;BR /&gt;&lt;BR /&gt;Thx.</description>
      <pubDate>Thu, 22 Mar 2007 08:09:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/a-korn-shell-script-for-test-up-down-nodes/m-p/3963737#M757759</guid>
      <dc:creator>Bitraptor</dc:creator>
      <dc:date>2007-03-22T08:09:10Z</dc:date>
    </item>
    <item>
      <title>Re: A korn shell Script for test up/down nodes</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/a-korn-shell-script-for-test-up-down-nodes/m-p/3963738#M757760</link>
      <description>&amp;gt;i didn't remove the "tee" from the script yet&lt;BR /&gt;&lt;BR /&gt;They were only partially removed so it had bad syntax.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;Could you attach a file with your changes so that i can test it out completly?&lt;BR /&gt;&lt;BR /&gt;Attached</description>
      <pubDate>Thu, 22 Mar 2007 20:35:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/a-korn-shell-script-for-test-up-down-nodes/m-p/3963738#M757760</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2007-03-22T20:35:31Z</dc:date>
    </item>
  </channel>
</rss>

