Report Generator
NMONVisualizer supports generating charts as PNG files from the command line. By default, it will create the same charts that are available in the GUI. Both the summary charts at the 'All Systems' level and charts for each host will be created in a charts subdirectory. There will be another subdirectory for each host's set of charts. Generation of these reports, along with the ability to create custom reports is supported via switches.
The charts produced by this utility default to displaying all the data that was parsed. Command line switches are also supported to specify the start and / or end datetimes for the charts as well as creating custom reports.
Running
To run the ReportGenerator, specify the class from the command line like the following:
java -jar NMONVisualizer_<release_date>.jar com.ibm.nmon.ReportGenerator <file|directory to parse>
Note that only nmon files are parsed. If a directory is given, then this directory will be searched recursively, so ensure that the JVM has enough memory allocated to it (via -Xmx). Also, multiple files / directories can be specified.
If no additional options are specified, the following processing occurs:
- The default granularity is calculated so that the chart will have 100 data points. Change with the -g option.
- The default interval will be set to the earliest and latest datetimes where data is present across all processed files. Change with the -s and -e options. Or, use the -i option to load an interval file.
- A set of summary charts is created from summary_single_interval.xml. This is the same set of charts shown when All Systems is selected in the GUI. Disable with the --nosummary option. Add additional summary charts with -a.
- For each host, a set of charts is created from dataset_report.xml. Charts for each host will be in a separate directory. This is the same set of charts shown when a hostname is selected in the GUI. Disable with the --nodata option. Add additional charts for each host with -d.
- Only charts (as PNG files) are created by default. CSV data can be generated for each host with --rawdata or for each chart with --chartdata.
- Default chart formats are used. Use the -f option to change.
- Hosts are not renamed. Use the -h option if needed.
- If a single file or directory to parse is specified, all output is created in that directory. For multiple files / directories, output is created in the current working directory.
Options
- --nodata - do not generate charts for each host / dataset
- --nosummary - do not generate summary charts across all hosts / datasets
- -s - start datetime of charts in ISO 8601 datetime format (yyyy-MM-ddTHH:mm:ssX)
- -e - end datetime of charts in ISO 8601 datetime format (yyyy-MM-ddTHH:mm:ssX)
- -i - use the given interval CSV file to create charts for a number of intervals. All charts specified will be created for each interval, as well as the default interval (all data or the times set by -s and -e).
- -g - sets the granularity, in seconds. This will add a data point on the chart every granularity seconds. The minimum value is 1. The maximum value must be less than the interval of the processed data or no data points will be plotted on the chart.
- -f <filename> - use the given properties file to load a custom chart format.
- -h <filename> - use the given JSON file to load a host renaming configuration.
- -d <filename> - use the given XML file to create a custom set of charts for each host / dataset. If more than one dataset is parsed, a separate directory will be used for each hostname.
- -a <filename> - use the given XML file to create a custom set of charts across all hosts / datasets
- --mt <filename> - like -d but instead of plotting each chart's matching data types on a single chart, a chart will be created for each type.
- --mf <filename> - like -d but instead of plotting each chart's matching fields on a single chart, a chart will be created for each type and field combination.
- --rawdata - output a CSV file for each server that includes all the parsed data
- --chartdata - output a CSV file for each chart that includes the data used to create the chart. Note that the chart will attempt to only draw 100 points. As a result this file may only contain data averaged over several timestamps when compared to the output from --rawdata which contains all the data recorded in the parsed file.
The -d, -a, --mt and --mf switches do not disable the default reports, hence the other switches to do this. Each of these switches can be specified multiple times to create a number of custom reports at once.
Since the --mt and --mf multiplex a single chart definition into multiple output charts, it is possible to create a large number of charts, especially when working with a large number of parsed data sets. In most cases, there should be a limited (maybe one) chart definition per file. Note that any chart subtitles are ignored. With --mt, the type name is used; with --mf, the field name is used. The file names used for the output will append the type or field, respectively. For the file name, types and fields are renamed as specified in the chart definition. The raw type or field name is use for the subtitle.
Neither of the -s and -e switches are required. Either one, both or none can be specified.
The intervals loaded when using -i will be in addition to the interval specified with the -s and / or -e switches. If more than one interval is loaded, a separate output directory for each interval will be created. All charts specified via the other switches will be created for each interval.
Running without any options is equivalent to:
--nodata --nosummary \
-d <nmon_code>/src/com/ibm/nmon/report/dataset_report.xml \
-a <nmon_code>/src/com/ibm/nmon/report/summary_single_interval.xml \
<file|directory to parse>
Errors
Any errors generated during parsing will be logged to a ReportGenerator_yyyMMdd_HHmmss.log log file.
Intervals File
The value given for -i should be a valid CSV file that contains at least one interval. The format of this file is interval name, start, end. The interval name is optional. Both the start and end must be a valid ISO 8601 datetime string.
Chart Format File
The value given for -f should be a valid properties file that specifies custom chart colors. The colors, as property values, can be specified as:
- Hex values like 0xa0a0a0 or #A0A0A0. Lower or uppercase is accepted.
- An array of RGB values like [ 128, 128, 128 ]
- A color name as definied in ChartColor. Lower or uppercase is accepted.
The following colors, as properties, can be set:
- background - the chart background, outside the plot area.
- plotBackground - the background of the graph itself.
- text - the color of the title axis and legend text.
- elements - the color of the chart elements like axis lines and tick marks.
- gridLines - the grid line color on graphs.
- annotations - the color of annotation lines and text.
- series - the colors of the lines and bars. This can be a comma separated list. The colors are iterated through for each line or bar and colors will repeat if there are not enough in the list for all the series in the chart.
A sample dark theme could be something like the following: background=BLACK plotBackground=DARK_GRAY text=WHITE elements=[ 248, 248, 248 ] gridLines=0xa0a0a0 annotations=GREEN series=VERY_LIGHT_RED, VERY_LIGHT_BLUE, VERY_LIGHT_GREEN, VERY_LIGHT_YELLOW, VERY_LIGHT_CYAN, VERY_LIGHT_MAGENTA, LIGHT_RED, LIGHT_BLUE, LIGHT_GREEN, LIGHT_YELLOW, LIGHT_CYAN, LIGHT_MAGENTA