# 5Enterprise Manager Integration Utility

This chapter describes how to get started with the Enterprise Manager Integration Utility and use it to integrate Enterprise Manager with Oracle Enterprise Repository.

This chapter contains the following sections:

## 5.1Overview

Enterprise Manager (EM) is a comprehensive monitoring tool. It includes support for monitoring Oracle's SOA Products, as well as J2EE Servers, Databases, JVMs, and Operating Systems.

The EM Integration utility closes the loop between runtime and design-time by providing a summary of runtime performance metrics from EM into Oracle Enterprise Repository. The EM Integration utility pulls from EM and pushes to Oracle Enterprise Repository. The EM Integration tool currently supports and works with EM Grid Control 11g.

This section contains the following topics:

### 5.1.1Prerequisites

Before using the EM Integration utility, you must perform the following prerequisites:

• The EM Integration utility requires the OER-Harvester datapack to be installed in Oracle Enterprise Repository.

• The assets that receive metrics from EM must already be in Oracle Enterprise Repository. They should have been published to Oracle Enterprise Repository from SOA Suite/BPEL-PM or Oracle Service Bus using the Oracle Enterprise Repository Harvester. The EM Integration utility requires the OER-Harvester datapack to be installed in Oracle Enterprise Repository.

• The EM Integration utility requires Java SDK version 6 or higher.

• Install 11g EM Grid Control to enable EM Integration tool to harvest into Oracle Enterprise Repository. The Oracle Enterprise Repository EM Integration tool, currently, only integrates with EM-Grid control and works only with 10g version of SOA.

### 5.1.2Obtaining the Enterprise Manager Integration Utility

To obtain the Enterprise Manager Integration utility:

1. Navigate to this Oracle_HOME\repositoryXXX\core\tools\solutions directory on your computer. A list of all the solution packs for Oracle Enterprise Repository is displayed.

2. Unzip the 11.1.1.2.0-EM-Integration.zip file to a temporary directory.

3. Import the 11.1.1.2.0-OER-Harvester-Solution-Pack.zip file into Oracle Enterprise Repository using the Import/Export Tool. For more information, see Oracle Fusion Middleware User Guide for Oracle Enterprise Repository.

### 5.1.3High Level Use Cases

You can use the EM Integration utility to:

• Publish metrics from Oracle Service Bus Services in EM to existing Oracle Enterprise Repository assets.

• Publish metrics from BPEL-PM Processes in EM to existing Oracle Enterprise Repository assets.

• Publish metrics from Web Services in EM to existing Oracle Enterprise Repository assets.

• Publish Endpoint and Deployment : BPEL assets in Oracle Enterprise Repository from deployment information in EM.

• Support links back to the detailed metrics in EM, from the Oracle Enterprise Repository Web UI.

• Support configurability and extensibility, so that new targets in EM can be mapped to Oracle Enterprise Repository assets.

## 5.2Using the Enterprise Manager Integration Utility

This section describes how to use the Enterprise Manager Integration Utility.

This section contains the following topics:

### 5.2.1Running from Command Line

The EM Integration utility can be run in the command line using the em-integration.bat utility (for Windows) or em-integration.sh (for Linux and Unix).

Before running em-integration.bat or em-integration.sh, ensure that the environment variables mentioned in Table 5-1 are set. In Windows, from a command window, you can type "set X" to see the value of the variable X, and "set X=abc" to set the value of FOO to "abc".

Table 5-1 Command Line Script

Environment Variable Description

JAVA_HOME

Ensure that the JAVA_HOME environment variable points to an installed java runtime (JRE) or SDK. This must be Java version 5 or higher.

JAVA_OPTS

Ensure that you set your JAVA_OPTS parameter as follows:

set JAVA_OPTS=-Dhttp.proxyPort=80 -Dhttp.proxyHost=www-proxy.us.oracle.com -Dhttp.nonProxyHosts= "*.oracle.com|localhost"

JAVA_OPTS refers to the extra options to the java executable. In normal cases, there is no must set this variable. However, a common exception when you must set this variable is when your computer is inside a firewall, and you must use an HTTP proxy to access external servers.

Table 5-2 shows the options that can be specified using the EM Integration command line utility:

Table 5-2 Command Line Options for the EM Integration

EM Integration Options Description

-settings <file>

Refers to the configuration settings specified in the XML file.

-er_url <URL>

Specifies the URL for the Oracle Enterprise Repository instance.

-er_user <User Name>

Specifies the name of the Oracle Enterprise Repository user.

-er_password <Password>

Specifies the password of the Oracle Enterprise Repository user.

To ensure security, the password must be encrypted.

The Oracle Enterprise Repository Web console has a tool to encrypt passwords: http://<host>:<port>/<domain>/diag/encryptstrings.jsp

-em_url <URL>

Specifies the JDBC URL for the EM database.

-em_user <User Name>

Specifies the EM database user name.

-em_password <Password>

To ensure security, the password must be encrypted.

The Oracle Enterprise Repository Web console has a tool to encrypt passwords: http://<host>:<port>/<domain>/diag/encryptstrings.jsp

-help

Note:

Note none of the above options are mandatory and these can be omitted. If the options are omitted, then the utility makes use of the information in the em-integration-settings.xml file in the current directory where em-integration.bat resides. If the command line parameters are provided, then these override the information in em-integration-settings.xml.

Figure 5-1 shows the command line utility options and online help displayed by the em-integration.bat -help command.

### 5.2.2Scheduling from Enterprise Manager

Enterprise Manager has the ability to schedule command-line applications to run periodically. The EM Integration utility can be scheduled to run this way.

It is recommended that you schedule the EM Integration to run once a day, in the evening or when there is low activity on the system.

### 5.2.3Metric Publishing

The section describes the various metric publishing options:

#### 5.2.3.1Oracle Service Bus

EM Integration updates existing assets in Oracle Enterprise Repository of type "Endpoint", which have an endpointURI attribute that matches the endpointURI metric in EM, for Oracle Service Bus Proxy Services and External Services.

Note:

An External Service is a service, which is invoked by an Oracle Service Bus Business Service.

If no "Endpoint" asset is found with the matching endpointURI, then the tool attempts to find a matching Service asset, by name and Oracle Service Bus service type (BusinessService or ProxyService). If it finds one, then it creates a new "Endpoint" asset and relates it to the service. In the case of Business Services, the endpoint is related to the External Service invoked by the Business Service.

#### 5.2.3.2BPEL PM

EM Integration updates existing assets in Oracle Enterprise Repository of type "Deployment:BPEL", which has the "EntryPoint" relationship to an "Endpoint" asset that has an endpointURI attribute that matches the endpointURI metric in EM. EM stores the WSDL location of the endpoint.

If no "Endpoint" asset is found with the matching endpointURI, then the tool attempts to find a matching Service asset, by qualified name from the WSDL. If it finds one, then it creates a new "Endpoint" asset and relates it to the service.

If no "Deployment:BPEL" asset is found, then the tool attempts to find a maching Business Process: BPEL asset, by process name. If it finds one, then it creates a new "Deployment:BPEL" asset and relates it to the service.

#### 5.2.3.3Web Services

EM Integration updates existing assets in Oracle Enterprise Repository of type "Endpoint"", which have an endpointURI attribute that matches the endpointURI metric in EM.

If no "Endpoint" asset is found with the matching endpointURI, then the tool attempts to find a matching Service asset, by qualified name from the WSDL. If it finds one, then it creates a new "Endpoint" asset and relates it to the service.

#### 5.2.3.4Artifacts Creation

For every "Endpoint" that is created, the EM Integration Utility creates a corresponding Artifact:WSDL asset, if it does not already exist in Oracle Enterprise Repository. The EM Integration Utility also creates the Artifact:WSDL and Artifact:XSD assets for any imported file. It follows the fingerprinting rules in Oracle Enterprise Repository Harvester to look for existing artifacts in Oracle Enterprise Repository.

#### 5.2.3.5Endpoint Creation

It is common for production endpoints to be monitored in EM, but not captured in Oracle Enterprise Repository. The EM Integration utility creates these endpoints, if it can find a matching service.The EM Integration utility creates Endpoint assets, if it can find a matching Service and creates Deployment:BPEL assets, if it can find a matching Business Process:BPEL.

#### 5.2.3.6Metrics to Update

In its default configuration, EM Integration attempts to update the following metrics in Oracle Enterprise Repository. These are all visible in the Operational tab for the asset in the Oracle Enterprise Repository Web user interface.

Not all of these metrics are gathered in EM for all of the target types mentioned above, so some might be omitted. The em-integration-settings.xml file configures which metrics are gathered for which targets.

• Daily Average Response Time

• Weekly Average Response Time

• Monthly Average Response Time

• Minimum Response Time

• Maximum Response Time

• Daily Requests

• Weekly Requests

• Monthly Requests

• Daily Faults

• Weekly Faults

• Monthly Faults

• Availability - Daily %

• Availability - Weekly %

• Availability - Monthly %

• Availability - Daily %

• Current Rated Maximum Requests per Second

• Start Date for Metrics Monitoring

• Last Updated

• Link back to detailed metrics in EM

## 5.3Configuring the Enterprise Manager Integration Utility

This section describes how to configure the Enterprise Manager Integration Utility.

This section contains the following topics:

### 5.3.1Setting the Repository and Enterprise Manager Connection Information for the Command-line Utility

Open the em-integration-settings.xml file, which is located at <EM Integration Home> and modify the following XML chunk to point to the Oracle Enterprise Repository instance, the EM database, and the web console with the right credentials.

The EM database is used to retrieve the metric information that is sent to Oracle Enterprise Repository. The EM console URL is used as the base URL for links back to EM, that are created within Oracle Enterprise Repository.

The introspectionSettings section is used to configure the properties of any Endpoint assets that the utility creates. The createMissingEndpoints attribute indicates whether Endpoint and Deployment:BPEL assets are created. If false, then the rest of the section in the code below is ignored.

The matchMultipleEndpoints attribute indicates the required action to be taken if the utility finds multiple Endpoints or Deployment:BPEL assets in Oracle Enterprise Repository that match a target in EM. If true, then it updates all the endpoints with metrics (and log a warning). If false, then it skips the target (and log a warning).

The matchMultipleServices attribute indicates the required action to be taken if the utility finds multiple Services or Business Process:BPEL assets in Oracle Enterprise Repository that match a target in EM, during endpoint creation. If true, then it attaches new Endpoints / Deployment:BPELs to each of the matching assets (and log a warning). If false, then it skips the target (and log a warning).

The introspectionDescription, introspectionVersion, and registrationStatus attributes indicate properties that are set on any assets created.

<repository>
<uri>http://localhost:7131/oer30/services/FlashlineRegistry</uri>
<credentials>
<enableTransaction>false</enableTransaction>
<triggerEvent>false</triggerEvent>
</credentials>
<timeout>120000</timeout>
</repository>
<introspectionSettings>
<createMissingEndpoints>true</createMissingEndpoints>
<introspectionDescription>Found in EM </introspectionDescription>
<introspectionVersion>1.0</introspectionVersion>
<namespace>mythings</namespace>
<!-- The Valid Registration states are 1)Unsubmitted 2)Submitted - Pending
Review 3)Submitted - Under Review 4) Registered -->
<registrationStatus>Submitted</registrationStatus>
</introspectionSettings>
<emDatabase>
<driverClass>oracle.jdbc.driver.OracleDriver</driverClass>
<url>jdbc:oracle:thin@remotehost.there.com:1501:mysid</url>
<credentials>
<user>sysman</user>
</credentials>
</emDatabase>


Note:

It is recommended that you run the Enterprise Manager Integration Utility as a user with the Basic Access Settings for Assets - View, Edit, Accept, and Register.

Alternatively, the connection information can also be passed as parameters to the command line utility as follows:

C:\test\em-integration> em-integration - er_url http://localhost:7101/oer/services/FlashlineRegistryTr -er_user admin - er_password <password> - em_url jdbc:oracle:thin:@remotehost.there.com:1501:mysid - em_user sysman - em_password <empassword>

This section describes the following advanced configuration options for the Enterprise Manager Integration utility:

#### 5.3.2.1Metric Mappings

The mapping between metrics in EM and fields in Oracle Enterprise Repository are configured in em-integration-settings.xml, as shown in Figure 5-2. To change these from the default settings, open this file and modify the following:

• <metricMappingGroup>: Mappings for a set of metrics with the same metric name in the EM database views. EM groups a set of related metrics under the same "metric name". Each individual metric has a different "metric column". This element has the following attribute:

• metricName: The EM metric name from the EM database views.

• <metricMapping>: Mapping for a single metric. This element has the following attributes:

• metricColumn: The EM metric column from the EM database views.

• rollupPeriod: Indicates which EM database view to query against, and how to aggregate the data. Must be one of {DAILY, WEEKLY, MONTHLY, CURRENT}.

• viewColumn: Indicates which column in the EM database view to pull the data from. Must be one of {VALUE, AVERAGE, SUM, MINIMUM, MAXIMUM, STANDARD_DEVIATION, SAMPLE_COUNT, COLLECTION_TIMESTAMP, ROLLUP_TIMESTAMP, NOW(), DETAILS_URL}.

• The CURRENT rollup period does not support columns AVERAGE, SUM, MINIMUM, MAXIMUM, STANDARD_DEVIATION, SAMPLE_COUNT, or ROLLUP_TIMESTAMP.

• The DAILY, WEEKLY and MONTHLY rollup periods doe not support columns VALUE or COLLECTION_TIMESTAMP.

• NOW() is a "virtual column" that contains the time of the query against EM.

• DETAILS_URL is a "virtual column" that contains a URL to the detailed information in EM. This is constructed by the EM Integration code - it's not in the EM database views.

• oerField: The internal name of the custom data field in Oracle Enterprise Repository where this data is stored.

• overwrite: Indicates whether to overwrite the custom data field in Oracle Enterprise Repository if it already has data. It represents either true or false, by default the value is true, if not specified.

#### 5.3.2.2Target Finders

The logic for correlating targets in EM with assets in Oracle Enterprise Repository is different for each target type. EM Integration ships with target finders for the following products: Oracle Service Bus, BPEL-PM, WebLogic.

If you are an advanced user, then you can create your own target finder classes. These must be configured in em-integration-settings.xml, as shown in Figure 5-3.

• <targetFinder>: Mappings for a target type in EM to a target finder class. This element has the following attributes

• targetType: The EM target type from the EM database views.

• targetFinderClass: The fully-qualified classname of the finder class. This must implement com.oracle.oer.integration.em.TargetFinder, which is found in em-integration.jar.

#### 5.3.2.3Logging

EM Integration uses log4j for logging the detailed tasks performed and the log file is placed in the <EM Integration Home>. The logging options can be changed by updating the log4fl.properties file located in the <EM Integration> folder.

## 5.4Encrypting the Configuration File Passwords

To ensure security, the passwords in the configuration file must be encrypted before running the Enterprise Manager Integration utility. You can encrypt the configuration file passwords in the EM using either of the following methods:

From the Command Prompt

1. Navigate to the <em_integration_home> directory.

2. From a command prompt, run the password encryption tool as follows:

> encrypt.bat em-integration-settings.xml em-integration-settings.xml

The password encryption tool, (encrypt.bat/encrypt.sh), which is located in <Oracle_home>/tools/solutions/11.1.1.2.0-OER-PasswordTools.zip, allows you to encrypt the passwords that are stored in the configuration file, em-integration-settings.xml.

From the Oracle Enterprise Repository Web Console

1. Navigate to the Oracle Enterprise Repository Web console at

http://<host>:<port>/<domain>/diag/encryptstrings.jsp (replace host, port, and domain to match to your computer credentials)

2. Scroll down to the Tools section and click the Encrypt Strings for passwords link to launch the Password encryption page.

3. Enter the clear text password into the String to Encrypt text box.

4. Click the Submit Query button.

5. Copy the resulting encrypted password string and paste it into the appropriate context or properties file(s).

## 5.5Known Issues

This section describes the following known Enterprise Manager Integration Utility issues:

### 5.5.1 Using Incorrect Encrypted Password

If you configure the em-integration-settings.xml file with incorrect encrypted password, then a very long stack trace is displayed. An extract from the very long stack trace is as follows:

        at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unk
own Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl\$FragmentConten
Dispatcher.dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(U
known Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
at org.apache.axis.encoding.DeserializationContext.parse(Deserializatio
Context.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:424)
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnder
tandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2765)
at org.apache.axis.client.Call.invoke(Call.java:2748)
at org.apache.axis.client.Call.invoke(Call.java:2424)
at org.apache.axis.client.Call.invoke(Call.java:2347)
at org.apache.axis.client.Call.invoke(Call.java:1804)
at com.flashline.registry.openapi.service.v300.FlashlineRegistryTrSoapB