Discussion:
ZenDMD Query - how to ack all alerts for a device class
joanypony
2013-10-09 13:22:08 UTC
Permalink
joanypony [http://community.zenoss.org/people/joanypony] created the discussion

"ZenDMD Query - how to ack all alerts for a device class"

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

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

I want to make an event command where, when a certain condition is met on device X, I then acknowledge all alerts for device class A.

Can anyone help me out here?
I know how to change the event state in a single case, but I cannot see how I can use ZenDMD to find all new events for the device class.

My use case will be as follows -

Our VIP is alerting - once we have 2 new critical alerts, we want to acknowledge all the alerts in the device-class A. The VIP check is a check that relies on all the servers in device class A, so if there's an issue with the VIP, getting alerts for device class A is redundant and noisy.

This will be our attempt at reducing event storms as this particular cluster can generate a crazy amount of alerts.

Any help would be gratefully appreciated.

Regards,
Joan
--------------------------------------------------------------

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

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
jcurry
2013-10-09 15:51:42 UTC
Permalink
jcurry [http://community.zenoss.org/people/jcurry] created the discussion

"Re: ZenDMD Query - how to ack all alerts for a device class"

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

--------------------------------------------------------------
Hi Joan,
For the event ack piece, I would start with Ryan's tip on Manipulating Events - http://wiki.zenoss.org/ZenDMD_Tip_-_Manipulate_Events http://wiki.zenoss.org/ZenDMD_Tip_-_Manipulate_Events .  You need something that searches through existing events looking for the matching device class. 

You might create a loop that cycles through your device class A, getting device id - something like:

for d in dmd.Devices.Server.Linux.getSubDevices():
  devName = d.id

Then use devName as the value of the element_identifier filter to search for all events for that device - see the createEventFilter function in $ZENHOME/Products/Zuul/facades/zepfacade.py.  Unfortunately you don't seem to be able to specify device class as an event filter field :(

Here is another event filter example I have used:

mydev = 'test.skills-1st.co.uk'
mycomp = 'ether5'

zep_filter = zep.createEventFilter(status=(0,1), event_class = '/Status/NewPerf',  element_identifier=mydev, element_sub_identifier = mycomp)

for summary in zep.getEventSummariesGenerator(filter=zep_filter):
.............. etc etc etc ................

Does that get you started?

Cheers,
Jane
--------------------------------------------------------------

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

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...