
= Web-Based Utility
:description: Learn how to configure and use the web-based JMX Configuration Generator generator tool with {page-component-title}.

Complex JMX data collection configurations can be generated using the web-based tool.

The JMX Configuration Generator collects all available MBean attributes or composite data attributes from a JMX-enabled Java application.
The tool follows this series of steps:

. Connect to an MBean server provided by a Java application using JMX or the JMX Messaging Protocol.
. Retrieve all MBean and composite data from the application.
. Select specific MBeans and composite data objects for {page-component-title} to collect.
. Generate the JMX collectd configuration file and RRD graph definitions for {page-component-title} as a downloadable archive.

The JMX Configuration Generator supports the following collection settings:

* Connect to MBean server with RMI-based JMX.
* Authentication credentials for the JMX connection.
* (Optional) JMX Messaging Protocol connection.

You can access the web-based configuration tool from the {page-component-title} web UI:

. Click menu:Tools[JMX Metric Configuration Generator] in the side menu.
. Or, click menu:Administration[Configure OpenNMS] in the side menu, then under *Additional Tools*, click *JMX Configuration Generator*.

== Configure JMX connection

As part of the setup process, you must configure the tool's JMX connection settings.

.JMX connection configuration page
image::operation/jmx-config-generator/01-webui-connection.png["JMX connection configuration page with example configuration settings."]

* *Service Name:* The name of the service to bind JMX data collection for collectd.
* *Host:* The IP address or FQDN connecting to the MBean server to load MBeans and composite data into the generation tool.
* *Port:* Port to use when connecting to the MBean server.
* *Authentication:* Enable or disable authentication for the JMX connection.
If enabled, the connection will need to be authenticated with a username and password.
* *Skip Non-Number Values:* Skip attributes with non-number values.
* *JMXMP:* Enable or disable the JMX Messaging Protocol.
If enabled, the tool will use the JMX Messaging Protocol instead of using JMX over RMI.

After you enter your configuration settings, click the *arrow* symbol (*>*) to retrieve MBeans and composite data.
The data is loaded into the MBeans Configuration.
From there, you can select metrics to include in data collection.

== Select MBeans and composite data

The MBeans Configuration page lets you assign MBeans and composite data attributes to RRD domain-specific data types and data source names.

.Select MBeans and composite data attributes for {page-component-title} data collection
image::operation/jmx-config-generator/02-webui-mbean-selection.png["MBeans Configuration page displaying a list of MBeans and composite data attributes. Some are selected and have been assigned aliases."]

In this dialog, the left navigation bar shows a tree containing the JMX domain, MBeans, and composite data hierarchy information that was retrieved from the MBean server.
To select or deselect all attributes, right-click in the dialog and choose *Select/Deselect*.

The main panel displays the MBean attributes and their RRD-specific mapping.
You can select and deselect specific MBean or composite data attributes to be included in the data collection configuration.

.Configure MBean attributes for data collection
image::operation/jmx-config-generator/03-webui-mbean-details.png["MBean Configuration page displaying an MBean's details and attributes. Both attributes are selected and have been assigned aliases."]

.Configure composite attributes for data collection
image::operation/jmx-config-generator/04-webui-composite-details.png["MBean Configuration page displaying a composite data object's details and members. All four members are selected and have been assigned aliases."]

* *MBean Name/Composite Alias:* A name identifying the MBean or composite data object.
This field cannot contain special characters.
* *Selected:* Add or remove the MBean attribute or composite member from the data collection configuration.
* *Name:* Name of the MBean attribute or composite member.
This field cannot contain special characters.
* *Alias:* The name of the data source where measurements are persisted in an RRD file.
The alias must be shorter than 19 characters, and must be unique in the data collection configuration.
* *Type:* A gauge or counter data type, used to persist measurements in an RRD file.

== Download and include configuration

Finally, you must generate the following configuration files for {page-component-title}:

* `collectd-configuration.xml`: Generated sample configuration assigned to a service with a matching data collection group.
* `jmx-datacollection-config.xml`: Generated JMX data collection configuration with the selected MBeans and composite data.
* `snmp-graph.properties`: Generated default RRD graph definition files for all selected metrics.

You can copy and paste the contents of the configuration files, or download them as a `.zip` archive.

NOTE: If a configuration file exceeds 2,500 lines, you can only download it as a `.zip` archive.
