Archived community.zenoss.org | full text search
Skip navigation
22243 Views 4 Replies Latest reply: Sep 8, 2009 6:28 PM by Pim Rupert RSS
mwoodling Rank: White Belt 46 posts since
Aug 10, 2008
Currently Being Moderated

Aug 30, 2009 10:08 AM

How to purge events history

I am running Zenoss 2.4.2 on CentOS 5.2. The Event Manager setting "Delete Historical Events Older Than (days)" has been set to 90 days for about 2 days now. The events history still has events going back over a year.

When is the purge scheduled to run?

What process or procedure purges events?

Can the process be tuned?

Where is the events history purge activity logged?

Matt
  • Rank: Brown Belt 260 posts since
    Mar 30, 2009
    Currently Being Moderated
    1. Sep 1, 2009 7:32 AM (in response to mwoodling)
    history table
    I think it runs immediatly, though I have seen it not run (or not finish and not commit?) when there are large numbers of historical rows.... say millions. This is just too many rows and so you can go in on the backend of the machine

    mysql (get to the mysql prompt)
    use events;
    DELETE FROM history WHERE stateChange < DATE_SUB(NOW(), INTERVAL 90 DAY);

    You might want to test that with a select first, I have not tested the above.

    I do not know what does the purging, off top of my head. Miracle of open source allows you to go follow the trail in through the html, then the python, to see what does it!

    -Nick Yeates-
  • Pim Rupert Rank: White Belt 23 posts since
    May 30, 2009
    Currently Being Moderated
    4. Sep 8, 2009 6:28 PM (in response to mwoodling)
    Re: history table

    "nyeates" wrote:

     

    I think it runs immediatly, though I have seen it not run (or not finish and not commit?) when there are large numbers of historical rows.... say millions. This is just too many rows and so you can go in on the backend of the machine

    mysql (get to the mysql prompt)
    use events;
    DELETE FROM history WHERE stateChange < DATE_SUB(NOW(), INTERVAL 90 DAY);

    You might want to test that with a select first, I have not tested the above



    You could better perform a query on the 'firstTime' or 'lastTime' columns, since those columns have indexes. A simple SELECT query for min(firstTime) is magnitudes faster than a min(stateChange).

    I'm not sure how Zenoss handles the purging internally, but I really hope they do the delete queries on indexed columns.

    I just deleted about a million old events with a 'DELETE FROM history WHERE firstTime < 1230789600' in under 3 minutes.

More Like This

  • Retrieving data ...