How To List All Event Transforms and Event Class Mappings

Applies To

  • Zenoss 4.x
  • Zenoss 5.x


When writing event transforms or researching how events are mapped to certain event classes, it is often useful to have a complete list of the existing transforms and event class mappings, and the Resource Manager UI does not provide this information in a single place. The Python script included in this article shows the location and content of every transform and (non-empty) event class mapping in your Zenoss instance. Run the script from the command line of the Zenoss master as the zenoss user. It does not require invoking zendmd.

Procedure for Zenoss 4.x

  1. Connect to the Zenoss master server as the zenoss user.
    Note: when switching to the zenoss user using the su command, you must specify the “-” option in order to update your PATH to include the zenoss user's bin directory. For example: su - zenoss”. Otherwise, the listEventClassKeys script (as installed below) might not be found without specifying its full path.
  2. Change to the zenoss user's home directory:

    $ cd

  3. Create the bin subdirectory to hold the script:

    $ mkdir -p bin

  4. Change to the bin subdirectory:

    $ cd bin

  5. Download the attached listTransforms script.
  6. Display the contents of the listTransforms file and verify that it matches the script listed below:

    $ cat listTransforms

  7. Make the listTransforms file executable:

    $ chmod +x listTransforms

  8. Run the script and pipe the output through a pager; less, for example:

    $ listTransforms | less

    Alternatively, you can redirect the output to a file; for example:

    $ listTransforms > transforms
    $ less transforms

Procedure for Zenoss 5.x

  1. Connect to the Control Center master host as a user with serviced access (or root).
  2. Switch to the /tmp/ directory and download the listTransforms script.
  3. Launch a zope shell. Your current working directory will be mounted inside the zope shell as /mnt/pwd/.

    $ serviced service shell -i zope

  4. Change the ownership of the listTransforms script to the zenoss user and group, and make it executable

    $ chown zenoss:zenoss /mnt/pwd/listTransforms
    $ chmod +x /mnt/pwd/listTransforms

  5. Switch to the zenoss user:

    $ su - zenoss

  6. Switch to the /mnt/pwd/ directory and execute the script, redirecting the output to a file:

    $ cd /mnt/pwd/
    $ ./listTransforms > transforms

  7. Exit the zenoss user and the zope shell:

    $ exit
    $ exit

  8. The file from Step 6. should be available to you in your working directory:

    $ ls -lah transforms


#! /usr/bin/env python

import Globals
from Products.ZenUtils.ZenScriptBase import ZenScriptBase

dmd = ZenScriptBase(connect=True).dmd
for eventClass in sorted([dmd.Events] + dmd.Events.getSubOrganizers(), key=lambda c: c.getOrganizerName().lower()):
    name = eventClass.getOrganizerName()
    if eventClass.transform:
        label = '[Transform] %s' % name
        print '%s\n%s' % (label, '-' * len(label))
        print eventClass.transform, '\n'

    for mapping in sorted(eventClass.instances(), key=lambda m:
        if mapping.transform:
            label = '[Mapping] %s/%s' % (name,
            print '%s\n%s' % (label, '-' * len(label))
            print mapping.transform, '\n'
Was this article helpful?
0 out of 0 found this helpful


  • Avatar
    David Williamson

    The listed page returns a 404. :-( --- Hi David thanks. This has been fixed

  • Avatar
    Tim Sutton

    Thanks, but once exported, how would I import this file into another Zenoss instance?

  • Avatar
    Johan Brown

    Is there a guide on how to perform this with Zenoss 5? Or even better, how to export the event transforms to another installation of Zenoss 5?

  • Avatar
    Ryan Matte

    This guide is only to output this info for reference purposes. If you want to export transforms and event class mappings to another instance you would need to create a ZenPack and import them in to it, then export the pack to an egg file and install it in the other instance.

Powered by Zendesk