2015-02-05 01:39 AM
I am bulding a workflow to monitor volumes and exapnd vol sizes.
I had written a filter that gets all volumes sizes above "threshold" and i want to mail all these details for approval.
And here my questions are
1)how to get all details returned by filter
2)How to email these details
2015-02-05 04:32 AM
Dump the filtered data in an XCEL.
How you can do it?
Please see the sample code below.
This is the "Create CSV Report-FLI" available in http://automationstore.netapp.com, under the "OFFLine Foreign Lun Import pack".
my $FileNamePrefix = 'lun_report';
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime();
$year += 1900;
my $CurrentTime = $mday . "_" . $mon . "_" . $year . "__" . $hour . "_" . $min . "_" . $sec;
#Creating CSV file name
$FileName = $FileNamePrefix . "_" . $CurrentTime . ".csv";
my $wfa_util = WFAUtil->new();
$wfa_util->sendLog('INFO', 'Creating CSV file: ' . $FileName);
my $query="SELECT * FROM lun_import"; -->Here you need to put your volume query.
@data = $wfa_util->invokeMySqlQuery($query,$database);
$length = @data;
open(FILE, ">$FileName"); # Open for output
print FILE "id,vserver_name,foreign_disk,path,import_home_node,administrative_status,compared_blocks,estimated_remaining_duration,".
for (my $index =0; $index < $length; $index++)
if ($data[$index] ne "\n")
if ($data[$index] eq "")
print FILE "-,";
print FILE "$data[$index]" . ",";
print FILE $data[$index];
close(FILE); # Closing file
Send the File.
Please use the "Send Email" code, which is part of WFA release.
You need to customize "Send Email" for attaching the CSV file created in the above segment.
Sample code here.
Put approval point after that.
Followed by the next command.