<?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: from wfa command Data not writting to .CSV file in Active IQ Unified Manager Discussions</title>
    <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/from-wfa-command-Data-not-writting-to-CSV-file/m-p/100299#M17704</link>
    <description>&lt;P&gt;Yes i can see that line.&lt;/P&gt;&lt;P&gt;I think the query is working and i tested the query by creating the filter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And how to chek the data is coming to "@data array" from query.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 06 Feb 2015 12:06:25 GMT</pubDate>
    <dc:creator>Aswani_Kumar</dc:creator>
    <dc:date>2015-02-06T12:06:25Z</dc:date>
    <item>
      <title>from wfa command Data not writting to .CSV file</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/from-wfa-command-Data-not-writting-to-CSV-file/m-p/100295#M17700</link>
      <description>&lt;P&gt;I am trying to create a command in perl that retrives volumes details and ouputs to a file (.CSV)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;use strict;&lt;BR /&gt;use Getopt::Long;&lt;BR /&gt;use WFAUtil;&lt;BR /&gt;&lt;BR /&gt;my $FileName;&lt;BR /&gt;my $FileNamePrefix = 'c:/vol_report';&lt;BR /&gt;&lt;BR /&gt;#Creating CSV file name&lt;BR /&gt;$FileName = $FileNamePrefix.".csv";&lt;BR /&gt;&lt;BR /&gt;my $wfa_util = WFAUtil-&amp;gt;new();&lt;BR /&gt;$wfa_util-&amp;gt;sendLog('INFO', 'Creating CSV file: ' . $FileName);&lt;BR /&gt;&lt;BR /&gt;my $query="SELECT&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; aggr.name AS aggr_name,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (((aggr.used_size_mb )/ aggr.size_mb) * 100) AS aggr_used_percentage,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ((aggr.available_size_mb/aggr.size_mb)*100) AS aggr_Available_Percentage,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; aggr.available_size_mb AS aggr_available_size_mb,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; vol.name AS 'name',&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (((vol.used_size_mb )/ vol.size_mb) * 100) AS vol_used_percentage,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; vol.available_size_mb,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ((( vol.available_size_mb)/vol.size_mb)*100) AS vol_avilable_percentage,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cluster.primary_address as 'vserver.cluster.primary_address',&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; vserver.name as 'vserver.name'&lt;BR /&gt;FROM&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cm_storage.cluster AS cluster,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cm_storage.vserver AS vserver,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cm_storage.aggregate AS aggr&lt;BR /&gt;JOIN&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cm_storage.volume AS vol&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ON aggr.id = vol.aggregate_id&lt;BR /&gt;WHERE&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; vol.used_size_mb&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ) / vol.size_mb&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ) * 100 &amp;gt;= 40&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; AND (&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; aggr.used_size_mb&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ) / aggr.size_mb&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ) * 100 &amp;gt;= 30&lt;BR /&gt;group by&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; vol.name,&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; aggr.name";&lt;BR /&gt;my $database="cm_storage";&lt;BR /&gt;my &lt;a href="https://community.netapp.com/t5/user/viewprofilepage/user-id/31071"&gt;@Data&lt;/a&gt;;&lt;BR /&gt;my $length;&lt;BR /&gt;&lt;BR /&gt;eval {&lt;BR /&gt;&lt;a href="https://community.netapp.com/t5/user/viewprofilepage/user-id/31071"&gt;@Data&lt;/a&gt; = $wfa_util-&amp;gt;invokeMySqlQuery($query,$database);&lt;BR /&gt;&lt;BR /&gt;};&lt;BR /&gt;&lt;BR /&gt;$length = &lt;a href="https://community.netapp.com/t5/user/viewprofilepage/user-id/31071"&gt;@Data&lt;/a&gt;;&lt;BR /&gt;&lt;BR /&gt;open(FILE, "&amp;gt;$FileName");&lt;BR /&gt;print FILE "aggr_name,aggr_used_percentage,name,vol_avilable_percentage,vol.available_size_mb,vserver.cluster.primary_address,vserver.name";&lt;BR /&gt;for (my $index =0; $index &amp;lt; $length; $index++)&lt;BR /&gt;{&lt;BR /&gt;if ($data[$index] ne "\n")&lt;BR /&gt;{&lt;BR /&gt;if ($data[$index] eq "")&lt;BR /&gt;{&lt;BR /&gt;print FILE "-,";&lt;BR /&gt;}&lt;BR /&gt;else {&lt;BR /&gt;print FILE "$data[$index]" . ",";&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;print FILE $data[$index];&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;close(FILE);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;file is creating but data was not getting written into it.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Jun 2025 05:08:51 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/from-wfa-command-Data-not-writting-to-CSV-file/m-p/100295#M17700</guid>
      <dc:creator>Aswani_Kumar</dc:creator>
      <dc:date>2025-06-05T05:08:51Z</dc:date>
    </item>
    <item>
      <title>Re: from wfa command Data not writting to .CSV file</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/from-wfa-command-Data-not-writting-to-CSV-file/m-p/100297#M17702</link>
      <description>&lt;P&gt;I am able to print with the same code below.&lt;/P&gt;&lt;P&gt;Are you not able to see this line in the file: "&lt;SPAN&gt;aggr_name,aggr_used_percentage,name,vol_avilable_&lt;/SPAN&gt;&lt;SPAN&gt;percentage,vol.available_size_mb,vserver.cluster.p&lt;/SPAN&gt;&lt;SPAN&gt;rimary_address,vserver.name"?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;If you are able to see the above line and not anything else, it might be that the query is not returning any results.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Abhi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Feb 2015 11:42:44 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/from-wfa-command-Data-not-writting-to-CSV-file/m-p/100297#M17702</guid>
      <dc:creator>abhit</dc:creator>
      <dc:date>2015-02-06T11:42:44Z</dc:date>
    </item>
    <item>
      <title>Re: from wfa command Data not writting to .CSV file</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/from-wfa-command-Data-not-writting-to-CSV-file/m-p/100299#M17704</link>
      <description>&lt;P&gt;Yes i can see that line.&lt;/P&gt;&lt;P&gt;I think the query is working and i tested the query by creating the filter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And how to chek the data is coming to "@data array" from query.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Feb 2015 12:06:25 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/from-wfa-command-Data-not-writting-to-CSV-file/m-p/100299#M17704</guid>
      <dc:creator>Aswani_Kumar</dc:creator>
      <dc:date>2015-02-06T12:06:25Z</dc:date>
    </item>
    <item>
      <title>Re: from wfa command Data not writting to .CSV file</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/from-wfa-command-Data-not-writting-to-CSV-file/m-p/100369#M17727</link>
      <description>&lt;P&gt;Simplified the query to test it and it worked, the rest of the code seems to be fine, &amp;nbsp;saved the aggregate names , could the problem be in the query ?.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#!/usr/bin/perl&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;use strict;&lt;BR /&gt;use Getopt::Long;&lt;BR /&gt;use WFAUtil;&lt;/P&gt;&lt;P&gt;my $FileName;&lt;BR /&gt;my $FileNamePrefix = 'c:/temp/vol_report';&lt;/P&gt;&lt;P&gt;#Creating CSV file name&lt;BR /&gt;$FileName = $FileNamePrefix.".csv";&lt;/P&gt;&lt;P&gt;my $wfa_util = WFAUtil-&amp;gt;new();&lt;BR /&gt;$wfa_util-&amp;gt;sendLog('INFO', 'Creating CSV file: ' . $FileName);&lt;/P&gt;&lt;P&gt;my $query="SELECT name from cm_storage.aggregate";&lt;BR /&gt;my $database="cm_storage";&lt;BR /&gt;my @data;&lt;BR /&gt;my $length;&lt;/P&gt;&lt;P&gt;eval {&lt;BR /&gt;@data = $wfa_util-&amp;gt;invokeMySqlQuery($query,$database);&lt;/P&gt;&lt;P&gt;};&lt;/P&gt;&lt;P&gt;$length = @data;&lt;/P&gt;&lt;P&gt;open(FILE, "&amp;gt;$FileName");&lt;BR /&gt;print FILE "aggr_name,aggr_used_percentage,name,vol_avilable_percentage,vol.available_size_mb,vserver.cluster.primary_address,vserver.name";&lt;BR /&gt;for (my $index =0; $index &amp;lt; $length; $index++)&lt;BR /&gt;{&lt;BR /&gt;if ($data[$index] ne "\n")&lt;BR /&gt;{&lt;BR /&gt;if ($data[$index] eq "")&lt;BR /&gt;{&lt;BR /&gt;print FILE "-,";&lt;BR /&gt;}&lt;BR /&gt;else {&lt;BR /&gt;print FILE "$data[$index]" . ",";&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;print FILE $data[$index];&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;close(FILE);&lt;/P&gt;</description>
      <pubDate>Mon, 09 Feb 2015 17:00:06 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/from-wfa-command-Data-not-writting-to-CSV-file/m-p/100369#M17727</guid>
      <dc:creator>trentino123</dc:creator>
      <dc:date>2015-02-09T17:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: from wfa command Data not writting to .CSV file</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/from-wfa-command-Data-not-writting-to-CSV-file/m-p/100371#M17728</link>
      <description>&lt;P&gt;tested if fully and it worked for me.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what I did was clone the create qtree in perl command, changed the String Representation to 'test' , and&amp;nbsp;removed al the Parameters definition.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the csv was successfully saved to : c:\temp\ as vol_report.csv ( note I changed the c:\ to c:\temp )&lt;/P&gt;</description>
      <pubDate>Mon, 09 Feb 2015 17:06:09 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/from-wfa-command-Data-not-writting-to-CSV-file/m-p/100371#M17728</guid>
      <dc:creator>trentino123</dc:creator>
      <dc:date>2015-02-09T17:06:09Z</dc:date>
    </item>
    <item>
      <title>Re: from wfa command Data not writting to .CSV file</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/from-wfa-command-Data-not-writting-to-CSV-file/m-p/100414#M17741</link>
      <description>&lt;P&gt;for the above code too, only csv file is creating .&lt;/P&gt;&lt;P&gt;What ever query is retriving those are not getting written to the csv file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The only data present in csv file is from this line not from the query .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;print FILE "aggr_name,aggr_used_percentage,name,vol_avilable_percentage,vol.available_size_mb,vserver.cluster.primary_address,vserver.name";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;could u please&amp;nbsp; check the file if u are getting query values or not .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;where can i find the "wfautil" module.I want to know what are the functions in it.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Feb 2015 17:22:34 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/from-wfa-command-Data-not-writting-to-CSV-file/m-p/100414#M17741</guid>
      <dc:creator>Aswani_Kumar</dc:creator>
      <dc:date>2015-02-10T17:22:34Z</dc:date>
    </item>
    <item>
      <title>Re: from wfa command Data not writting to .CSV file</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/from-wfa-command-Data-not-writting-to-CSV-file/m-p/100416#M17742</link>
      <description>&lt;P&gt;could u please post the modified qtree code .&lt;/P&gt;</description>
      <pubDate>Tue, 10 Feb 2015 17:31:14 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/from-wfa-command-Data-not-writting-to-CSV-file/m-p/100416#M17742</guid>
      <dc:creator>Aswani_Kumar</dc:creator>
      <dc:date>2015-02-10T17:31:14Z</dc:date>
    </item>
  </channel>
</rss>

