3 steps to new metric collection with OMi MP for Oracle Database

The monitoring needs of enterprises differ and each requires a specific set of monitoring to meet their needs. A single solution may cover most of the use cases for an enterprise, but there still may be few which are not covered with an out of the box solution. That’s exactly the reason why practitioners search for ways to extend the monitoring capabilities of any given solution.

 extending.jpg

Extensibility is a desired feature in a monitoring solution and “OMi Management Pack for Oracle Database” provides practitioners with the provision to extend its monitoring capabilities by adding User Defined Metrics. In this blog, I explore this feature of the management pack.

 

You can download the OMi Management Pack for Oracle Database to experience this monitoring capabilit...

 

What do we need to define our own metrics?

  1. We need to identify the metric we want to monitor
  2. We need a mechanism to collect the data
  3. We need a mechanism to alert when its value crosses a threshold

 We can achieve all of the above in three easy steps:

 

                         3StepsOraUDM.jpg

 

Step 1: Identify and Define User-Defined Metric

Step 2. Configure parameters

Step 3. Deploy monitoring

 

Let us look at the steps one by one in detail.

 

Step 1: Defining User-Defined Metrics

So here I am going with the assumption that we are aware of the “What” part i.e. we have already identified the Oracle Database metrics we want to monitor.

 

OMi Management Pack for Oracle Database” provides pre-defined policy templates to help define one’s own metrics (aka User Defined Metrics). These policy templates are part of User Defined Aspects (UDA). Below are the steps you need to follow to define a UDM.

 

1. Edit the Oracle Aspect “Oracle UDA

oracle_UDA.jpg
2. Click the Policy Templates tab and edit the “OracleDB_UDM” policy template
3. Click the Policy Data tab. It contains sample example of a user defined metric. Edit the section as required. The version number of the Sample UDM policy is incremented by 1 Oracle_UDM_EditPolicy.jpg

 

For example below is a SQL code snippet that will count the number of “blocked sessions”. This code snippet can be added to the policy data section of the policy template. 

--------------------------------CODE SNIPPET-----------------------------------------------

 

ORACLE

            METRIC 0702

                      COLLECT MW ITO "

                                      declare

                                                    sql1_val number;

                                      begin

                                                   :dbspi_error := '<no error>';

                                                   select count(*) into sql1_val from v$session

                                                                          where blocking_session is not null;

                                                   :dbspi_value := sql1_val;

                                       exception

                                                    when OTHERS then :dbspi_value := -1 ;

                                       end;

                           "

-------------------------------------------------------------------------------------------------

Things to know about the above code:

dbspi_value -> pre-defined variable to store the value of the metric. It is mandatory to store the value of the metric we intend to query in this variable

 

METRIC 0702 -> Identifies a section to define metric. In this case metric number 0702

 

We have now defined the metric. The “OMi Management Pack for Oracle Database” will start collecting the data when the policy templates are deployed to the appropriate Oracle Database Instance.

 

Step 2: Configure parameters

Having defined the metric, we need a mechanism to generate alert when the metric value crosses a defined threshold. We achieve this by updating a predefined policy template. We will also parameterize the configurable fields like threshold using this template.

 

Parameters are key to a simplified configuration as it allows for configuration of the values at run time during deployment. “OMi Management Pack for Oracle Database” provides a sample policy template that can be reused to achieve this as mentioned below:

 

1. Navigate to “Admin > Operations Management > Monitoring > Policy Templates” and select the policy OracleDB_07XX. The policy will be listed under “Measurement Threshold Templates” Oracle_Edit_UDM_MON.png

2. Right click; select copy item and then paste the item. This will create a copy of the policy.
3. Rename the policy appropriately. In this case rename it to OracleDB_0702.

Oracle_UDM_Paste_Policy.jpg

 

4. Edit this policy in raw mode. Change the “Message Text” and other fields as required

5. Select Policy Parameters tab and edit the parameters as required. For example, to modify the UDM frequency, you can select the parameters UDM frequency and edit it. The Edit Parameter window opens. You can modify the default values and then click OK. The version of the policy template OracleDB_0702 increments by 1. The parameter UDM frequency identifies the frequency at which the metric will be collected.

 

Oracle_Edit_Params_Mon.jpg

 

Step 3. Deploy monitoring

Having created the UDM and the configured the required parameters, the final step is to deploy the created policies.

 

1. Navigate to Admin > Operations Management > Monitoring > Policy Templates and select the following templates and assign it to appropriate node.

                      OracleDB_UDM
                      OracleDB_0702

2. Fill in the values of the parameters as required before finishing the assignment.

 

This will deploy the UDM templates to node. The OMi Management Pack for Oracle Database will start collecting this new metric from the next schedule.

 

Takeaway:

So if you are aware of the metric that you want to collect then it is just 3 simple steps to extend the OMi Management Pack for Oracle Database’s capability to monitor your metric.

 

To learn more, visit the OMi Management Pack page.

 

Download the OMi Management Pack for Oracle Database here to experience this monitoring capability f...

 

Other References:

HP OMi now includes Automation to simplify IT Monitoring

Do you Hadoop? Very Vertica? Overly ORACLE ? Incredibly Infrastructure? Let HP OMi help out

OMi Management Pack for Vertica - Part 1: The Need

Demystifying Oracle Database Monitoring with Omi Management Pack for Oracle Database

The New Deal: Monitoring Microsoft SQL Server with OMi Management Pack

 

Leave a Comment

We encourage you to share your comments on this post. Comments are moderated and will be reviewed
and posted as promptly as possible during regular business hours

To ensure your comment is published, be sure to follow the Community Guidelines.

Be sure to enter a unique name. You can't reuse a name that's already in use.
Be sure to enter a unique email address. You can't reuse an email address that's already in use.
Type the characters you see in the picture above.Type the words you hear.
Search
About the Author
Manoj Mohanan is a Software Engineer working in the HP OMi Management Packs team. Apart being a developer he also dons the role of an enable...


Follow Us
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation