CMPG Detailed Overview
CMPG Detailed Overview
CMPG Detailed Overview
Contents
1.0 Introduction
o 1.1 Getting CMPG Input Data Files
2.0 Usage
o 2.1 Supporting Files
o 2.2 CMPG Usage Steps
2.2.1 CMPG/CMDownload Best Practice Install Guide
2.2.2 CMPG Basic Options And Use
2.2.3 Simple Counter Manager Automation
o 2.3 Excel Macro Customizations
2.3.1 Auto zoom Macro
2.3.2 Reset Margins Macro
2.3.3 Aligned LUN Hide Macro
3.0 Customizations
o 3.1 System Graphs
o 3.2 Overview Graph
o 3.3 Detailed Graph
o 3.4 Data Sheet
o 3.5 Additional Counters
3.5.1 Artificial Counters
3.5.2 Composite Counter
o 3.6 Adding FLASH CACHE to the Archiver
4.0 Default Graphs
o 4.1 Overview Graphs
o 4.2 Detailed Graphs
o 4.3 Data Sheets
5.0 Troubleshooting
o 5.1 No performance meta-data
1.0 Introduction
The Counter Manager Performance Grapher (CMPG) is a Microsoft Windows executable
that can be used to produce performance graphs from Counter Manager data sent via
AutoSupport.
The output file is in the form of a Microsoft Excel workbook. The graphs and data sheets within
the workbook can be used for high level performance analysis. The workbook also forms part of
the input into the Performance Consulting Service.
Currently the tool is only available as an executable for Microsoft Windows platforms as it relies
heavily on Windows features to drive the automation of Microsoft Excel. It has been
successfully tested with Excel2007 and Excel2010. Support for Excel2003 has been dropped as
of v4 due to the limitations of this version of Excel.
2.0 Usage
CMPG is a Perl based script that is executed from the command line. For example:
cmpg.exe filename CM-HOURLY-STATS.gz
or
cmpg.exe filename stats_archive_XXX_YYY_ZZZ.gz -archive
-filename input-file
Specifies the input filename. You can graph longer periods by entering more files. You
can do this by either specifying -f multiple times or using wildcards. An example being:
cmpg -f netapp01\*.gz. This works for either CM data files or performance archive files.
You can easily download multiple CM data files using cmdownload.
-archive [FREQUENCY_1|FREQUENCY_2|FREQUENCY_3|FREQUENCY_4]
CMPG input is in performance archive format and optionally allows you to specify
which sampling frequency within the file to chart. The defaults are FREQUENCY_1 =
once per second, FREQUENCY_2 = once per 5 seconds, FREQUENCY_3 = once per
minute and FREQUENCY_4 = once every 5 minutes. Lower sampling frequencies take
more time to process and require more memory. Note that not all counters are sampled at
the lowest frequencies. The NFS operations histogram is one example.
-details
On some occasions meta-data is missing from CMDATA files and this prevents
meaningful data from being extracted and graphed. As of 3.0.2 the script will
automatically use the file metadata.xml. This should suffice for most situations, but this
behaviour can be overridden, if needed, using this option.
-storage [storage-file]
The filename supplied with this option contains output from the filer's storage command.
If you do not specify the file name then the script will attempt to locate a file ending with
'STORAGE' or 'storage.txt' in the same directory as the data files. This is only applicable
for CMDATA files.
-raid [sysconfig-r-file]
The filename supplied with this option contains output from the filer's sysconfig -r
command. If you do not specify the file name then the script will attempt to locate a file
ending with 'SYSCONFIG-R' or 'sysconfig.txt' in the same directory as the data files.
This is only applicable for CMDATA files.
-logo image-file
This option specifies the filename of a image that will be inserted into the top left corner
of the graphs
-xml xml-config-file
The name of a custom configuration file to use for producing graphs. By default CMPG
uses -x cmpg.xml
-perfInfo
Causes CMPG to dump out the performance information contained within the CM data
file. The output file is based upon the input file with -info.xml.
-noPrompt
Prevents data points from being averaged out when multiple performance files are
supplied.
-gmtOffset [+|-]hhmm
Timestamps for CM data files are recorded in GMT. The data files, however, do not say
what time zone the controller is located in. Use this option to specify the controller's
GMT offset to make the charts accurate. The local time zone is used by default.
-analysis
Normal legends are replaced with selectable ones and standard deviation figures are
added to the data sheets.
-uncompThreads [number_of_threads]
-output [output_directory_path]
Specifies the output directory to which the final output file after processing the data
should be placed. Currently only local and mapped drives are supported. If the path
contains directories with names having blank spaces in between then the whole path
should be enclosed in double quotes.
-version
Downloads CM-STATS.gz and configuration metadata for the last four weeks to
subfolder that matches the storage controllers name
cmdownload -f <filername or sysid> -w 4
Uncompress the .gz downloaded files before using thwm with cmpg.
cmpg -f
<filername>\*.stats -nodataaverage
Note: the -nodataaverage stops data points being averaged and peaks being hidden
cmpg f <filername>\*.stats -details
The -details flag is needed to include individual loop charts, and expose performance
charts per volume and per lun
cmpg -f <filername>\*.stats -output Z:\cmpg\resultDirectory
The -output flag can be used to place the result file into the specified destination
directory, which can be a network path mapped as Win
Note: Internet Explorer has a habit of automatically uncompressing the GZIP file downloaded from
ASUP search and leaving the .gz extension. If you have problems uncompressing the file then just open it
in a text editor and see if you can see plain text.
-w 24
4) Download and project storage growth for aggregate and volumes for the last
52 weeks
cmdownload f <system> -w 52 -c DF c DF-A c DF-S c AGGR-STATUS zip
cmpg f <system\system.zip> -x df-trend.xml
This can produce a large number of charts and it can be laborious to search for bad
alignment. Please see section 2.3.3 for the excel macro that can be used to hide all the
charts with good alignment leaving only charts that indicate bad alignment.
Note: the recent slides on LUN Misalignment are here
6) Get the Performance Archiver data from a filer running 7.3.x
All of the examples here can be run with these files using the archive option at
the end of CMPG.
In ONTAP 7.3: /etc/stats/archive/
In ONTAP 7.3.2+: a symlink made from /etc/log/stats/archive to /etc/stats/archive
In ONTAP 8.0+: directory moved from /etc/stats/archive to /etc/log/stats/archive
Note: the performance archiver does not contain processor domain, LUN or
FlexScale counters.
2.2.3 Simple Counter Manager Automation
This batch file will save the users having to open a DOS prompt and simplify cmdownload /
CMPG use. Please download and save this 'scma-batch.bat' file to the CMPG working directory
and create a shortcut to it on your desktop.
6. Double click on Module1 and overwrite the macro with one of the macros below on the
right-hand side.
This macro allows you to automatically zoom all worksheets in the workbook to 75% and
addresses viewing and screen resolution issues. Copy and paste the following using the
instructions above: Sub SetZoom()
' Declare the variables
Dim ac As Excel.Chart
Dim c As Excel.Chart
' Record the active chart
Set ac = ActiveChart
' Stop Excel updating stuff as it just slows the macro down
Application.ScreenUpdating = False
Application.Interactive = False
' Select each chart and set the zoom level
' Cannot use charts.select for some reason
For Each c In ActiveWorkbook.Charts
c.Select
ActiveWindow.Zoom = 75
Next
' Make sure the original chart is now selected
ac.Select
' Set these back
Application.ScreenUpdating = True
Application.Interactive = True
End Sub
Set s = c.SeriesCollection("0")
' Is this a valid object?
If IsObject(s) Then
' Get the average value for the series
Align = Application.WorksheetFunction.Average(s.Values)
End If
' Get the operations for the histogram
Set s = c.SeriesCollection("Ops.")
' Is this a valid object?
If IsObject(s) Then
' Get the average value for the series
Ops = Application.WorksheetFunction.Average(s.Values)
End If
' Does this chart match the criteria?
If Align < AlignLimit And Ops > OpsLimit Then
c.Visible = xlSheetVisible
Debug.Print c.Name
End If
Next
End Sub
3.0 Customizations
CMPG relies upon an external XML file for configuration. The configuration tells CMPG what
graphs to output and what counters should be used. CMPG can output two different types of
graphs and one type of data sheet. Three default system graphs that are included in every run of
CMPG and these default graphs cannot be configured.
3.1 System Graphs
The default graphs Protocols, Inbound Throughput, and Outbound Throughput are always
included. The principal reason is that additional coding is required to place the CPU utilization
area graph on the secondary axis and this cannot yet be specified in the XML configuration.
The following are examples of the three default system graphs: -
The overview graph is specified in the XML configuration by using the <overview-graph> tag.
For example: <config>
<overview-graph title="Top 5 LUN Reads" max-series="5" remove-series=1 />
<counters lun:read_data=""/>
</overview-graph>
<config>
The following options can be specified for the overview graph: title : This will be the title of the graph. This will also be used to form the name of the
graph
axis-title : The title of the left axis. This is automatically generated using the
performance meta-data and is the units of the counter being used. Where
multiple counters are used the predominant units will be used. Any title
specified here will be prepended to the automatic title.
max-series : Specifies the maximum number of series to show on the graph. The series
are ordered and then the least significant ones are removed until maxseries is reached
The valid values for this option is any whole number above 0
remove-series : With this option specified the scale of the graph is recalculated to ignore
the first 7 timestamps. This should prevent the regular disk scrubbing
process from skewing the scale
The valid values for this option are 0 and 1
The <overview-graph> must contain a <counters> tag. The counters tag itself must contain at
least one pair of counter name and counter title pairs. The counter title is used to generate the
name for a series in a graph. If counter title is empty then the series name will contain only the
instance name for the counters.
</config>
Note: Detailed graphs are only created if the -detail option is specified in the command line.
title : This will be the title of the graph. This will also be used to form the name of the
graph
title : The title on the top of each chart created. One chart per volume in the case. The %s
in this example specifies cmpg to label the worksheet volume:<vol_name>
The <detail-graph> tag must contain a <counters> tag. The counters tag itself must contain at
least one pair of counter name and counter title pairs. The counter title is used to generate the
name for a series in a graph. If counter title is empty then the series name will contain only the
instance name for the counters.
There is also an optional <secondary-axis> tag for the detail graph. This option allows for
counters with different measurement units or drastically different scales to be plotted on the same
graph. The following options can be specified for this tag: title : The title of the right axis. This is automatically generated using the performance
meta-data and is the units of the counter being used. Where multiple
counters are used the predominant units will be used. Any title specified
here will be prepended to the automatic title.
counters : This option specifies the comma separated list of counters that should be
graphed on the secondary axis.
/>
/>
system:fcp_ops="FCP" />
system:iscsi_ops="iSCSI" />
system:http_ops="HTTP" />
system:cpu_busy="CPU" />
system:cifs_ops="CIFS"
system:nfs_ops="NFS"
</data-sheet>
</config>
The following options can be specified for the overview graph: title : This will be the name of the worksheet. This is limited to the 32 characters and
cannot contain certain special characters.
As with the graphs; each <data-sheet> tag must contain a <counters> tag. The counters tag itself
must contain at least one pair of counter name and counter title pairs.
Description
Protocols
Shows the average activity of the different protocols on the storage controller. This information is super
imposed on top of overall CPU utilisation which is plotted on the secondary axis.
Operations
Outbound
Shows the average activity of the outbound Ethernet and Fibre Channel interfaces against disk reads. This
graph is also overlaid on top of average utilisation.
Operations
Inbound
This graph is the opposite of the Operation Outbound graph and shows inbound activity against disk writes.
All
Processors
V Filers
Shows the average processor time that is allocated to each virtual filer configured on the storage controller.
The availability is this graph is dependant upon the configuration of the storage controller.
Domain
Usage
Shows the average time that each domain has been executing on any processor. The axis scale will vary
according to the number of processors in the storage controller. The availability of this graph is dependant
on the version of ONTAP installed on the storage controller.
Shows the average number of IO operations per disk in the system. This graph may not show all disks
installed in the system due to limitations within Microsoft Excel.
NIC Receives
Shows the average amount of data received by each Ethernet interface in the storage controller. Interfaces
that are part of a virtual interface or marked as down are not displayed.
NIC
Transmits
Shows the average amount of data transmitted by each Ethernet interface in the storage controller.
Interfaces that are part of a virtual interface or marked as down are not displayed.
FC Target
Receives
Shows the average amount of data received by each fibre channel target interface in the storage controller.
Series with no data are removed to improve clarity of the graph.
FC Target
Transmits
Shows the average amount of data transmitted by each fibre channel target interface in the storage
controller. Series with no data are removed to improve clarity of the graph.
Top 5 Vol
Writes
Shows the average write activity for the 5 busiest volumes for writes
Top 5 Vol
Reads
Shows the average read activity for the 5 busiest volumes for reads
Top 5
Volume
Latencies
Top 5 LUN
Writes
Shows the average write activity for the 5 busiest LUNs for writes
Top 5 LUN
Reads
Shows the average read activity for the 5 busiest LUNs for reads
Description
ISCSI
LUNs
Shows the average read, write and average latency for each configured LUN on the storage controller
Volumes
Shows the average read, write and average latency for each volume on the storage controller
Description
LUN Stats
Shows the minimum, average and maximum values for reads, writes and average latency
Volume Stats
Shows the minimum, average and maximum values for read operations, write operations and average latency
Input Stats
Shows the minimum, average and maximum values for Ethernet receives, Fibre Channel receives and disk
writes
Output Stats
Shows the minimum, average and maximum values for Ethernet transmits, Fibre Channel transmits and disk
reads
Protocol Stats
Shows the minimum, average and maximum values for the CIFS, HTTP, iSCSI, NFS and FCP protocols
5.0 Troubleshooting
5.1 No performance meta-data
Symptom
CMPG reports that the performance meta-data is missing from the data file
Explanation
Occasionally the performance meta-data section of the CM stat file is missing. If the
uncompressed file is opened using a text editor then the start of the file will look like: <perf-info></perf-info><perf-data>...
Resolution
The workaround is to find a CM stat file from a system with the same version number and
replace the perfinfo section of the problem file with that of the good file.
Below are some links to data required if you see the issues above. Simply insert the contents of
this file in between the perfinfo sections. <perf-info> PutTheDataHere </perf-info>
7.0.3
7.2.5.1
7.2.6.1
7.3.1.1
Another way to fix this is to copy one of the text files from below, place a <perf-info> block at
the front and a </perf-info> block at the end. Next open a command prompt window and then
type the following: type <perfInfoFile> > temp.txt
type <uncompressedCMSTATS> >> temp.txt
ren temp.txt <somethingMoreUseful>