Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How to clear thousands of alerts in Grid Control?

Re: How to clear thousands of alerts in Grid Control?

From: Chuck <skilover_nospam_at_bluebottle.com>
Date: Wed, 19 Sep 2007 20:42:32 GMT
Message-ID: <YQfIi.3926$io2.1141@trnddc06>


Chuck wrote:
> I have a couple of hosts in GC that have thousands of open alerts and
> I'd like to clear them all in bulk. Is there a way to do that? The
> closest thing I've found in GC is to go to the critical alerts page and
> click on "select all", then "clear alert". The problem is it only
> selects the 25 alerts on the current page. I have thousands to clear and
> this could be a long and tedious process. Is there a better way to clear
> them all in one operation?
>
> The alerts I don't care about because the hosts in question are win2k
> and by default EM generates an alert every time something appears in the
> windows event log. I've disabled collection of the alerts, but just want
> to clean up all the garbage left behind now.
>
> TIA
In case anyone else needs to do this, I used this solution:

Log on to the repository DB as SYSMAN and run the following procedure. Modify the cursor to fit your needs.

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 '%myhost%'
        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; Received on Wed Sep 19 2007 - 15:42:32 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US