Home > OEM > How to clear EM Grid Control alerts manually?

How to clear EM Grid Control alerts manually?

September 24, 2011

We can use the procedure outlined below to clear outstanding warning and critical alerts which are displayed on the EM Grid console home page.  Normally these alerts get cleared automatically when the event to threshold which caused these events in the first place is longer in the ‘critical’ or ‘warning’ state.

Let us see an example where we would like to clear outstanding alerts related to database TEST.

The table SYSMAN. MGMT_TARGETS has information on the monitored targets and the table SYSMAN. MGMT_CURRENT_SEVERITY contains data related to all critical and warning alerts. We can query the MGMT_CURRENT_SEVERITY table and see that there are two rows in the table pertaining to TEST database.

SQL> select TARGET_NAME,TARGET_TYPE ,TARGET_GUID  from  mgmt_targets where TARGET_NAME like ‘test%’;

TARGET_NAME

——————————————————————————–

TARGET_TYPE

—————————————————————-

TARGET_GUID

——————————–

test

oracle_database

838nrG87E4F018F5353040DA9GJTQWF9

SQL> select count(*) from mgmt_current_severity where  TARGET_GUID=’90BDD386E4F020F5356060DB6B94CAA3′;

COUNT(*)

———-

2

We can use this procedure to delete the required rows – note that this block will in turn call the EM_SEVERITY package which will perform the clean up of dependant internal tables

DECLARE

CURSOR c1 IS

SELECT s.target_guid,

s.metric_guid,

s.key_value

FROM mgmt_targets t JOIN mgmt_current_severity s

ON s.target_guid = t.target_guid

WHERE LOWER(t.target_name) LIKE ‘test%’

AND t.target_type = ‘host’;

BEGIN

FOR r IN c1 LOOP

em_severity.delete_current_severity(r.target_guid, r.metric_guid, r.key_value);               DELETE from sysman.mgmt_severity WHERE target_guid = r.target_guid AND   metric_guid = r.metric_guid AND key_value = r.key_value;

END LOOP;

COMMIT;

end;

/

SQL> select count(*) from mgmt_current_severity where TARGET_GUID=’838nrG87E4F018F5353040DA9GJTQWF9′;

COUNT(*)

———-

0

Advertisements
Categories: OEM
%d bloggers like this: