Discussion:
Delete Events from Zenoss 4.2 database
ieldib
2012-08-29 15:40:33 UTC
Permalink
ieldib [http://community.zenoss.org/people/ieldib] created the discussion

"Delete Events from Zenoss 4.2 database"

To view the discussion, visit: http://community.zenoss.org/message/68251#68251

--------------------------------------------------------------
Guys,


This new DB  is  extremely aggrevating to deal with. does anyone know howto delete/purge all events from zenoss_zep ?   
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/68251#68251]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
bukhary ikhwan ismail
2012-10-18 10:58:28 UTC
Permalink
bukhary ikhwan ismail [http://community.zenoss.org/people/bukharyi] created the discussion

"Re: Delete Events from Zenoss 4.2 database"

To view the discussion, visit: http://community.zenoss.org/message/69346#69346

--------------------------------------------------------------
Last time you need to login to the DB. Now, within "events" windows, there is a "select" button. Click it and select all. That should do it.
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/69346#69346]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
ieldib
2012-10-23 14:10:03 UTC
Permalink
ieldib [http://community.zenoss.org/people/ieldib] created the discussion

"Re: Delete Events from Zenoss 4.2 database"

To view the discussion, visit: http://community.zenoss.org/message/69464#69464

--------------------------------------------------------------
Hi,

I  was referring to deleting events using  zep  or a zendmd script. When you have a flood of events the thing you usually can't do is get the event console and close out events... it either takes a real long time jsut to load this page,  times out with a gateway error  or it fails to fully complete  the closing of all events.  Meanwhile you have a unusable zenoss-ui. So unfortunately thats not an option :) .
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/69464#69464]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
ieldib
2012-10-23 14:11:36 UTC
Permalink
ieldib [http://community.zenoss.org/people/ieldib] created the discussion

"Re: Delete Events from Zenoss 4.2 database"

To view the discussion, visit: http://community.zenoss.org/message/69465#69465

--------------------------------------------------------------
Here is a script that I came up with to close out old events.  Unfortunately when zeneventserver is chugging along this script never usually completes and times out. So I was wondering if there was a more efficient way to call zep  so we can close out events faster. Event handling seems like it takes soooo much longer now in zenoss 4.x

#!/opt/zenoss/bin/python


import Globals
from Products.Zuul import getFacade
from Products.ZenUtils.ZenScriptBase import ZenScriptBase
import time


day_millis = 86400000
dmd = ZenScriptBase(connect=True).dmd
zep = getFacade('zep')
filter_zep = zep.createEventFilter(severity=[5,4,3,2,1,0],status=[0]) #Create filter that looks for all severities, and specifically events that are 'New' status
results = zep.getEventSummariesGenerator(filter=filter_zep) #Use event generator to iteratively check events


for res in results:
    del_filter = zep.createEventFilter(uuid=res['uuid'])
    status,response = zep.closeEventSummaries(eventFilter=del_filter)
    print "status %s -- response %s" % (status,response)
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/69465#69465]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
pwarren
2012-10-24 21:49:31 UTC
Permalink
pwarren [http://community.zenoss.org/people/pwarren] created the discussion

"Re: Delete Events from Zenoss 4.2 database"

To view the discussion, visit: http://community.zenoss.org/message/69522#69522

--------------------------------------------------------------
It is very expensive to close events as you are doing above. You can pass the original filter used to query for events to closeEventSummaries. So change the code to:

#!/opt/zenoss/bin/python

import Globals
from Products.Zuul import getFacade
from Products.ZenUtils.ZenScriptBase import ZenScriptBase
import time

dmd = ZenScriptBase(connect=True).dmd
zep = getFacade('zep')
filter_zep = zep.createEventFilter(status=[0]) #Create filter that looks for all severities, and specifically events that are 'New' status
status,response = zep.closeEventSummaries(eventFilter=filter_zep)
print "status %s -- response %s" % (status,response)

Does this perform better in your testing?

Thanks,

Philip Warren
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/69522#69522]

Start a new discussion in zenoss-users by email
[discussions-community-forums-zenoss--***@community.zenoss.org] -or- at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
sapofeo
2013-04-10 13:50:42 UTC
Permalink
sapofeo [http://community.zenoss.org/people/sapofeo] created the discussion

"Re: Delete Events from Zenoss 4.2 database"

To view the discussion, visit: http://community.zenoss.org/message/72766#72766

--------------------------------------------------------------
This worked perfectly on 4.2.3.  Thank you!
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/72766#72766]

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Loading...