-
Notifications
You must be signed in to change notification settings - Fork 3
Description
I tested your script in Zenoss 5 release. I try export EventMappings by EventClass Path, but it's failed to get the complete list, only partial information is listed. I have modified your def export_eventmappings(evMatch) to export all EventMappings because if you type a Path Class, your for loop return less than what they are.
My workaround for complete list:
def export_eventmappings(evtMatch):
conex = dmd.Events.getOrganizer('/')
for e in conex.getInstances():
if e.getEventClass():
dict = export_eventmapping(e)
try: list.append(dict)
except: list = [ dict ]
return list
For a specific Path, I haven't a workaround yet, but I think if you select de Organizer (Root Path) first, you can list all EventMapping of this Path. So if exit EventClass (getEventClass()) then export all items of the Path founded:
def export_eventmappings(evtMatch):
conex = dmd.Events.getOrganizer('evtMatch')
for e in conex.getInstances():
if e.getEventClass():
dict = export_eventmapping(e)
try: list.append(dict)
except: list = [ dict ]
return list