7 Using Monitoring Templates

Monitoring templates simplify the task of setting up monitoring for large numbers of targets by allowing you to specify the monitoring and Metric and Collection Settings once and applying them to many groups of targets as often as needed.

This chapter covers the following topics:

7.1 About Monitoring Templates

Monitoring templates let you standardize monitoring settings across your enterprise by allowing you to specify the monitoring settings once and apply them to your monitored targets. You can save, edit, and apply these templates across one or more targets or groups. A monitoring template is specified for a particular target type and can only be applied to targets of the same type. For example, you can define one monitoring template for test databases and another monitoring template for production databases.

A monitoring template defines all Enterprise Manager parameters you would normally set to monitor a target, such as:

  • Target type to which the template applies.

  • Metrics (including metric extensions), thresholds, metric collection schedules, and corrective actions.

Once a monitoring template is defined, it can be applied to your targets. This can be done either manually through the Enterprise Manager console, via the command line interface (EM CLI), or automatically using template collections. See "Defining Template Collections" for more information. For any target, you can preserve custom monitoring settings by specifying metric settings that can never be overwritten by a template.

Oracle-Certified Templates

In addition to templates that you create, there are also Oracle-certified templates. These templates contain a specific set of metrics for a specific purpose. The purpose of the template is indicated in the description associated with the template.

Example: The template called Oracle Certified - Enable AQ Metrics for SI Database contains metrics related to Advanced Queueing for single instance databases. You can use this Oracle-certified template if you want to use the AQ metrics. Or you can copy the metric settings into your own template.

7.2 Definition of a Monitoring Template

A monitoring template defines all Enterprise Manager parameters you would normally set to monitor a target. A template specifies:

  • Name: A unique identifier for the template. The template name must be globally unique across all templates defined within Enterprise Manager.

  • Description: Optional text describing the purpose of the template.

  • Target Type: Target type to which the template applies.

  • Owner: Enterprise Manager administrator who created the template.

  • Metrics: Metrics for the target type. A monitoring template allows you to specify a subset of all metrics for a target type. With these metrics, you can specify thresholds, collection schedules and corrective actions.

  • Other Collected Items: Additional collected information (non-metric) about your environment.

7.3 Default Templates (Auto Apply Templates)

Under certain circumstances, Oracle's out-of-box monitoring settings may not be appropriate for targets in your monitored environment. Incompatible Metric and Collection Settings for specific target types can result in unwanted/unintended alert notifications. Enterprise Manager allows you to set default monitoring templates that are automatically applied to newly added targets, thus allowing you to apply monitoring settings that are appropriate for your monitored environment.

Note:

Super Administrator privileges are required to define default monitoring templates.

7.4 Viewing a List of Monitoring Templates

To view a list of all Monitoring Templates, from the Enterprise menu, select Monitoring and then Monitoring Templates.

The Monitoring Templates page displays all the out-of-box templates and the templates for which you have has at least VIEW privilege on. Enterprise Manager Super Administrators can view all templates.

Figure 7-1 Monitoring Templates


Monitoring Templates page

You can begin the monitoring template creation process from this page.

7.5 Creating a Monitoring Template

Monitoring templates allow you to define and save monitoring settings for specific target types. As such, specific Enterprise Manager privileges are required in order to create monitoring templates.

There are two resource privileges that can be granted to a user/role that allows you to create and/or view monitoring templates:

  • Create Monitoring Template

    This privilege allows you to create a monitoring template.

  • View Any Monitoring Template

    This privilege allows you to view any monitoring template.

These privileges can be granted from the Resource Privilege page of an Enterprise Manager user, or when creating a role.

Monitoring templates adhere to a typical access model: You can grant either FULL or VIEW access on a template to other users or roles. VIEW access allows you to see and use the monitoring template. FULL access allows you to see, use, edit and delete a monitoring template. The template owner can change access to a template.

By default, Enterprise Manager Super Administrators have FULL access on all monitoring templates.

Monitoring template allow you to define and save monitoring settings for specific target types. To define a new template:

  1. From the Enterprise menu, select Monitoring and then Monitoring Templates.
  2. Click Create. Enterprise Manager gives you the option of selecting either a specific target or a target type. Template monitoring settings are populated according to the selected target or target type. Click Continue.

    Note:

    If the selected target type is either Web Application or Service, you will only be able to select those targets for which you have Operator privilege.

  3. Enter requisite template information on the General, Metric Thresholds, and Other Collected Items tabs.

    On the Metric Thresholds tab, you can delete or add monitoring template metrics. To delete existing metrics, select one or more metrics and click Remove Metrics from Template.

    To add metrics, click Add Metrics to Template. The Add Metrics to Template page displays as shown in the following graphic.


    add metric to monitoring template

    On this page, you can select a source from which you can copy metrics to the template. Sources include specific targets, other monitoring templates, or metric extensions. When adding metric to a template from another template, if the metric has adaptive settings, then the adaptive settings will not be copied: Only the metric will be copied along with existing thresholds.

    Note: You must define the metric extension thresholds in order to add it to a monitoring template.

    Click Continue once your have finished modifying the template metrics.

  4. Once you have finished entering requisite information, click OK.

7.6 Editing a Monitoring Template

The Monitoring Templates page lists all viewable templates. To edit a template, you must have FULL access privileges.

To edit a Monitoring Template:

  1. From the Enterprise menu, select Monitoring, and then Monitoring Templates.
  2. Choose the desired template from the table.
  3. Click Edit.
  4. Once you have finished making changes, click OK.

Sharing Access with Other Users

By default, template owners (creators) have FULL access privileges on the template and Enterprise Manager Super Administrators have FULL access privileges on all templates. Only the template owner can change access to the template. You, as owner, can grant VIEW (view the template) or FULL (edit or delete the template) on the template to a user or role.

7.7 Applying Monitoring Templates to Targets

As mentioned earlier, a monitoring template can be applied to one or more targets of the same target type, or to composite targets such as groups. For composite targets, the template is applied to all member targets that are of the appropriate type. If you applied the template manually or via EM CLI, once a template is applied, future changes made to the template will not be automatically propagated to the targets: You must reapply the template to all affected targets

Administration Groups and Template Collections: Applying Monitoring Templates Automatically

Monitoring templates can be automatically applied whenever a new targets are added to your Enterprise Manager environment. Automation is carried out through Administration Groups and Template Collections Administration Groups are a special type of group used to automate application of monitoring settings to targets upon joining the group. When a target is added to the administration group Enterprise Manager applies monitoring settings from the associated template collection consisting of monitoring templates, compliance standards, and cloud policies. If changes are later made to the monitoring template, Enterprise Manager automatically applies the changes to the relevant targets based on the synchronization schedule. For more information, see "Using Administration Groups".

7.7.1 Applying a Monitoring Template

To apply a template, you must have at least Manage Target Metrics target privileges on the destination target(s).

  1. From the Enterprise menu, select Monitoring and then Monitoring Templates.
  2. Select the desired template from the table.
  3. Click Apply.
  4. Select the desired apply options and the target(s) to which you want the templates applied. See Monitoring Template Application Options for additional information.
  5. Click OK.

7.7.2 Monitoring Template Application Options

You can choose aggregate targets such groups, systems or clusters as destination targets. The templates will apply to the appropriate members of the group/system/cluster as they currently exist. If new members are later added to the group, you will need to re-apply the template to those new members. Template application is performed in the background as asynchronous jobs, so after the apply operation is performed, you can click on the link under the Pending Apply Operations column in the main templates table to see any apply operations that still are pending.

When applying a Monitoring Template, metric settings such as thresholds, comparison operators, and corrective actions are copied to the destination target. In addition, metric collection schedules including collection frequency and upload interval are also copied to the target. You determine how Enterprise Manager applies the metric settings from the template to the target by choosing an apply option.

7.7.2.1 Apply Options

Template apply options control how template metric and policy settings are applied to a target. Two template apply options are available:

  • Template will completely replace all metric settings in the target: When the template is applied, all metrics and policies defined in the template will be applied to the target. Pre-existing target monitoring settings not defined in the template will be disabled: Metric thresholds will be set to NULL or blank. Policies will be disabled. This effectively eliminates alerts from these metrics and policies by clearing current severities and violations.

  • Template will only override metrics that are common to both template and target: When the template is applied, only metrics and policies common to both the template and target are updated. Existing target metric and policies that do not exist in the template will remain unaffected. When this option is selected, additional template apply options are made available for metrics with key value settings.

7.7.2.2 Metrics with Key Value Settings

A metric with key value settings is one that can monitor multiple objects at different thresholds. For example, the Filesystem Space Available(%) metric can monitor different mount points using different warning and critical thresholds for each mount point.

When the template contains a metric that has key value settings, you can choose one of three options when applying this template to a target. As an example, consider the case where the template has the following metric:

Filesystem Space Available(%)

Mount Point Operator Warning Threshold Critical Threshold

/

40

20

/private

30

20

/private2

20

20

/u1

30

20

All Others

25

15

And a host target has the same metric at different settings:

Mount Point Operator Warning Threshold Critical Threshold

/

30

10

/private

25

15

/private2

20

20

All Others

25

15

These are the results for each option:

1) All key value settings in the template will be applied to the target, any additional key values settings on the target will not be removed

When the template is applied to the target using this copy option, all the template settings for the mount points, /, /private, and /U1 will be applied. Existing target settings for mount points not covered by the template remain unaffected. Thus, the resulting settings on the target for this metric will be:

Mount Point Operator Warning Threshold Critical Threshold

/

40

20

/private

30

20

/u1

30

20

2) All key value settings in the template will be applied to target, any additional key value settings on the target will be removed.

When the template is applied to the target using this copy option, all template settings will be applied to the target. Any object-specific threshold settings that exist only on the target will be removed, any object-specific thresholds that are only in the template will be added to the target. Thus, the final settings on the target will be:

Mount Point Operator Warning Threshold Critical Threshold

/

40

20

/private

30

20

/u1

30

20

All Others

25

15

3) Only settings for key values common to both template and target will be applied to the target

When the template is applied to the target using this copy option, only the settings for the common mount points, / and /private will be applied. Thus, the resulting settings on the target for this metric will be:

Mount Point Operator Warning Threshold Critical Threshold

/

40

20

/private

30

20

/private2

20

20

All Others

25

15

7.8 Comparing Monitoring Templates with Targets

The intended effect of applying Monitoring Templates to destination targets is not always clear. Deciding how and when to apply a template is simplified by using the Compare Monitoring Template feature of Enterprise Manager. This allows you to see at a glance how metric and collection settings defined in the template differ from those defined on the destination target. You can easily determine whether your targets are still compliant with the monitoring settings you have applied in the past. This template comparison capability is especially useful when used with aggregate targets such as groups and systems. For example, you can quickly compare the metric and collection settings of group members with those of a template, and then apply the template as appropriate.

Performing a Monitoring Template-Target comparison:

  1. From the Enterprise menu, select Monitoring and then Monitoring Templates.
  2. Choose the desired template from the table.
  3. Click Compare Settings. The Compare Monitoring Template page displays.
  4. Click Add to add one or more destination targets. The Search and Select dialog displays.
  5. Select a one or more destination targets and then click Select. The selected targets are added to the list of destination targets.
  6. Select the newly added destination targets and then click Continue. A confirmation message displays indicating the Compare Template Settings job was successfully submitted.
  7. Click OK to view the job results. Note: Depending on the complexity of the job run, it may take time for the job to complete.

7.8.1 When is a metric between a template and a target considered "different"?

The metric is said to be different when any or all the following conditions are true (provided the target does not have "Template Override" set for that metric):

  • The Warning Threshold settings are different

  • The Critical Threshold settings are different.

  • The Collection Schedules are different.

  • The Upload Intervals are different.

  • The number of occurrences (for which the metric has to remain at a value above the threshold before an alert is raised) are different.)

  • For user-defined metrics, in addition to the above, the OS Command/SQL statement used to evaluate the user-defined metric is different. Note that this applies only if the user-defined metric name and the return type are the same.

  • The metric extension marked for delete will be shown as "different" on the destination target and the template only if:

    • A metric extension with the same name exists on both the destination target and template.

    • The return type (String, Numeric) of the metric extension is the same on both the destination target and template.

    • The metric type is the same on both the destination target and the template.

7.9 Comparing Metric Settings Using Information Publisher

In addition to viewing metric differences between Monitoring Templates and destination targets using the Compare Monitoring Template user-interface, you can also use Information Publisher to generate reports containing the target-template differences. Using Information Publisher's reporting capabilities gives you more flexibility for displaying and distributing metric comparison data. For more information, see "Using Information Publisher".

Create a Report Definition

  1. From the Enterprise menu, select Reports and then Information Publisher Reports.

  2. Click Create. The Create Report Definition user interface is displayed.

  3. On the General page, specify the report name, how targets should be included, target privileges, report time period, and display options.

  4. On the Elements page, click Add to access the Add Element page.

  5. Select the Monitoring Template Comparison element and click Continue to return to the Element page.

  6. Once you have added the report element, click the Set Parameter icon to specify requisite operational parameters. On this page, you specify a report header, select a monitoring template, destination targets, and template application settings for multiple threshold metrics. Click Continue to return to the Elements page.

  7. Click Layout to specify how information should be arranged in the report.

  8. Click Preview to validate that you are satisfied with the data and presentation of the report.

  9. On the Schedule page, define when reports should be generated, and whether copies should be saved and/or sent via e-mail, and how stored copies should be purged.

  10. On the Access page, click Add to specify which Enterprise Manager administrators and/or roles will be permitted to view this generated report. Additionally, if you have GRANT_ANY_REPORT_VIEWER system privilege, you can make this report definition accessible to non-credential users via the Enterprise Manager Reports Website

  11. Click OK when you are finished.

  12. Validate the report definition. If the parameters provided conflict, validation errors or warnings will appear and let you know what needs attention.

  13. Once the report definition has been saved successfully, it appears in the Report Definition list under the Category and Subcategory you specified on the General page.

Viewing the Report

  1. Find the template comparison report definition in the Report Definition list. You can use the Search function to find or filter the list of report definitions.

  2. Click on the report definition title. If the report has a specified target, the report will be generated immediately. If the report does not have a specified target, you will be prompted to select a target.

Scheduling Reports for Automatic Generation

  1. Create or edit a report definition.
  2. On the Schedule page, choose the Schedule Report option.
  3. Specify a schedule type. The schedule parameters on this page change according to the selected schedule type.

When reports are scheduled for automatic generation, you have the option of saving copies to the Management Repository and/or sending an e-mail version of the report to designated recipients.

If a report has been scheduled to save copies, a copy of the report is saved each time a scheduled report completes. When a user views a report with saved copies by clicking on the report title, the most recently saved copy of the report is rendered. To see the complete list of saved copies click on the Saved Copies link at the top of the report. Enterprise Manager administrators can generate a copy of the report on-demand by clicking on the Refresh icon on the report.

7.10 Exporting and Importing Monitoring Templates

For portability, monitoring templates can be exported to an XML file and then imported into another Enterprise Manager installation as an active template.

Note:

You can export templates from Enterprise Manager 10g release 2 or higher and import them into Enterprise Manager 13c.

Exporting a Monitoring Template

To export a template to an XML file:

  1. From the Enterprise menu, select Monitoring and then Monitoring Templates.

  2. Select the desired monitoring template from the table.

  3. Click Export.

    Note: If you are running an Enterprise Manager 11g or earlier release, use the EM CLI export_template verb to perform the export operation. Note that if the monitoring template contains policy rules from earlier Enterprise Manager releases (pre-12c) , these will not be imported into Enterprise Manager 12c as policy rules no longer exist in this release.

Importing a Monitoring Template

To import a template from an XML file:

  1. From the Enterprise menu, select Monitoring and then Monitoring Templates.
  2. Click Import. The Import Template page displays.
  3. Specify the monitoring template XML file you want to import.
  4. Click Import.

7.11 Upgrading Enterprise Manager: Comparing Monitoring Templates

When upgrading from one Enterprise Manager release to the next, you will accumulate monitoring templates that have been created for different releases. Beginning with Enterprise Manager release 12.1.0.4, you can generate a post-upgrade Monitoring Template Difference Report that allows you to view what templates had been created for various Enterprise Manager releases. To generate the Monitoring Template Difference Report, from the Setup menu, select Manage Cloud Control, and then Post Upgrade Tasks.

7.12 Changing the Monitoring Template Apply History Retention Period

You can view monitoring template apply history using the predefined report in Information Publisher. From the Enterprise menu, select Reports and then Information Publisher. On the Information Publisher page, you can enter "template" in the Title text entry field and click Go. The predefined report Monitoring Template Apply History (last 7 days) appears in the report list.

By default, Enterprise Manager retains the monitoring template apply history for a period of 180 days. If required, you can change the retention period to a value suitable for your monitoring needs. Although the retention period cannot be indefinite, it can be set to an extremely long period of time. Enterprise Manager provides the following PL/SQL API to change the retention period.

mgmt_template_ui.modify_purge_policy(p_retention_days=><num_days>)

This procedure takes a NUMBER as input (num_days).