Mining EMGC Notification Alerts Reply

The past few days, I’ve been troubleshooting an email alerting problem on an EMGC 11.1 install on a client site.
But this troubleshooting also includes setting up my own email server and reproducing the problem http://karlarao.tiddlyspot.com/#EmailNotificationsNotSending
Watching/digging on the EM web based interface is tedious so I devised a way to just mine on the MGMT views… thanks to the MOS 421499.1 EMDIAG REPVFY Kit – which is a good source for mining the EMGC repository.

This simple query from the MGMT views will output something like this


SELECT t.target_name, t.target_type,
       substr(s.message,1,50) , substr(l.message,1,11) emailed,
       TO_CHAR(s.load_timestamp,'DD-MON-YYYY HH24:MI:SS') loaded,
       s.severity_guid,
       TO_CHAR(a.timestamp,'DD-MON-YYYY HH24:MI:SS') annotated,
       TO_CHAR(l.timestamp,'DD-MON-YYYY HH24:MI:SS') logged
FROM    mgmt_severity s, mgmt_targets t, mgmt_annotation a, mgmt_notification_log l
WHERE   
       s.target_guid     = t.target_guid
  AND  s.severity_guid   = a.source_obj_guid (+)
  AND  s.severity_guid   = l.source_obj_guid (+)
  -- AND a.annotation_type = 'NOTIFICATION'
  -- AND lower(s.message) like '%tablespace%percent%'
  -- AND lower(t.target_name) like '%mta%'
  -- AND s.severity_guid = 'B33A7C7DF7A0293CE040460A22EA5E84'
ORDER BY s.load_timestamp desc;

and with this data you can actually do filters.. lets say search for the tablespace alerts test cases that I created. This shows that it reached the metric threshold but it did not send the email because the “Emailed” column shows as as “null”

another thing you can do is have a query that shows monthly count of tablespace alerts that were sent or not sent..


select count(*), TO_DATE(loaded,'MON') loaded, emailed from (
SELECT t.target_name, t.target_type,
       substr(s.message,1,20) , substr(l.message,1,11) emailed,
       TO_CHAR(s.load_timestamp,'MON') loaded,
       s.severity_guid,
       TO_CHAR(a.timestamp,'DD-MON-YYYY HH24:MI:SS') annotated,
       TO_CHAR(l.timestamp,'DD-MON-YYYY HH24:MI:SS') logged
FROM    mgmt_severity s, mgmt_targets t, mgmt_annotation a, mgmt_notification_log l
WHERE   
       s.target_guid     = t.target_guid
  AND  s.severity_guid   = a.source_obj_guid (+)
  AND  s.severity_guid   = l.source_obj_guid (+)
  AND  lower(s.message) like '%tablespace%percent%'
ORDER BY s.load_timestamp desc
)
group by loaded, emailed
order by loaded desc;


and for sure there’s much more things you can do with all of these filters

— AND a.annotation_type = ‘NOTIFICATION’ <– annotated as NOTIFICATION
— AND lower(s.message) like ‘%tablespace%percent%’ <– search string on the alert message
— AND lower(t.target_name) like ‘%mta%’ <– search string on the target name
— AND s.severity_guid = ‘B33A7C7DF7A0293CE040460A22EA5E84′ <– search the alert ID

That’s it for now.. hope I’ve shared you some good stuff :)





About these ads

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s