2007/08/24

HowTo: Setup User Defined Metrics in OEM Grid Control

User Defined Metrics are a fantastic feature of OEM Grid Control. Do you use them? Well, you should! They are very easy to setup and are just as reliable as any other OEM alerts.

As an example, let's say you want to be notified whenever a certain schema has any invalid objects in it. This is how to setup such an alert:
  1. Navigate to the database instance "Home" page
  2. Click the "User Defined Metrics" link at the bottom of the page
  3. Click the "Create" button to create a new UDM
  4. Complete all of the form fields


    1. SQL query you would like to run (don't use a semi-colon at the end!)
    2. Credentials
    3. Thresholds
    4. Schedule
    5. Note that you can customize the subject line of the notification emails
    6. Click the "Test" button to make sure the results are what you want
    7. Click "Ok" to save this UDM
  5. Now, if you merely stop here, no notifications will ever be sent! Why? Because there is no Notification Rule defined, so let' s do that next...
  6. Click "Preferences" in the top right corner of any Grid Control page
  7. Click "Rules" in the left nav bar
  8. Create a new Notification Rule

  9. Voila! Now email notifications will be sent whenever your threshold is exceeded and the this metric automatically integrates with all of the Alert display boxes throughout OEM.
Cool huh?

5 comments:

sandarsh said...

hey any idea how to run plsqlprocedure in UDM. I can just see SQL's here

Brent said...

sandarsh: I have not yet tried using PL/SQL in a UDM...

Did you try just using a BEGIN/END block as seeing what was returned? Seems to me that there has to be some way to do it :)

Unknown said...

One important detail: You mentioned "You can modify subject line on the alert email" ,
i am not sure about that, the "message" field is for the message body. Please let me know if it is possible

Unknown said...

Hi Beent, You mentioned that "Note that you can customize the subject line of the notification emails", can you please let me know how?

Brent said...

The subject line is customized by entering the text into the "Alert Message" on the "Edit Used-Defined Metric" page.

Note: In the new OEM 11g, you can customize the body as well!