<?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 -d formatting in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/sar-d-formatting/m-p/5152117#M666307</link>
    <description>You have some sample output from sa07-disk.out?</description>
    <pubDate>Fri, 23 Jan 2009 03:44:27 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2009-01-23T03:44:27Z</dc:date>
    <item>
      <title>sar -d formatting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sar-d-formatting/m-p/5152116#M666306</link>
      <description>I have a very large sar output file and from it I have extracted the sar -d info to a text file as follows:&lt;BR /&gt;&lt;BR /&gt;sar -d -f sa07 &amp;gt; sa07-disk.out&lt;BR /&gt;&lt;BR /&gt;Now what I'm trying to figure out is if there's any way to get dates in front of every entry in my output by reformatting it via a script or set of commands..   I'm ultimately trying to import this data into a spreadsheet to sort and look at highest to lowest colums, but I also need to know the times for each of the entries I'm interested in.&lt;BR /&gt;&lt;BR /&gt;Any ideas that can be shared would be greatly appreciated.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;/KPS</description>
      <pubDate>Fri, 23 Jan 2009 03:08:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sar-d-formatting/m-p/5152116#M666306</guid>
      <dc:creator>KPS</dc:creator>
      <dc:date>2009-01-23T03:08:49Z</dc:date>
    </item>
    <item>
      <title>Re: sar -d formatting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sar-d-formatting/m-p/5152117#M666307</link>
      <description>You have some sample output from sa07-disk.out?</description>
      <pubDate>Fri, 23 Jan 2009 03:44:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sar-d-formatting/m-p/5152117#M666307</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2009-01-23T03:44:27Z</dc:date>
    </item>
    <item>
      <title>Re: sar -d formatting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sar-d-formatting/m-p/5152118#M666308</link>
      <description>&lt;!--!*#--&gt;Hello,&lt;BR /&gt;&lt;BR /&gt;Several years ago, I did just that. Albeit,&lt;BR /&gt;it was for Solaris servers but the logic&lt;BR /&gt;is the same.&lt;BR /&gt;&lt;BR /&gt;Here is the Perl script:&lt;BR /&gt;&lt;BR /&gt;#!/usr/bin/perl&lt;BR /&gt;&lt;BR /&gt;# 00:00:00   device  %busy   avque   r+w/s  blks/s  avwait  avserv&lt;BR /&gt;&lt;BR /&gt;#use strict;&lt;BR /&gt;use Getopt::Std;&lt;BR /&gt;use File::Basename;&lt;BR /&gt;&lt;BR /&gt;use vars qw(@Header $z %Disk %RW @Keyspaces @Onetime $Time &lt;BR /&gt;$FF $SAFile $Disk @WholeComplex $RW %WholeComplex @Servdata&lt;BR /&gt;$Realmonth $Month $Sec $Min $Hour $DayOfMonth $Month $Year &lt;BR /&gt;$Result $FR $DayOfWeek $DayofYear $IsDST);&lt;BR /&gt;&lt;BR /&gt;($Sec, $Min, $Hour, $DayOfMonth, $Month, $Year, $DayOfWeek, $DayofYear, $IsDST) = localtime ;&lt;BR /&gt;&lt;BR /&gt;# localtime returns January..December as 0..11.&lt;BR /&gt;$Realmonth = (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec)[$Month];&lt;BR /&gt;$Month++;&lt;BR /&gt;$Year = 1900 + $Year;&lt;BR /&gt;&lt;BR /&gt;($::opt_f) = ();  #avoid warning message&lt;BR /&gt;getopts('f:');&lt;BR /&gt;$::SAFile = $::opt_f;&lt;BR /&gt;&lt;BR /&gt;if (! "$SAFile" ) {&lt;BR /&gt; $FF = "";&lt;BR /&gt;} else {&lt;BR /&gt; $FF = "-f $SAFile";&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;$FR = basename($SAFile);&lt;BR /&gt;&lt;BR /&gt;print "Processing SAR file $SAFile ($FR)\n";&lt;BR /&gt;&lt;BR /&gt;$Result1 = "/mydir/mysrv-sar-data/${FR}${Realmonth}${Year}-DISK_RWS.txt";&lt;BR /&gt;$Result2 = "/mydir/mysrv-sar-data/${FR}${Realmonth}${Year}-DISK_BUSY.txt";&lt;BR /&gt;$Result3 = "/mydir/mysrv-sar-data/${FR}${Realmonth}${Year}-DISK_AVSERV.txt";&lt;BR /&gt;&lt;BR /&gt;open(To1, "&amp;gt;$Result1") or die "ERROR: Can't open $Result: $!";&lt;BR /&gt;open(To2, "&amp;gt;$Result2") or die "ERROR: Can't open $Result: $!";&lt;BR /&gt;open(To3, "&amp;gt;$Result3") or die "ERROR: Can't open $Result: $!";&lt;BR /&gt;&lt;BR /&gt;open(FROM,"sar -d $FF | awk '! /%/ &amp;amp;&amp;amp; ! /,/ {print}'|") || die "Cannot open sar data";&lt;BR /&gt;while (&lt;FROM&gt;) {&lt;BR /&gt;   chomp;&lt;BR /&gt;   if (/:/ .. /^$/) {&lt;BR /&gt;      @Keyspaces = split(/\s+/, $_);&lt;BR /&gt;      if (grep(/:/, $_)) {&lt;BR /&gt;         $Time = $Keyspaces[0];&lt;BR /&gt;         printf To1 "\n$Time ";&lt;BR /&gt;         printf To2 "\n$Time ";&lt;BR /&gt;         printf To3 "\n$Time ";&lt;BR /&gt;         if (! grep(/\bTimeStamp/, @Header)) {&lt;BR /&gt;            push @Header, "\nTimeStamp ";&lt;BR /&gt;         }&lt;BR /&gt;      }&lt;BR /&gt;  &lt;BR /&gt;      $Disk{$Time} = $Keyspaces[1];&lt;BR /&gt;      $Busy{$Time} = $Keyspaces[2];&lt;BR /&gt;      $Avserv{$Time} = $Keyspaces[$#{Keyspaces}];&lt;BR /&gt;      $RW{$Time} = $Keyspaces[4];&lt;BR /&gt;      printf To1 "$RW{$Time} ";&lt;BR /&gt;      printf To2 "$Busy{$Time} ";&lt;BR /&gt;      printf To3 "$Avserv{$Time} ";&lt;BR /&gt;      if (! grep(/\b$Disk{$Time}/, @Header)) {&lt;BR /&gt;         push @Header, "$Disk{$Time} ";&lt;BR /&gt;      }&lt;BR /&gt;   }&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;printf To1 "@Header\n";&lt;BR /&gt;printf To2 "@Header\n";&lt;BR /&gt;printf To3 "@Header\n";&lt;BR /&gt;exit(0);&lt;BR /&gt;&lt;BR /&gt;In this specific case, I save different&lt;BR /&gt;metrics into different files, but it&lt;BR /&gt;is quite easy to put them into the same file :)&lt;BR /&gt;&lt;BR /&gt;I also just tested my old script on Fedora 10&lt;BR /&gt;server and it worked. Here are parts of&lt;BR /&gt;myhost-sa15Jan2009-DISK_RWS.txt:&lt;BR /&gt;&lt;BR /&gt;...&lt;BR /&gt;10:30:01 0.00 &lt;BR /&gt;10:30:01 0.00 &lt;BR /&gt;10:30:01 0.00 &lt;BR /&gt;10:30:01 0.00 &lt;BR /&gt;10:30:01 0.00 &lt;BR /&gt;10:30:01 0.00 &lt;BR /&gt;10:30:01 4.33 &lt;BR /&gt;10:30:01 4.33 &lt;BR /&gt;10:30:01 4.33 &lt;BR /&gt;10:30:01 0.00 &lt;BR /&gt;10:30:01 0.00 &lt;BR /&gt;10:40:01 0.03 &lt;BR /&gt;10:40:01 0.00 &lt;BR /&gt;10:40:01 0.00 &lt;BR /&gt;10:40:01 0.00 &lt;BR /&gt;...&lt;BR /&gt;&lt;BR /&gt;I hope it helps you,&lt;BR /&gt;&lt;BR /&gt;VK2COT&lt;/FROM&gt;</description>
      <pubDate>Fri, 23 Jan 2009 04:50:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sar-d-formatting/m-p/5152118#M666308</guid>
      <dc:creator>VK2COT</dc:creator>
      <dc:date>2009-01-23T04:50:05Z</dc:date>
    </item>
    <item>
      <title>Re: sar -d formatting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sar-d-formatting/m-p/5152119#M666309</link>
      <description>&lt;!--!*#--&gt;By the way, here is how raw sar files look like&lt;BR /&gt;(so that you can compare them with what&lt;BR /&gt;gets reported via my Perl script):&lt;BR /&gt;&lt;BR /&gt;Linux 2.6.27.9-159.fc10.i686 (bmyhost.mydom.dom)  01/16/2009&lt;BR /&gt;&lt;BR /&gt;12:00:02 AM       DEV       tps  rd_sec/s  wr_sec/s  avgrq-sz  avgqu-sz     awai&lt;BR /&gt;t     svctm     %util&lt;BR /&gt;12:10:02 AM    dev8-0      0.71      1.20     17.36     26.33      0.03     39.9&lt;BR /&gt;0      1.19      0.08&lt;BR /&gt;12:10:02 AM    dev8-1      0.00      0.00      0.00      0.00      0.00      0.0&lt;BR /&gt;0      0.00      0.00&lt;BR /&gt;12:10:02 AM    dev8-2      0.40      0.00      8.09     20.49      0.02     42.7&lt;BR /&gt;6      1.11      0.04&lt;BR /&gt;12:10:02 AM    dev8-3      0.29      0.53      9.17     33.47      0.01     37.2&lt;BR /&gt;5      2.67      0.08&lt;BR /&gt;12:10:02 AM    dev8-4      0.00      0.00      0.00      0.00      0.00      0.0&lt;BR /&gt;0      0.00      0.00&lt;BR /&gt;12:10:02 AM    dev8-5      0.02      0.67      0.09     38.00      0.00     22.0&lt;BR /&gt;8     22.00      0.04&lt;BR /&gt;12:10:02 AM    dev8-6      0.00      0.00      0.00      0.00      0.00      0.0&lt;BR /&gt;0      0.00      0.00&lt;BR /&gt;12:10:02 AM    dev8-7      0.00      0.00      0.00      0.00      0.00      0.0&lt;BR /&gt;0      0.00      0.00&lt;BR /&gt;12:10:02 AM   dev8-16      0.00      0.00      0.00      0.00      0.00      0.0&lt;BR /&gt;0      0.00      0.00&lt;BR /&gt;&lt;BR /&gt;VK2COT</description>
      <pubDate>Fri, 23 Jan 2009 04:53:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sar-d-formatting/m-p/5152119#M666309</guid>
      <dc:creator>VK2COT</dc:creator>
      <dc:date>2009-01-23T04:53:57Z</dc:date>
    </item>
    <item>
      <title>Re: sar -d formatting</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/sar-d-formatting/m-p/5152120#M666310</link>
      <description>We're all set here, thanks for the recommendation V2COT.&lt;BR /&gt;&lt;BR /&gt;/KPS</description>
      <pubDate>Fri, 23 Jan 2009 13:59:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/sar-d-formatting/m-p/5152120#M666310</guid>
      <dc:creator>KPS</dc:creator>
      <dc:date>2009-01-23T13:59:39Z</dc:date>
    </item>
  </channel>
</rss>

