Skip navigation
4140 Views 2 Replies Latest reply: Nov 29, 2010 10:54 PM by tasdienes RSS
tasdienes Rank: White Belt 21 posts since
Mar 9, 2009
Currently Being Moderated

Nov 18, 2010 4:51 PM

Changing event severity dependant on count with customize dedupid

I need to escalate an event if count exceeds a threshold, but I also need to dedupe these events with a custom generated dedupid.  Can't seem to get the two to work together.

 

I created an event class transform as described in

http://community.zenoss.org/docs/DOC-2554#Change_severity_dependant_on_count

 

That works.  But if I modify the dedupeid, the escalation no longer works.

#Works

dedupfields = [

    evt.device, evt.component, evt.eventClass, evt.eventKey, evt.severity]

if not evt.eventKey:

    dedupfields += [evt.summary]

mydedupid = '|'.join(map(str, dedupfields))

# Get the event details (including count) from the existing event that is in the mysql database

em = dmd.Events.getEventManager()

em.cleanCache()

try:

    ed = em.getEventDetail(dedupid=mydedupid)

    mycount = ed.count

except:

    mycount = 0

 

if mycount > 3:

    evt.severity = 3

 

#Does not work

mydedupid = "test3333"

evt.dedupid = mydedupid

# Get the event details (including count) from the existing event that is in the mysql database

em = dmd.Events.getEventManager()

em.cleanCache()

try:

    ed = em.getEventDetail(dedupid=mydedupid)

    mycount = ed.count

except:

    mycount = 0

if mycount > 2:

    evt.severity = 3

 

Any suggestions would be appreciated!

  • phonegi Rank: Brown Belt 446 posts since
    Apr 15, 2009

    After generating a test event, view the records in mysql. Log in as the zenoss user and enter the following at the command line:

    $ mysql -u zenoss -p
    Enter password: zenoss
    mysql> use events
    mysql> select dedupid, count from status;
    

More Like This

  • Retrieving data ...

Legend

  • Correct Answers - 4 points
  • Helpful Answers - 2 points