Table of Contents

Summary

The following script gives a listing of all of your existing transforms on your system. The location and code of the transform are listed out for each transform found.

Transforms are code-snippets that can be used to change events and behavior, before the event is entered into the events database. See our administration guide for general information on transforms.

Get the code ready

Method 1: Download code

Method 2: Create code

Method 3: Paste in dmd

Run the script

Method 1 and 2: Run from command line

showAllTransforms.py > transforms.txt

Method 3: execute in dmd

Code

#!/usr/bin/env python
import Globals
from Products.ZenUtils.ZenScriptBase import ZenScriptBase
dmd = ZenScriptBase(connect=True).dmd
 
for ec in dmd.Events.getSubOrganizers():
    if ec.transform:
        print "=== %s ===" % ec.getOrganizerName()
        print ec.transform
        print
    for i in ec.instances():
        if i.transform:
            print "=== %s/%s ===" % (ec.getOrganizerName(), i.id)
            print i.transform
            print