Community

Data ONTAP PowerShell Toolkit - Collect SYSSTAT type of information in CSV format

by NetApp Employee on ‎2011-04-07 04:10 PM - edited on ‎2014-09-25 12:41 PM by Community Manager

As part of performance monitoring and analysis collecting performance data is crucial. Even though historical data could be collected with other monitoring tools we are often using SYSSTAT command to collect such data during short period of time of specific activity to analyze performance of NetApp array. Raw output of SYSSTAT command is useful but in some cases it needs to be presented in more visual form such graphs and charts. Producing Comma-Separated-Values file from SYSSTAT command output is long and painful process.

 

Working with customer on performance analysis made me to develop PowerShell script which can capture such data in CSV format, so that data can be processed much faster and presented to customer in nice graphical format.

 

Script Get-NaSysStat.ps1 uses Get-NaPerfCounter and Get-NaPerfData commandlets to extract performance data of NetApp array and store them into CSV file. Script uses next parameters:

 

  NaIP       : IP address or Name of the Filer
  NaUS      : Filer User Name. Default Value - root
  NaPW     : Filer User's Password. Default Value - password.
  Output     : Display/<File Name or Path>. Default Value - Display
  Interval     : Interval in minutes between samples. Default Value - 5 min.
  Iterations  : Number of sample iterations.
               Default Value - 0, for no limit.
               Execution can be ended by pressing Ctrl-C

 

Example of calling script and screen output:

 

PS C:\@work\Scripts> .\Get-NaSysStat.ps1 -NaIP 10.58.97.11 -NaUS root -NaPW <password> -Output Perf.csv -Interval 1

Name                                 Value
----                                     -----
Time                                  4/7/2011 4:37:03 PM
system_model                    FAS6070
ontap_version                     NetApp Release 8.0.1RC2 7-Mode: Thu Oct 21 01:27:45 PDT 2010
serial_no                            ***
system_id                          ***

hostname                           Array-01
nfs_ops                              0.00
cifs_ops                             0.00
http_ops                             0.00
fcp_ops                              8.50
iscsi_ops                           0.00
read_ops                           0.00
sys_read_latency               0.00
write_ops                           8.50
sys_write_latency               0.32
total_ops                            8.50
sys_avg_latency                 0.32
net_data_recv                     2.20
net_data_sent                    9.25
disk_data_read                  169.61
disk_data_written               584.21
cpu_busy                          2.12
avg_processor_busy          1.49
total_processor_busy         5.98
num_processors                4
*********************************************************************

 

Screen output is valuable part but parameter -Output tells script to save data into CSV file. Here is an example of CSV files:

 

Time, avg_processor_busy, cifs_ops, cpu_busy, disk_data_read, disk_data_written, fcp_ops, hostname, http_ops, iscsi_ops, net_data_recv, net_data_sent, nfs_ops, num_processors, ontap_version, read_ops, serial_no, sys_avg_latency, sys_read_latency, sys_write_latency, system_id, system_model, total_ops, total_processor_busy, write_ops,
3/28/2011 5:32:25 PM, 3.17, 0.00, 17.30, 6773.59, 21667.06, 1031.74, BP-SAN-04, 0.00, 0.00, 17.41, 284.66, 0.00, 12, NetApp Release 8.0.1 7-Mode: Wed Jan  5 17:23:51 PST 2011, 558.10, 700000501660, 0.83, 0.89, 0.75, 1873760944, FAS6280, 1031.54, 37.98, 473.44,
3/28/2011 5:33:26 PM, 2.07, 0.00, 10.88, 8511.15, 16221.77, 869.91, BP-SAN-04, 0.00, 0.00, 6.29, 91.75, 0.00, 12, NetApp Release 8.0.1 7-Mode: Wed Jan  5 17:23:51 PST 2011, 656.24, 700000501660, 0.80, 0.79, 0.84, 1873760944, FAS6280, 869.70, 24.89, 213.46,
3/28/2011 5:34:27 PM, 0.83, 0.00, 3.59, 3311.89, 5268.20, 131.53, BP-SAN-04, 0.00, 0.00, 1.84, 9.72, 0.00, 12, NetApp Release 8.0.1 7-Mode: Wed Jan  5 17:23:51 PST 2011, 50.07, 700000501660, 0.81, 1.05, 0.65, 1873760944, FAS6280, 131.35, 10.00, 81.28,
3/28/2011 5:35:28 PM, 1.66, 1.70, 10.61, 2518.90, 3812.95, 241.06, BP-SAN-04, 0.00, 0.00, 12.41, 25.53, 0.00, 12, NetApp Release 8.0.1 7-Mode: Wed Jan  5

 

Performance data is exported into Microsoft Excel for further analysis and nice performance graphs created within minutes:

 

 

Script is attached to this post.

Comments
on ‎2013-05-14 10:22 AM

Script runs great!

Do you know of a way to pull historical data? Say over the last hour? Day? Week? Looks like this has to be ran for a period of time then the data can be presented after the fact....

on ‎2013-06-10 06:48 AM

i can't start this script - i have error:

================

C:\ps\Get-NaSysStat.ps1:52 row:10

+ $Filer = Connect-NaController $NaIP -Credential $Creds

+          ~~~~~~~~~~~~~~~~~~~~

+ CategoryInfo          : ObjectNotFound: (Connect-NaControllerSmiley Frustratedtring) [], CommandNotFoundException

+ FullyQualifiedErrorId : CommandNotFoundException

================

what can i do?

on ‎2013-06-10 07:09 AM

Victor,

I don't see 'Import-Module Dataontap' there - try to put that at the beginning of the script:

Import-Module Dataontap

on ‎2013-06-17 02:49 AM

thank you.

I don't setup NetApp Powershell module.

Now i fix it and all work correct

on ‎2014-12-04 03:11 PM

Thanks for this very cool script!

on ‎2015-06-17 09:27 AM

How to get those interesting Graphs in the excel??

Warning!

This NetApp Community is public and open website that is indexed by search engines such as Google. Participation in the NetApp Community is voluntary. All content posted on the NetApp Community is publicly viewable and available. This includes the rich text editor which is not encrypted for https.

In accordance to our Code of Conduct and Community Terms of Use DO NOT post or attach the following:

  • Software files (compressed or uncompressed)
  • Files that require an End User License Agreement (EULA)
  • Confidential information
  • Personal data you do not want publicly available
  • Another’s personally identifiable information
  • Copyrighted materials without the permission of the copyright owner

Files and content that do not abide by the Community Terms of Use or Code of Conduct will be removed. Continued non-compliance may result in NetApp Community account restrictions or termination.