Skip to content

Export EventMappings #1

@jmorcar

Description

@jmorcar

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions