<?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: top command - scripting.... in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/top-command-scripting/m-p/4495095#M680643</link>
    <description>&amp;gt;Laurent:&lt;BR /&gt;&lt;BR /&gt;Yes you are right indeed, Glance is better when it comes to accuracy, different is in method used to measurement. I recommend to check this link about glance v.s. top &lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.unix.com/hp-ux/50084-glanceplus-v-s-top.html" target="_blank"&gt;http://www.unix.com/hp-ux/50084-glanceplus-v-s-top.html&lt;/A&gt;</description>
    <pubDate>Fri, 11 Sep 2009 07:17:33 GMT</pubDate>
    <dc:creator>Hakki Aydin Ucar</dc:creator>
    <dc:date>2009-09-11T07:17:33Z</dc:date>
    <item>
      <title>top command - scripting....</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/top-command-scripting/m-p/4495090#M680638</link>
      <description>I know 'top' is an interactive command but was hoping there is a way to add it to a script that runs for 10 seconds then terminates and the script continues.&lt;BR /&gt;Any thoughts?</description>
      <pubDate>Thu, 10 Sep 2009 11:02:55 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/top-command-scripting/m-p/4495090#M680638</guid>
      <dc:creator>BrianDoyle</dc:creator>
      <dc:date>2009-09-10T11:02:55Z</dc:date>
    </item>
    <item>
      <title>Re: top command - scripting....</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/top-command-scripting/m-p/4495091#M680639</link>
      <description>It is possible using the -s and -d switches at the command line.&lt;BR /&gt;&lt;BR /&gt;-s &lt;TIME&gt; &lt;BR /&gt;tells top to refresh every &lt;TIME&gt; seconds. default is 5 seconds&lt;BR /&gt;&lt;BR /&gt;-d &lt;COUNT&gt;&lt;BR /&gt;tells top to exit after &lt;COUNT&gt; number of refreshes. Default is infinite until interactively stopped&lt;BR /&gt;&lt;BR /&gt;So, if you want to run it for 10 seconds, you can run the top command as follows:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;top -s 2 -d 5&lt;BR /&gt;&lt;BR /&gt;this will give you 5 refreshes of the screen, with 2 seconds in between each refresh, making the run time 10 seconds (roughly that is give or take a second)&lt;BR /&gt;&lt;BR /&gt;if you need to send the output to a file, there also is -f switch as well as how many top processes you want to send to this file, using -n switch.&lt;BR /&gt;&lt;BR /&gt;top is quite flexible. To see alll the capabilities, see the man page for top.&lt;BR /&gt;&lt;BR /&gt;Hope this helps&lt;/COUNT&gt;&lt;/COUNT&gt;&lt;/TIME&gt;&lt;/TIME&gt;</description>
      <pubDate>Thu, 10 Sep 2009 12:24:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/top-command-scripting/m-p/4495091#M680639</guid>
      <dc:creator>Mel Burslan</dc:creator>
      <dc:date>2009-09-10T12:24:34Z</dc:date>
    </item>
    <item>
      <title>Re: top command - scripting....</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/top-command-scripting/m-p/4495092#M680640</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;To add to Mel's suggestions, if you want to capture the output of 'top' into a file for subsequent use, be sure to use the '-f filename' switch.  If you don't your output file (from simple redirection) would otherwise contain terminal control characters for cursor positioning --- not what you want.&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Thu, 10 Sep 2009 12:30:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/top-command-scripting/m-p/4495092#M680640</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2009-09-10T12:30:32Z</dc:date>
    </item>
    <item>
      <title>Re: top command - scripting....</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/top-command-scripting/m-p/4495093#M680641</link>
      <description>-quote from Duncan (he did it for disk IO), I liked it:&lt;BR /&gt;&lt;BR /&gt; Create a file (I called it /tmp/cpu_top) with the following contents:&lt;BR /&gt;&lt;BR /&gt;Print "----------CPU USAGE:"&lt;BR /&gt;cpu loop {&lt;BR /&gt;PRINT "CPU # ", bycpu_id, " used ", bycpu_cpu_total_util, "% CPU"&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;Then reference this from glance with a suitable interval:&lt;BR /&gt;&lt;BR /&gt;glance -aos /tmp/cpu_top -j 10&lt;BR /&gt;&lt;BR /&gt;it just show every 10 seconds all CPU(s) usage. Of course it is flexible to create more fields. .&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 10 Sep 2009 13:56:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/top-command-scripting/m-p/4495093#M680641</guid>
      <dc:creator>Hakki Aydin Ucar</dc:creator>
      <dc:date>2009-09-10T13:56:01Z</dc:date>
    </item>
    <item>
      <title>Re: top command - scripting....</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/top-command-scripting/m-p/4495094#M680642</link>
      <description>Hakki is right, use glance adviser mode gives much more accurate results.&lt;BR /&gt;&lt;BR /&gt;- top works on sampled metrics, when glance is using accurate metrics-.</description>
      <pubDate>Fri, 11 Sep 2009 05:51:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/top-command-scripting/m-p/4495094#M680642</guid>
      <dc:creator>Laurent Menase</dc:creator>
      <dc:date>2009-09-11T05:51:23Z</dc:date>
    </item>
    <item>
      <title>Re: top command - scripting....</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/top-command-scripting/m-p/4495095#M680643</link>
      <description>&amp;gt;Laurent:&lt;BR /&gt;&lt;BR /&gt;Yes you are right indeed, Glance is better when it comes to accuracy, different is in method used to measurement. I recommend to check this link about glance v.s. top &lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.unix.com/hp-ux/50084-glanceplus-v-s-top.html" target="_blank"&gt;http://www.unix.com/hp-ux/50084-glanceplus-v-s-top.html&lt;/A&gt;</description>
      <pubDate>Fri, 11 Sep 2009 07:17:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/top-command-scripting/m-p/4495095#M680643</guid>
      <dc:creator>Hakki Aydin Ucar</dc:creator>
      <dc:date>2009-09-11T07:17:33Z</dc:date>
    </item>
    <item>
      <title>Re: top command - scripting....</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/top-command-scripting/m-p/4495096#M680644</link>
      <description>Hakki &amp;amp; Laurent,&lt;BR /&gt;&lt;BR /&gt;You are overlooking one important matter: MONEY!&lt;BR /&gt;&lt;BR /&gt;top is free to use whereas glance is costly. And all you need to see who is the top CPU hog for few seconds, top does the job comparably well. Yes, if you have a large shop with gazillion machines and you need to be on top of performance problem and what-not all the time, glance is worth it's manuals weight in gold, but for a shop with not much of a budget, let alone a home user with one or two hpux machines setup for god knows what, glance is overkill.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 11 Sep 2009 14:42:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/top-command-scripting/m-p/4495096#M680644</guid>
      <dc:creator>Mel Burslan</dc:creator>
      <dc:date>2009-09-11T14:42:38Z</dc:date>
    </item>
  </channel>
</rss>

