Sei sulla pagina 1di 13

08/01/2016 Oracle Enterprise Manager 12c Enterprise Ready Framework: Create and Use Metric Extensions

/
Oracle Enterprise Manager 12c Enterprise Ready Framework: Create
and Use Metric Extensions 
Purpose
In this tutorial, you learn how to create a simple metric extension. The metric extension will be used to check
the CPU utilization of the agent process.

Time to Complete
Approximately 1 hour.

Overview
Metric Extensions allow you to extend Enterprise Manager monitoring capabilities to cover critical
information specific to the operation of your environment. This provides you with a more comprehensive
view of your monitored environment. In addition, metric extensions simplify IT processes by leveraging
Enterprise Manager as the primary monitoring tool used for your data center rather than relying on separate
monitoring tools.

Scenario
In this tutorial, you will:

Create and test a metric extension that will monitor the CPU utilization by the agent process on machines
you are monitoring in your data center
Save the metric extension as a deployable draft
Publish the metric extension, and then deploy the metric extension on the targets that you want to
monitor

Software Requirements
The following is a list of software requirements:

Download and install the Oracle Enterprise Manager Cloud Control 12c software, available from OTN at
this link. You can either install the Oracle Management Repository (OMR) and Oracle Management
Server (OMS) on a single host, or on two separate hosts. The examples used in this series of hands­on
exercises have the OMR installed in a database called emrep on a host named host01.example.com,
with the OMS running on the host host02.example.com.
Add two hosts as targets, each of which also has an Oracle database installed. Our example architecture
has the HR database running on host03.example.com, and the Sales database running on
host04.example.com.

This example architecture is shown diagrammatically below:

Prerequisites
Before starting this tutorial, you should:

Have the software installed as listed under Software Requirements
Have created your own super administrator account in Enterprise Manager Cloud Control 12.1 as
described here.
Downloaded the CPU usage perl script available at this link.

Note: Screen captures for this tutorial were taken in a Linux environment; if you are using a different
operating system the browser look and feel will vary slightly.

Creating A Metric Extension
1. The metric extension that we will be creating is a host based metric extension. To create the metric extension, first
you need to login to Enterprise Manager Cloud Control using the super administrator account you created earlier.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/em/em12c/metric_extensions/Metric_Extensions.html 1/13
08/01/2016 Oracle Enterprise Manager 12c Enterprise Ready Framework: Create and Use Metric Extensions
From the home page, choose the Enterprise menu, then Monitoring, and then Metric Extensions:

2. On the "Metric Extensions" page, scroll down and click the Create button:

3. On the "Create New : General Properties" page, enter the following values in the "General Properties" region then
click on the Next button:

Target Property Value
Target Type Host
Name Agent_CPU_Util
Display Name Agent CPU Utilization
Adapter OS Command ­ Multiple Columns
Description Displays the percentage of CPU being used by the agent process

http://www.oracle.com/webfolder/technetwork/tutorials/obe/em/em12c/metric_extensions/Metric_Extensions.html 2/13
08/01/2016 Oracle Enterprise Manager 12c Enterprise Ready Framework: Create and Use Metric Extensions

4. This brings up the "Create New : Adapter" page where you specify the adapter definition properties. In this
example, we will be running a Perl script so you need to enter the path to the Perl executable as the command.
Note the list of available variables on the right hand side of the screen here includes "%perlBin% as the location o
the perl binary, so the command to be entered here is %perlBin%/perl. To locate the perl script to be executed,
click on the pencil icon to the right of the "Script" field:

5. This will bring up the File Editor screen. If you click on the Upload button, it will allow you to browse for the file to
load:

6. From here, locate and select the cpu_usage.pl script and click the Open button:

7. Next, click OK:

8. The file contents will then be displayed (Note: If you don't have the cpu_usage.pl script, you can just type it into the
File Contents window as well). Notice the two values returned via the print em_result statement are separated by
the vertical bar ("|") delimiter. Click OK.

Note: In the script, make sure that the emctl and ps statements are enclosed in backquotes (also known as back
ticks), otherwise the statements will not execute, and you will not see any results when you test the Metric. Also,
note that you need to include the correct full path to emctl (which is running on the target) if you have multiple
versions of EM agents running on the taret.

9. The "Script" field has now been filled in for you. The "Delimiter" field defaults to the vertical bar, which is what we
want in this case. Since the print statement starts with em_result=, that is what we need to enter for the "Starts
With" field. Click Next:

10. Next, we need to define the columns returning the information from the metric extension. On the "Create New :
Columns" page, click the Add button:

11. The first column to add is the agent process ID. Enter a name of agent_PID, display name of Agent PID
the column to be a Key Column and click OK:

12. The first column has now been added. Click Add again to add the second column to contain the CPU utilization
value:

13. Enter a name of agent_CPU_util, a display name of Agent CPU Utilization (%), define the column to be o
type Data Column and enter Pct for a unit. This time, we want to add an alert threshold as well, so select the
comparison operator, >, and enter a warning level of 80 and a critical level of 95. We also want to only receive
notifications after 3 alert thresholds, so click on the Advanced button to access this field:

http://www.oracle.com/webfolder/technetwork/tutorials/obe/em/em12c/metric_extensions/Metric_Extensions.html 3/13
08/01/2016 Oracle Enterprise Manager 12c Enterprise Ready Framework: Create and Use Metric Extensions
14. Enter a value of 3 for the "Number of Occurrences Before Alert" field, and click OK:

15. You should now see both columns added. Click Next:

16. On the "Create New : Credentials" page, accept the defaults and click Next:

17. Next, we need to add targets, so on the "Create New : Test" page, click Add:

18. Select the host you want to execute the metric extension on (in our example, this is host03.example.com
Select:

19. You should now see the host target name added. Click Run Test to validate the script executes correctly on the
target:

20. While the test is running, you will see the "Testing Results ­ In Progress" screen (this will automatically close if the
test is successful):

21. You should now be returned to the "Create New : Test" screen, and the "Test Results" region should be populated
with the target name, Agent PID and Agent CPU Utilization (%) fields. Click Next:

22. The "Create New : Review" screen will now appear. Scroll down and check the testing status area shows no
failures and click Finish:

23. You should now be returned to the "Metric Extensions" screen, and a confirmation message should be displayed
confirming the metric extension was successfully created:

Saving The Metric Extension As A Deployable Draft
1. The next stage of creating a metric extension is to save it as a deployable draft. Firstly, let's give ourselves some
more real estate on the screen by closing the confirmation the metric extensions was successfully created by
clicking the small x on the right hand side of the confirmation message as well as closing the overview by clicking
the arrow on the left of "Hide Overview":

http://www.oracle.com/webfolder/technetwork/tutorials/obe/em/em12c/metric_extensions/Metric_Extensions.html 4/13
08/01/2016 Oracle Enterprise Manager 12c Enterprise Ready Framework: Create and Use Metric Extensions

2. Ensure the metric extension is highlighted, then click the Actions menu and select Save As Deployable Draft

3. The "Status" column should now show a value of "Deployable Draft":

http://www.oracle.com/webfolder/technetwork/tutorials/obe/em/em12c/metric_extensions/Metric_Extensions.html 5/13
08/01/2016 Oracle Enterprise Manager 12c Enterprise Ready Framework: Create and Use Metric Extensions

Publishing and Deploying The Metric Extension
1. The final stage of the process is to publish the metric extension and deploy it to the targets you want to use it on.
Again, ensure the metric extension is highlighted and select the Actions menu, but this time choose Publish
Metric Extension from the list of menu items:

2. The "Status" column should now show a value of "Published":

http://www.oracle.com/webfolder/technetwork/tutorials/obe/em/em12c/metric_extensions/Metric_Extensions.html 6/13
08/01/2016 Oracle Enterprise Manager 12c Enterprise Ready Framework: Create and Use Metric Extensions

3. Next, from the Actions menu select the Deploy to Targets... option:

4. On the "Deploy To Targets" screen, click the Add button:

http://www.oracle.com/webfolder/technetwork/tutorials/obe/em/em12c/metric_extensions/Metric_Extensions.html 7/13
08/01/2016 Oracle Enterprise Manager 12c Enterprise Ready Framework: Create and Use Metric Extensions

5. The "Search and Select: Targets" screen appears. From the list of targets, select the host you want to deploy the
metric extension to (in our example, host03.example.com), and click Select:

6. The host should be added to the list of targets, so now you just need to click Submit:

http://www.oracle.com/webfolder/technetwork/tutorials/obe/em/em12c/metric_extensions/Metric_Extensions.html 8/13
08/01/2016 Oracle Enterprise Manager 12c Enterprise Ready Framework: Create and Use Metric Extensions

7. The "Pending Deploy Operations" page now appears. Click the Refresh button in the top right hand corner of the
screen, until the value "No data found" is shown in the "Pending Deploy Operations" list. This will show the metric
extension has been successfully deployed:

 Print Preview

Oracle Enterprise
Manager 12c
Enterprise Ready
Framework: Create
and Use Metric
Extensions 
This tutorial contains the
following sections:

Purpose
Time to Complete
Overview
Scenario
Software Requirements
Prerequisites
Creating A Metric Extension
Saving The Metric Extension
As A Deployable Draft
Publishing and Deploying
The Metric Extension
Summary
Resources

Viewing
Screenshots
8. Since the metric extension has been successfully deployed, we need to return to the "Metric Extensions" page by
Click icon to show clicking the Metric Extensions link:

all screenshots

Note: Alternatively, you can
click an individual icon (or
image) associated with each
step to view (or hide) the
screenshot associated with
that step.

http://www.oracle.com/webfolder/technetwork/tutorials/obe/em/em12c/metric_extensions/Metric_Extensions.html 9/13
08/01/2016 Oracle Enterprise Manager 12c Enterprise Ready Framework: Create and Use Metric Extensions

9. You should now see the metric extension has been deployed to one target. Click on the link in the Deployed
Targets column:

http://www.oracle.com/webfolder/technetwork/tutorials/obe/em/em12c/metric_extensions/Metric_Extensions.html 10/13
08/01/2016 Oracle Enterprise Manager 12c Enterprise Ready Framework: Create and Use Metric Extensions

10. Next, click on the target name link:

11. From the host home page, select Host, then Monitoring, then All Metrics:

12. From the list of metrics, click the Agent CPU Utilization link:

http://www.oracle.com/webfolder/technetwork/tutorials/obe/em/em12c/metric_extensions/Metric_Extensions.html 11/13
08/01/2016 Oracle Enterprise Manager 12c Enterprise Ready Framework: Create and Use Metric Extensions

13. Depending on your timing, you may see "No data to deploy" in the "Agent CPU Utilization (%)" part of the screen. 
so, click on the Refresh button until data appears:

http://www.oracle.com/webfolder/technetwork/tutorials/obe/em/em12c/metric_extensions/Metric_Extensions.html 12/13
08/01/2016 Oracle Enterprise Manager 12c Enterprise Ready Framework: Create and Use Metric Extensions

Summary
Metric Extensions allow you to extend Enterprise Manager monitoring capabilities to cover critical
information specific to the operation of your environment. This provides you with a more comprehensive
view of your monitored environment. In addition, metric extensions simplify IT processes by leveraging
Enterprise Manager as the primary monitoring tool used for your data center rather than relying on separate
monitoring tools.

In this tutorial, you should have learned how to:

Create and test a metric extension that will monitor the CPU utilization by the agent process on machines
you are monitoring in your data center
Save the metric extension as a deployable draft
Publish the metric extension, and then deploy the metric extension on the targets that you want to
monitor

Resources
Oracle Enterprise Manager documentation set
To learn more about Oracle Enterprise Manager, refer to additional OBEs in the Oracle Learning Library

Copyright © 2011, Oracle and/or its affiliates. All rights reserved

http://www.oracle.com/webfolder/technetwork/tutorials/obe/em/em12c/metric_extensions/Metric_Extensions.html 13/13

Potrebbero piacerti anche