<?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: sar usage in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/sar-usage/m-p/3609531#M19262</link>
    <description>Hi Danny ,&lt;BR /&gt;&lt;BR /&gt;You can use sar to capture the CPU usage data over a long time.&lt;BR /&gt;vmstat for Virtual Memory statistics.&lt;BR /&gt;iostat for io statistics.&lt;BR /&gt;&lt;BR /&gt;###########################################&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;touch sar_cpu.txt ; touch vmstat.txt ; touch iostat.txt&lt;BR /&gt;i=0&lt;BR /&gt;while [ $i -le 60 ]&lt;BR /&gt;do&lt;BR /&gt;sar -u 5 12 &amp;gt;&amp;gt;sar_cpu.txt # 5 second interval .&lt;BR /&gt;vmstat 5 12 &amp;gt;&amp;gt; vmstat.txt&lt;BR /&gt;iostat 5 12 &amp;gt;&amp;gt; iostat.txt&lt;BR /&gt;echo "-----------------------"&lt;BR /&gt;i=`expr $i + 1`&lt;BR /&gt;done&lt;BR /&gt;echo " SAR data collected for 1 hr complete "&lt;BR /&gt;echo " CPU Data stored in the file sar_cpu.txt "&lt;BR /&gt;echo "Vmstat Data stored in the file vmstat.txt "&lt;BR /&gt;echo "iostat Data stored in the file iostat.txt "&lt;BR /&gt;echo "------------------------------------"&lt;BR /&gt;&lt;BR /&gt;###########################################&lt;BR /&gt;&lt;BR /&gt;You cannot measure the CPU utilisation for a particular application through sar , but hope you can do it with top , ps  command. grep for cpu usage and sort the output.&lt;BR /&gt;&lt;BR /&gt;cheers,&lt;BR /&gt;Raj.</description>
    <pubDate>Tue, 23 Aug 2005 08:37:23 GMT</pubDate>
    <dc:creator>Raj D.</dc:creator>
    <dc:date>2005-08-23T08:37:23Z</dc:date>
    <item>
      <title>sar usage</title>
      <link>https://community.hpe.com/t5/operating-system-linux/sar-usage/m-p/3609529#M19260</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I would like to measure the CPU utilization over a period of time (by specifying the start and end times). &lt;BR /&gt;&lt;BR /&gt;May I know how do I specify the options to the "sar" command to in order not to specify the referenced log file? This is because I'm only interested in measuring the CPU utilization of particular time frame.Attached is the text file containing the error output when specifying the -s and -e options without the -f option for the log file. &lt;BR /&gt;&lt;BR /&gt;Also,how to use sar to measure the CPU utilization for a particular application?&lt;BR /&gt;&lt;BR /&gt;Could anyone kindly help me out?&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 23 Aug 2005 07:24:38 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/sar-usage/m-p/3609529#M19260</guid>
      <dc:creator>Danny Fang</dc:creator>
      <dc:date>2005-08-23T07:24:38Z</dc:date>
    </item>
    <item>
      <title>Re: sar usage</title>
      <link>https://community.hpe.com/t5/operating-system-linux/sar-usage/m-p/3609530#M19261</link>
      <description>If I understood right, what you want to is not possible with the sar command. Do you want to collect performance statistics for a specific time? &lt;BR /&gt;&lt;BR /&gt;The -s and -e options are only valid when you analyze a log file.&lt;BR /&gt;&lt;BR /&gt;If you want to collect performance counters for a specific time, you should use the sadc command in a crontab entry.</description>
      <pubDate>Tue, 23 Aug 2005 07:48:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/sar-usage/m-p/3609530#M19261</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2005-08-23T07:48:06Z</dc:date>
    </item>
    <item>
      <title>Re: sar usage</title>
      <link>https://community.hpe.com/t5/operating-system-linux/sar-usage/m-p/3609531#M19262</link>
      <description>Hi Danny ,&lt;BR /&gt;&lt;BR /&gt;You can use sar to capture the CPU usage data over a long time.&lt;BR /&gt;vmstat for Virtual Memory statistics.&lt;BR /&gt;iostat for io statistics.&lt;BR /&gt;&lt;BR /&gt;###########################################&lt;BR /&gt;#!/usr/bin/ksh&lt;BR /&gt;touch sar_cpu.txt ; touch vmstat.txt ; touch iostat.txt&lt;BR /&gt;i=0&lt;BR /&gt;while [ $i -le 60 ]&lt;BR /&gt;do&lt;BR /&gt;sar -u 5 12 &amp;gt;&amp;gt;sar_cpu.txt # 5 second interval .&lt;BR /&gt;vmstat 5 12 &amp;gt;&amp;gt; vmstat.txt&lt;BR /&gt;iostat 5 12 &amp;gt;&amp;gt; iostat.txt&lt;BR /&gt;echo "-----------------------"&lt;BR /&gt;i=`expr $i + 1`&lt;BR /&gt;done&lt;BR /&gt;echo " SAR data collected for 1 hr complete "&lt;BR /&gt;echo " CPU Data stored in the file sar_cpu.txt "&lt;BR /&gt;echo "Vmstat Data stored in the file vmstat.txt "&lt;BR /&gt;echo "iostat Data stored in the file iostat.txt "&lt;BR /&gt;echo "------------------------------------"&lt;BR /&gt;&lt;BR /&gt;###########################################&lt;BR /&gt;&lt;BR /&gt;You cannot measure the CPU utilisation for a particular application through sar , but hope you can do it with top , ps  command. grep for cpu usage and sort the output.&lt;BR /&gt;&lt;BR /&gt;cheers,&lt;BR /&gt;Raj.</description>
      <pubDate>Tue, 23 Aug 2005 08:37:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/sar-usage/m-p/3609531#M19262</guid>
      <dc:creator>Raj D.</dc:creator>
      <dc:date>2005-08-23T08:37:23Z</dc:date>
    </item>
    <item>
      <title>Re: sar usage</title>
      <link>https://community.hpe.com/t5/operating-system-linux/sar-usage/m-p/3609532#M19263</link>
      <description>Danny,&lt;BR /&gt;use this syntax to have a complete report for sar ( included CPU utilization ):&lt;BR /&gt;&lt;BR /&gt;sar -o sarfile 5 60&lt;BR /&gt;sar -Af sarfile &amp;gt; sar.report&lt;BR /&gt;&lt;BR /&gt;Then have a look to the file sar.report&lt;BR /&gt;&lt;BR /&gt;For the interpretation, have a look to the CPU section&lt;BR /&gt;&lt;BR /&gt;Rgds,&lt;BR /&gt;Alex</description>
      <pubDate>Thu, 25 Aug 2005 08:40:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/sar-usage/m-p/3609532#M19263</guid>
      <dc:creator>Alessandro Pilati</dc:creator>
      <dc:date>2005-08-25T08:40:45Z</dc:date>
    </item>
  </channel>
</rss>

