<?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: Perl Script to disk utilization report in csv format in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-to-disk-utilization-report-in-csv-format/m-p/3188890#M164313</link>
    <description>ETOOCOMPACT :) &amp;lt;= Too many questions in this line.&lt;BR /&gt;&lt;BR /&gt;Disk usage to csv is easy.&lt;BR /&gt;&lt;BR /&gt;--8&amp;lt;---&lt;BR /&gt;#!/opt/perl/bin/perl&lt;BR /&gt;&lt;BR /&gt;use strict;&lt;BR /&gt;use warnings;&lt;BR /&gt;&lt;BR /&gt;use Text::CSV_XS;&lt;BR /&gt;my $csv = Text::CSV_XS-&amp;gt;new ({&lt;BR /&gt;    binary       =&amp;gt; 1,&lt;BR /&gt;    sep_char     =&amp;gt; ";",        # Assuming M$ as target, who think the 'C'&lt;BR /&gt;    always_quote =&amp;gt; 1,          # in CSV is for Semi-Colon :(&lt;BR /&gt;    });&lt;BR /&gt;&lt;BR /&gt;my %di;&lt;BR /&gt;my $sum = 0;&lt;BR /&gt;foreach (`bdf`) {&lt;BR /&gt;    chomp;&lt;BR /&gt;    my ($fs, $kb, $us, $av, $pct, $mnt) = split m/\s+/;&lt;BR /&gt;    $pct =~ s/%//;&lt;BR /&gt;    $sum += $kb;&lt;BR /&gt;    $di{$fs} = [ $kb, $us, $av, $pct, $mnt ];&lt;BR /&gt;    $csv-&amp;gt;combine ($fs, @{$di{$fs}});&lt;BR /&gt;    print $csv-&amp;gt;string, "\r\n";&lt;BR /&gt;    }&lt;BR /&gt;&lt;BR /&gt;# Now you could use Tk to display a Pie Chart&lt;BR /&gt;&lt;BR /&gt;#use Tk;&lt;BR /&gt;&lt;BR /&gt;# create a canvas&lt;BR /&gt;&lt;BR /&gt;# $sum is the total size available&lt;BR /&gt;foreach my $fs (sort { $di{$a}[0] &amp;lt;=&amp;gt; $di{$b}[0] } keys %di) { # sort by fs-size&lt;BR /&gt;    # draw an arc&lt;BR /&gt;    my $p = $di{$fs}[0] &amp;gt; 0 ? 360 * $sum / $di{$fs}[0] : 1; # size of the arc in&lt;BR /&gt; degrees&lt;BR /&gt;    }&lt;BR /&gt;&lt;BR /&gt;# MainLoop;&lt;BR /&gt;--&amp;gt;8---&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn&lt;BR /&gt;</description>
    <pubDate>Wed, 11 Feb 2004 08:40:18 GMT</pubDate>
    <dc:creator>H.Merijn Brand (procura</dc:creator>
    <dc:date>2004-02-11T08:40:18Z</dc:date>
    <item>
      <title>Perl Script to disk utilization report in csv format</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-to-disk-utilization-report-in-csv-format/m-p/3188889#M164312</link>
      <description>Has anybody got the perl script for Disk/Storage utilization in csv format  and which puts output in pie chart.</description>
      <pubDate>Wed, 11 Feb 2004 08:09:37 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-to-disk-utilization-report-in-csv-format/m-p/3188889#M164312</guid>
      <dc:creator>manu_8</dc:creator>
      <dc:date>2004-02-11T08:09:37Z</dc:date>
    </item>
    <item>
      <title>Re: Perl Script to disk utilization report in csv format</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-to-disk-utilization-report-in-csv-format/m-p/3188890#M164313</link>
      <description>ETOOCOMPACT :) &amp;lt;= Too many questions in this line.&lt;BR /&gt;&lt;BR /&gt;Disk usage to csv is easy.&lt;BR /&gt;&lt;BR /&gt;--8&amp;lt;---&lt;BR /&gt;#!/opt/perl/bin/perl&lt;BR /&gt;&lt;BR /&gt;use strict;&lt;BR /&gt;use warnings;&lt;BR /&gt;&lt;BR /&gt;use Text::CSV_XS;&lt;BR /&gt;my $csv = Text::CSV_XS-&amp;gt;new ({&lt;BR /&gt;    binary       =&amp;gt; 1,&lt;BR /&gt;    sep_char     =&amp;gt; ";",        # Assuming M$ as target, who think the 'C'&lt;BR /&gt;    always_quote =&amp;gt; 1,          # in CSV is for Semi-Colon :(&lt;BR /&gt;    });&lt;BR /&gt;&lt;BR /&gt;my %di;&lt;BR /&gt;my $sum = 0;&lt;BR /&gt;foreach (`bdf`) {&lt;BR /&gt;    chomp;&lt;BR /&gt;    my ($fs, $kb, $us, $av, $pct, $mnt) = split m/\s+/;&lt;BR /&gt;    $pct =~ s/%//;&lt;BR /&gt;    $sum += $kb;&lt;BR /&gt;    $di{$fs} = [ $kb, $us, $av, $pct, $mnt ];&lt;BR /&gt;    $csv-&amp;gt;combine ($fs, @{$di{$fs}});&lt;BR /&gt;    print $csv-&amp;gt;string, "\r\n";&lt;BR /&gt;    }&lt;BR /&gt;&lt;BR /&gt;# Now you could use Tk to display a Pie Chart&lt;BR /&gt;&lt;BR /&gt;#use Tk;&lt;BR /&gt;&lt;BR /&gt;# create a canvas&lt;BR /&gt;&lt;BR /&gt;# $sum is the total size available&lt;BR /&gt;foreach my $fs (sort { $di{$a}[0] &amp;lt;=&amp;gt; $di{$b}[0] } keys %di) { # sort by fs-size&lt;BR /&gt;    # draw an arc&lt;BR /&gt;    my $p = $di{$fs}[0] &amp;gt; 0 ? 360 * $sum / $di{$fs}[0] : 1; # size of the arc in&lt;BR /&gt; degrees&lt;BR /&gt;    }&lt;BR /&gt;&lt;BR /&gt;# MainLoop;&lt;BR /&gt;--&amp;gt;8---&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn&lt;BR /&gt;</description>
      <pubDate>Wed, 11 Feb 2004 08:40:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-to-disk-utilization-report-in-csv-format/m-p/3188890#M164313</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2004-02-11T08:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: Perl Script to disk utilization report in csv format</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-to-disk-utilization-report-in-csv-format/m-p/3188891#M164314</link>
      <description>BTW skipping the header is left as an exercise to the reader. Skipping it will remove the warning :)&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
      <pubDate>Wed, 11 Feb 2004 08:45:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-script-to-disk-utilization-report-in-csv-format/m-p/3188891#M164314</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2004-02-11T08:45:53Z</dc:date>
    </item>
  </channel>
</rss>

