<?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: Executing 'TOP' in the background in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/executing-top-in-the-background/m-p/3378964#M197183</link>
    <description>If you want to monitor the specific application with top then,&lt;BR /&gt;&lt;BR /&gt; make a script as,&lt;BR /&gt;&lt;BR /&gt; # Start the application&lt;BR /&gt; ..........&lt;BR /&gt;&lt;BR /&gt; # get the process count&lt;BR /&gt; count=$(ps -ef | grep -v grep | wc -l)&lt;BR /&gt;&lt;BR /&gt; # Run the top as,&lt;BR /&gt; top -d 1 -f filename -n $count&lt;BR /&gt;&lt;BR /&gt; It will update the top information's of all process there in filename&lt;BR /&gt;&lt;BR /&gt; Note: top will run only once.&lt;BR /&gt;&lt;BR /&gt; If you want automate then,&lt;BR /&gt;&lt;BR /&gt; try to put in loop as,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; while true; do&lt;BR /&gt; &lt;BR /&gt;  # top execution&lt;BR /&gt;  # Sleep time&lt;BR /&gt;  # check process running / stopping&lt;BR /&gt;  # If stopped,&lt;BR /&gt;  stop execution&lt;BR /&gt;&lt;BR /&gt; done&lt;BR /&gt;&lt;BR /&gt; Use file on top as with time and date or counts to identify the information&lt;BR /&gt;  &lt;BR /&gt;</description>
    <pubDate>Wed, 15 Sep 2004 01:15:00 GMT</pubDate>
    <dc:creator>Muthukumar_5</dc:creator>
    <dc:date>2004-09-15T01:15:00Z</dc:date>
    <item>
      <title>Executing 'TOP' in the background</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/executing-top-in-the-background/m-p/3378960#M197179</link>
      <description>Hi All,&lt;BR /&gt;&lt;BR /&gt;I have one application running in my redhat LINUX box for 10-15 hours. I need to monitor the CPU usage of the system during the time the application is running. Can anyone tell me how I would execute "TOP" utility in the background for the amount of time my application is running and gather the information in specified files to be analyzed at the end of the day.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Andy</description>
      <pubDate>Tue, 14 Sep 2004 19:25:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/executing-top-in-the-background/m-p/3378960#M197179</guid>
      <dc:creator>Anand_30</dc:creator>
      <dc:date>2004-09-14T19:25:36Z</dc:date>
    </item>
    <item>
      <title>Re: Executing 'TOP' in the background</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/executing-top-in-the-background/m-p/3378961#M197180</link>
      <description>Hi Andy,&lt;BR /&gt;&lt;BR /&gt;There is an option "-f" that can be given with top to capture the data in a file on HP systems. For ex.,&lt;BR /&gt;&lt;BR /&gt;top -s5 -d6 -f top.out&lt;BR /&gt;&lt;BR /&gt;Will capture the data for 30 seconds for every 5 seconds. &lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Tue, 14 Sep 2004 19:38:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/executing-top-in-the-background/m-p/3378961#M197180</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2004-09-14T19:38:33Z</dc:date>
    </item>
    <item>
      <title>Re: Executing 'TOP' in the background</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/executing-top-in-the-background/m-p/3378962#M197181</link>
      <description>I think Sri, is on to it.. &lt;BR /&gt;&lt;BR /&gt;might I add my 2-cents here..&lt;BR /&gt;&lt;BR /&gt;try also:&lt;BR /&gt;&lt;BR /&gt;$  w&lt;BR /&gt;&lt;BR /&gt;$ uptime&lt;BR /&gt;&lt;BR /&gt;and of course, check out the man pages on uptime, sar, cron, etc.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 14 Sep 2004 21:55:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/executing-top-in-the-background/m-p/3378962#M197181</guid>
      <dc:creator>D Block 2</dc:creator>
      <dc:date>2004-09-14T21:55:50Z</dc:date>
    </item>
    <item>
      <title>Re: Executing 'TOP' in the background</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/executing-top-in-the-background/m-p/3378963#M197182</link>
      <description>Andy,&lt;BR /&gt;Top will definitely do the trick.&lt;BR /&gt;Also you can use SAR (System Activity reporter to get the Statistics)&lt;BR /&gt;Use: # sar -u &lt;BR /&gt;See man sar to get more details.&lt;BR /&gt;Regards,</description>
      <pubDate>Wed, 15 Sep 2004 00:02:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/executing-top-in-the-background/m-p/3378963#M197182</guid>
      <dc:creator>Bharat Katkar</dc:creator>
      <dc:date>2004-09-15T00:02:46Z</dc:date>
    </item>
    <item>
      <title>Re: Executing 'TOP' in the background</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/executing-top-in-the-background/m-p/3378964#M197183</link>
      <description>If you want to monitor the specific application with top then,&lt;BR /&gt;&lt;BR /&gt; make a script as,&lt;BR /&gt;&lt;BR /&gt; # Start the application&lt;BR /&gt; ..........&lt;BR /&gt;&lt;BR /&gt; # get the process count&lt;BR /&gt; count=$(ps -ef | grep -v grep | wc -l)&lt;BR /&gt;&lt;BR /&gt; # Run the top as,&lt;BR /&gt; top -d 1 -f filename -n $count&lt;BR /&gt;&lt;BR /&gt; It will update the top information's of all process there in filename&lt;BR /&gt;&lt;BR /&gt; Note: top will run only once.&lt;BR /&gt;&lt;BR /&gt; If you want automate then,&lt;BR /&gt;&lt;BR /&gt; try to put in loop as,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; while true; do&lt;BR /&gt; &lt;BR /&gt;  # top execution&lt;BR /&gt;  # Sleep time&lt;BR /&gt;  # check process running / stopping&lt;BR /&gt;  # If stopped,&lt;BR /&gt;  stop execution&lt;BR /&gt;&lt;BR /&gt; done&lt;BR /&gt;&lt;BR /&gt; Use file on top as with time and date or counts to identify the information&lt;BR /&gt;  &lt;BR /&gt;</description>
      <pubDate>Wed, 15 Sep 2004 01:15:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/executing-top-in-the-background/m-p/3378964#M197183</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2004-09-15T01:15:00Z</dc:date>
    </item>
    <item>
      <title>Re: Executing 'TOP' in the background</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/executing-top-in-the-background/m-p/3378965#M197184</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;you could run the "top" command with the "-f" option which writes into a file (in the background)&lt;BR /&gt;&lt;BR /&gt;top -d&lt;COUNT&gt; -f &lt;FILE&gt;&lt;BR /&gt;&lt;BR /&gt;Regards&lt;BR /&gt;&lt;BR /&gt;Franky&lt;BR /&gt;&lt;BR /&gt;&lt;/FILE&gt;&lt;/COUNT&gt;</description>
      <pubDate>Wed, 15 Sep 2004 02:48:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/executing-top-in-the-background/m-p/3378965#M197184</guid>
      <dc:creator>Franky_1</dc:creator>
      <dc:date>2004-09-15T02:48:08Z</dc:date>
    </item>
    <item>
      <title>Re: Executing 'TOP' in the background</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/executing-top-in-the-background/m-p/3378966#M197185</link>
      <description>Thanks all for the reply. I have one more query. I don't find the '-f' option for 'top' in redhat LINUX. It has '-b' option but this option does not seem to work for collecting the outputs in a particular file. When I redirect the output of 'top' to a file, I find that there are lots of special charaters in the file. &lt;BR /&gt;&lt;BR /&gt;Can anyone please help me out of this&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Andy</description>
      <pubDate>Wed, 15 Sep 2004 12:20:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/executing-top-in-the-background/m-p/3378966#M197185</guid>
      <dc:creator>Anand_30</dc:creator>
      <dc:date>2004-09-15T12:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: Executing 'TOP' in the background</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/executing-top-in-the-background/m-p/3378967#M197186</link>
      <description>We can do it very effeciently as,&lt;BR /&gt;&lt;BR /&gt; # Collect process id of started process&lt;BR /&gt; top -p &lt;PID&gt; -n 1 -b&lt;BR /&gt;&lt;BR /&gt; It will give the informations of that process at that time ( only one count )&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt; If you want then redirect into one analysis file as,&lt;BR /&gt;&lt;BR /&gt; top -p &lt;PID&gt; -n 1 -b &amp;gt; /tmp/topinfo_&lt;APPLICATIONNAME&gt;.log&lt;BR /&gt;&lt;BR /&gt; Note: And it is HP-UX related one. If you want the specific then go on linux related on itrc. :-)&lt;BR /&gt;&lt;BR /&gt;HTH.&lt;/APPLICATIONNAME&gt;&lt;/PID&gt;&lt;/PID&gt;</description>
      <pubDate>Wed, 15 Sep 2004 22:56:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/executing-top-in-the-background/m-p/3378967#M197186</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2004-09-15T22:56:44Z</dc:date>
    </item>
  </channel>
</rss>

