<?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: seeking config example for FSLU datasource from Excel in Active IQ Unified Manager Discussions</title>
    <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/seeking-config-example-for-FSLU-datasource-from-Excel/m-p/6798#M1539</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;here is a powershell script that will read from an excel file and inpit into the fslu database. It runs slow and needs to be re-engineered, but it works. Usage details in the code. Need to replace OCI server address, path to excel spreadsheet, and worksheet number for your environment. Also need some powershell mods.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#excel fsutil script - reads an excel spreadsheet and populates the host_data database in preperation for FSLU acquisition&lt;BR /&gt;# assumes an input file with the following format: hostname, ipaddress, file system, type, allocated, used, mount point&lt;BR /&gt;# requires mysql powershell driver - mysql-connector-net-6.8.3 - search, download, and install&lt;BR /&gt;# runs slow - need to convert to ADE Excel driver to speed up&lt;BR /&gt;# SG 1/10/14&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;# MySQL functions&lt;BR /&gt;function ConnectMySQL([string]$user,[string]$pass,[string]$MySQLHost,[string]$database) &lt;BR /&gt;{&lt;BR /&gt; # Load MySQL .NET Connector Objects&amp;nbsp; &lt;BR /&gt; [void][system.reflection.Assembly]::LoadWithPartialName("MySql.Data")&amp;nbsp;&amp;nbsp; &lt;BR /&gt; # Open Connection&amp;nbsp; &lt;BR /&gt; $connStr = "server=" + $MySQLHost + ";port=3306;uid=" + $user + ";pwd=" + $pass + ";database="+$database+";Pooling=FALSE"&amp;nbsp; &lt;BR /&gt; $conn = New-Object MySql.Data.MySqlClient.MySqlConnection($connStr)&amp;nbsp; &lt;BR /&gt; $conn.Open()&amp;nbsp; &lt;BR /&gt; $cmd = New-Object MySql.Data.MySqlClient.MySqlCommand("USE $database", $conn)&amp;nbsp; &lt;BR /&gt; return $conn &lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;function WriteMySQLQuery($conn, [string]$query) &lt;BR /&gt;{&amp;nbsp;&amp;nbsp; &lt;BR /&gt; $command = $conn.CreateCommand()&amp;nbsp; &lt;BR /&gt; $command.CommandText = $query&amp;nbsp; &lt;BR /&gt; $RowsInserted = $command.ExecuteNonQuery()&amp;nbsp; &lt;BR /&gt; $command.Dispose()&amp;nbsp; &lt;BR /&gt; if ($RowsInserted) {&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; return $RowInserted&amp;nbsp; } &lt;BR /&gt; else {&amp;nbsp;&amp;nbsp;&amp;nbsp; return $false&amp;nbsp; &lt;BR /&gt; }&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;# clean up function&lt;BR /&gt;function Release-Ref ($ref) {&lt;BR /&gt; ([System.Runtime.InteropServices.Marshal]::ReleaseComObject(&lt;BR /&gt; [System.__ComObject]$ref) -gt 0)&lt;BR /&gt; [System.GC]::Collect()&lt;BR /&gt; [System.GC]::WaitForPendingFinalizers()&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;# setup vars for OCI DB connection&lt;BR /&gt;$user = 'hosts'&lt;BR /&gt;$pass = 'netapp123'&lt;BR /&gt;$database = 'host_data'&lt;BR /&gt;############################################ change address of OCI host here ##################################################&lt;BR /&gt;$MySQLHost = '192.168.77.55' &lt;BR /&gt;###############################################################################################################################&lt;/P&gt;&lt;P&gt;# Connect to MySQL Database&lt;BR /&gt;$conn = ConnectMySQL $user $pass $MySQLHost $database&lt;/P&gt;&lt;P&gt;# create journal entry&lt;BR /&gt;$query = 'INSERT INTO journal (identifier, status) VALUES ("localscript","SUCCESS") ON DUPLICATE KEY UPDATE journal_update_timestamp = CURRENT_TIMESTAMP'&lt;BR /&gt;$Rows = WriteMySQLQuery $conn $query&lt;/P&gt;&lt;P&gt;# Creating excel object&lt;BR /&gt;$objExcel = new-object -comobject excel.application &lt;BR /&gt;$objExcel.Visible = $Tru&lt;BR /&gt;############################################ change excel file name / location here ###########################################&lt;BR /&gt;# Directory location where we have our excel files&lt;BR /&gt;$ExcelFilesLocation = "c:\powershell\"&lt;BR /&gt;# Open our excel file&lt;BR /&gt;$UserWorkBook = $objExcel.Workbooks.Open($ExcelFilesLocation + "wdc.xlsx") &lt;BR /&gt;$UserWorksheet = $UserWorkBook.Worksheets.Item(1)&lt;BR /&gt;###############################################################################################################################&lt;/P&gt;&lt;P&gt;# starting at row 2 to skip header data&lt;BR /&gt;$intRow = 2&lt;BR /&gt;# for each row in spreadsheet, read cells and write to OCI DB&lt;BR /&gt;Do {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # read current row&lt;BR /&gt;&amp;nbsp; $HostName = $UserWorksheet.Cells.Item($intRow, 1).Value()&lt;BR /&gt;&amp;nbsp; $IPaddress = $UserWorksheet.Cells.Item($intRow, 2).Value()&lt;BR /&gt;&amp;nbsp; $Filesystem = $UserWorksheet.Cells.Item($intRow, 3).Value() &lt;BR /&gt;&amp;nbsp; $type = $UserWorksheet.Cells.Item($intRow, 4).Value()&lt;BR /&gt;&amp;nbsp; $allocated = $UserWorksheet.Cells.Item($intRow, 5).Value()&lt;BR /&gt;&amp;nbsp; $used = $UserWorksheet.Cells.Item($intRow, 6).Value()&lt;BR /&gt; $mountpoint = $UserWorksheet.Cells.Item($intRow, 7).Value()&lt;BR /&gt; &lt;BR /&gt; # print values&lt;BR /&gt;&amp;nbsp;&amp;nbsp; "Row # " + $intRow&lt;BR /&gt;&amp;nbsp;&amp;nbsp; "host name " + $HostName&lt;BR /&gt;&amp;nbsp;&amp;nbsp; "ip address " + $IPaddress &lt;BR /&gt;&amp;nbsp;&amp;nbsp; "file system " + $Filesystem &lt;BR /&gt;&amp;nbsp;&amp;nbsp; "type" + $type &lt;BR /&gt;&amp;nbsp;&amp;nbsp; "allocated " + $allocated &lt;BR /&gt;&amp;nbsp;&amp;nbsp; "used " + $used &lt;BR /&gt;&amp;nbsp;&amp;nbsp; "mountpoint " + $mountpoint&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt; " "&lt;BR /&gt; &lt;BR /&gt;# insert into OCI DB&lt;BR /&gt; $query = "INSERT INTO HOST(hostname, journal_identifier) VALUES ('$HostName', 'localscript') ON DUPLICATE KEY UPDATE host_update_timestamp = CURRENT_TIMESTAMP, journal_identifier = 'localscript'"&lt;BR /&gt; $Rows = WriteMySQLQuery $conn $query&lt;/P&gt;&lt;P&gt; $query = "INSERT IGNORE INTO ip(ip, host_identifier) VALUES ('$IPaddress', '$HostName') "&lt;BR /&gt; $Rows = WriteMySQLQuery $conn $query&lt;/P&gt;&lt;P&gt; $query = "INSERT INTO file_system(mount_name, host_identifier,&lt;BR /&gt; allocated_capacity_mb,used_capacity_mb, fs_type, location_type) VALUES ('$Filesystem', '$HostName', '$allocated', '$used', '$type', 'LOCAL') &lt;BR /&gt;ON DUPLICATE KEY UPDATE allocated_capacity_mb = '$allocated', used_capacity_mb = '$used', fs_type = '$type'"&lt;BR /&gt; &lt;BR /&gt; $Rows = WriteMySQLQuery $conn $query&lt;BR /&gt; # Move to next row&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $intRow++&lt;/P&gt;&lt;P&gt;} While ($UserWorksheet.Cells.Item($intRow,1).Value() -ne $null)&lt;/P&gt;&lt;P&gt;# Exiting the excel object&lt;BR /&gt;$objExcel.Quit()&lt;BR /&gt;#Release all the objects used above&lt;BR /&gt;$a = Release-Ref($UserWorksheet)&lt;BR /&gt;$a = Release-Ref($UserWorkBook) &lt;BR /&gt;$a = Release-Ref($objExcel)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 10 Jan 2014 18:08:39 GMT</pubDate>
    <dc:creator>stephen2</dc:creator>
    <dc:date>2014-01-10T18:08:39Z</dc:date>
    <item>
      <title>seeking config example for FSLU datasource from Excel</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/seeking-config-example-for-FSLU-datasource-from-Excel/m-p/6784#M1532</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;IHAC that wants to acquire file system data from a daily excel spreadsheet which is placed on the OCI server. The help files and FSLU.xml show examples from how to acquire from a database. Does anyone have an example of how to acquire from an Excel spreadsheet?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Jun 2025 05:45:53 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/seeking-config-example-for-FSLU-datasource-from-Excel/m-p/6784#M1532</guid>
      <dc:creator>stephen2</dc:creator>
      <dc:date>2025-06-05T05:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: seeking config example for FSLU datasource from Excel</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/seeking-config-example-for-FSLU-datasource-from-Excel/m-p/6788#M1534</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This datasource doesn't work this way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The FSLU datasource is a bit different from traditional OCI data flow - OCI datasources pull data via a poll mechanism. This one does as well, but it is pulling data from a fixed set of database tables within the OCI database that customers have write ( !!!) access to - which is in itself unusual, because the OCI operational database is basically a blackbox for which there is no access to.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;These specific tables + schema are fixed for customers to publish FSLU data into, from whatever source they want.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The FSLU datasource has very few options, because it is pulling data from database tables where the schema is fixed. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This datasource requires that customers own the responsibility for scriptomatically / programmatically pulling FSLU data out of another application, and inserting it into the FSLU tables - this responsibility may not be something storage teams will want to undertake.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jan 2014 13:42:46 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/seeking-config-example-for-FSLU-datasource-from-Excel/m-p/6788#M1534</guid>
      <dc:creator>ostiguy</dc:creator>
      <dc:date>2014-01-09T13:42:46Z</dc:date>
    </item>
    <item>
      <title>Re: seeking config example for FSLU datasource from Excel</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/seeking-config-example-for-FSLU-datasource-from-Excel/m-p/6793#M1536</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've been asking around for example scripts to populate the FSLU database.&amp;nbsp; So far I haven't found anyone willing to share.&amp;nbsp; If I write some, I will post them internally.&amp;nbsp; Stephen2, if you come across some good examples please let me know.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Jan 2014 18:23:43 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/seeking-config-example-for-FSLU-datasource-from-Excel/m-p/6793#M1536</guid>
      <dc:creator>moechnig</dc:creator>
      <dc:date>2014-01-09T18:23:43Z</dc:date>
    </item>
    <item>
      <title>Re: seeking config example for FSLU datasource from Excel</title>
      <link>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/seeking-config-example-for-FSLU-datasource-from-Excel/m-p/6798#M1539</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;here is a powershell script that will read from an excel file and inpit into the fslu database. It runs slow and needs to be re-engineered, but it works. Usage details in the code. Need to replace OCI server address, path to excel spreadsheet, and worksheet number for your environment. Also need some powershell mods.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#excel fsutil script - reads an excel spreadsheet and populates the host_data database in preperation for FSLU acquisition&lt;BR /&gt;# assumes an input file with the following format: hostname, ipaddress, file system, type, allocated, used, mount point&lt;BR /&gt;# requires mysql powershell driver - mysql-connector-net-6.8.3 - search, download, and install&lt;BR /&gt;# runs slow - need to convert to ADE Excel driver to speed up&lt;BR /&gt;# SG 1/10/14&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;# MySQL functions&lt;BR /&gt;function ConnectMySQL([string]$user,[string]$pass,[string]$MySQLHost,[string]$database) &lt;BR /&gt;{&lt;BR /&gt; # Load MySQL .NET Connector Objects&amp;nbsp; &lt;BR /&gt; [void][system.reflection.Assembly]::LoadWithPartialName("MySql.Data")&amp;nbsp;&amp;nbsp; &lt;BR /&gt; # Open Connection&amp;nbsp; &lt;BR /&gt; $connStr = "server=" + $MySQLHost + ";port=3306;uid=" + $user + ";pwd=" + $pass + ";database="+$database+";Pooling=FALSE"&amp;nbsp; &lt;BR /&gt; $conn = New-Object MySql.Data.MySqlClient.MySqlConnection($connStr)&amp;nbsp; &lt;BR /&gt; $conn.Open()&amp;nbsp; &lt;BR /&gt; $cmd = New-Object MySql.Data.MySqlClient.MySqlCommand("USE $database", $conn)&amp;nbsp; &lt;BR /&gt; return $conn &lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;function WriteMySQLQuery($conn, [string]$query) &lt;BR /&gt;{&amp;nbsp;&amp;nbsp; &lt;BR /&gt; $command = $conn.CreateCommand()&amp;nbsp; &lt;BR /&gt; $command.CommandText = $query&amp;nbsp; &lt;BR /&gt; $RowsInserted = $command.ExecuteNonQuery()&amp;nbsp; &lt;BR /&gt; $command.Dispose()&amp;nbsp; &lt;BR /&gt; if ($RowsInserted) {&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; return $RowInserted&amp;nbsp; } &lt;BR /&gt; else {&amp;nbsp;&amp;nbsp;&amp;nbsp; return $false&amp;nbsp; &lt;BR /&gt; }&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;# clean up function&lt;BR /&gt;function Release-Ref ($ref) {&lt;BR /&gt; ([System.Runtime.InteropServices.Marshal]::ReleaseComObject(&lt;BR /&gt; [System.__ComObject]$ref) -gt 0)&lt;BR /&gt; [System.GC]::Collect()&lt;BR /&gt; [System.GC]::WaitForPendingFinalizers()&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;# setup vars for OCI DB connection&lt;BR /&gt;$user = 'hosts'&lt;BR /&gt;$pass = 'netapp123'&lt;BR /&gt;$database = 'host_data'&lt;BR /&gt;############################################ change address of OCI host here ##################################################&lt;BR /&gt;$MySQLHost = '192.168.77.55' &lt;BR /&gt;###############################################################################################################################&lt;/P&gt;&lt;P&gt;# Connect to MySQL Database&lt;BR /&gt;$conn = ConnectMySQL $user $pass $MySQLHost $database&lt;/P&gt;&lt;P&gt;# create journal entry&lt;BR /&gt;$query = 'INSERT INTO journal (identifier, status) VALUES ("localscript","SUCCESS") ON DUPLICATE KEY UPDATE journal_update_timestamp = CURRENT_TIMESTAMP'&lt;BR /&gt;$Rows = WriteMySQLQuery $conn $query&lt;/P&gt;&lt;P&gt;# Creating excel object&lt;BR /&gt;$objExcel = new-object -comobject excel.application &lt;BR /&gt;$objExcel.Visible = $Tru&lt;BR /&gt;############################################ change excel file name / location here ###########################################&lt;BR /&gt;# Directory location where we have our excel files&lt;BR /&gt;$ExcelFilesLocation = "c:\powershell\"&lt;BR /&gt;# Open our excel file&lt;BR /&gt;$UserWorkBook = $objExcel.Workbooks.Open($ExcelFilesLocation + "wdc.xlsx") &lt;BR /&gt;$UserWorksheet = $UserWorkBook.Worksheets.Item(1)&lt;BR /&gt;###############################################################################################################################&lt;/P&gt;&lt;P&gt;# starting at row 2 to skip header data&lt;BR /&gt;$intRow = 2&lt;BR /&gt;# for each row in spreadsheet, read cells and write to OCI DB&lt;BR /&gt;Do {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # read current row&lt;BR /&gt;&amp;nbsp; $HostName = $UserWorksheet.Cells.Item($intRow, 1).Value()&lt;BR /&gt;&amp;nbsp; $IPaddress = $UserWorksheet.Cells.Item($intRow, 2).Value()&lt;BR /&gt;&amp;nbsp; $Filesystem = $UserWorksheet.Cells.Item($intRow, 3).Value() &lt;BR /&gt;&amp;nbsp; $type = $UserWorksheet.Cells.Item($intRow, 4).Value()&lt;BR /&gt;&amp;nbsp; $allocated = $UserWorksheet.Cells.Item($intRow, 5).Value()&lt;BR /&gt;&amp;nbsp; $used = $UserWorksheet.Cells.Item($intRow, 6).Value()&lt;BR /&gt; $mountpoint = $UserWorksheet.Cells.Item($intRow, 7).Value()&lt;BR /&gt; &lt;BR /&gt; # print values&lt;BR /&gt;&amp;nbsp;&amp;nbsp; "Row # " + $intRow&lt;BR /&gt;&amp;nbsp;&amp;nbsp; "host name " + $HostName&lt;BR /&gt;&amp;nbsp;&amp;nbsp; "ip address " + $IPaddress &lt;BR /&gt;&amp;nbsp;&amp;nbsp; "file system " + $Filesystem &lt;BR /&gt;&amp;nbsp;&amp;nbsp; "type" + $type &lt;BR /&gt;&amp;nbsp;&amp;nbsp; "allocated " + $allocated &lt;BR /&gt;&amp;nbsp;&amp;nbsp; "used " + $used &lt;BR /&gt;&amp;nbsp;&amp;nbsp; "mountpoint " + $mountpoint&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt; " "&lt;BR /&gt; &lt;BR /&gt;# insert into OCI DB&lt;BR /&gt; $query = "INSERT INTO HOST(hostname, journal_identifier) VALUES ('$HostName', 'localscript') ON DUPLICATE KEY UPDATE host_update_timestamp = CURRENT_TIMESTAMP, journal_identifier = 'localscript'"&lt;BR /&gt; $Rows = WriteMySQLQuery $conn $query&lt;/P&gt;&lt;P&gt; $query = "INSERT IGNORE INTO ip(ip, host_identifier) VALUES ('$IPaddress', '$HostName') "&lt;BR /&gt; $Rows = WriteMySQLQuery $conn $query&lt;/P&gt;&lt;P&gt; $query = "INSERT INTO file_system(mount_name, host_identifier,&lt;BR /&gt; allocated_capacity_mb,used_capacity_mb, fs_type, location_type) VALUES ('$Filesystem', '$HostName', '$allocated', '$used', '$type', 'LOCAL') &lt;BR /&gt;ON DUPLICATE KEY UPDATE allocated_capacity_mb = '$allocated', used_capacity_mb = '$used', fs_type = '$type'"&lt;BR /&gt; &lt;BR /&gt; $Rows = WriteMySQLQuery $conn $query&lt;BR /&gt; # Move to next row&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; $intRow++&lt;/P&gt;&lt;P&gt;} While ($UserWorksheet.Cells.Item($intRow,1).Value() -ne $null)&lt;/P&gt;&lt;P&gt;# Exiting the excel object&lt;BR /&gt;$objExcel.Quit()&lt;BR /&gt;#Release all the objects used above&lt;BR /&gt;$a = Release-Ref($UserWorksheet)&lt;BR /&gt;$a = Release-Ref($UserWorkBook) &lt;BR /&gt;$a = Release-Ref($objExcel)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 10 Jan 2014 18:08:39 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Active-IQ-Unified-Manager-Discussions/seeking-config-example-for-FSLU-datasource-from-Excel/m-p/6798#M1539</guid>
      <dc:creator>stephen2</dc:creator>
      <dc:date>2014-01-10T18:08:39Z</dc:date>
    </item>
  </channel>
</rss>

