Here it is:
#!/usr/bin/env python
from Products.ZenUtils.ZenScriptBase import ZenScriptBase
dmd = ZenScriptBase(connect=True).dmd
def _displayEventRules(evtclass):
for eclass in evtclass.getSubOrganizers():
_displayEventRules(eclass)
for inst in evtclass.instances():
out = ""
if inst.rule:
out += " [rule] " + str(inst.rule) +"\n"
if inst.regex:
out += " [regex] " + str(inst.regex) +"\n"
if inst.transform:
out += " [transform] " + str(inst.regex) +"\n"
if out:
print str(evtclass.getOrganizerName())
print out
print
def displayEventClasses():
for e in dmd.Events.getSubOrganizers():
_displayEventRules(e)
displayEventClasses()