Skip navigation
7778 Views 7 Replies Latest reply: Aug 26, 2010 6:00 PM by Justin Shepard RSS
drstein Newbie 4 posts since
Apr 8, 2009
Currently Being Moderated

Apr 8, 2009 10:42 AM

Apply event transform more than once

Hello:

I'm trying to create some kind of Event class hierarchy.

I have a generic Event class /Generic, and also two subclasses: /Generic/Specific1 and /Generic/Specific2.
Using an event transform, in a mapping which belongs to /Generic, I set the eventClass to /Generic/Specific1 or /Generic/Specific1 depending on some conditions.
As far as I know (and tested it), the event transforms of the specific classes won't be applied.

What I need is to get applied the event transforms for each specific subclass. Today I have a lot of code repeated in the two specific subclasses and I want to put it in a generic (upper-level) event class, and then add more specific code to the event subclasses.

Is there any way to do this ?

Hope you get the idea.
thx,
Mariano.
  • jmp242 ZenossMaster 4,060 posts since
    Mar 7, 2007
    Currently Being Moderated
    1. Apr 8, 2009 11:44 AM (in response to drstein)
    Apply event transform more than once
    Not so far as I know. Zenoss only applies one event transform per event.
    You could put in an enhancement request, but that would probably go out
    in at least King Crab if not further. (2 + releases out)

    It seems like this would be a pretty major overhaul, and would
    potentially affect many users.
    --
    James Pulver
    Information Technology Area Supervisor
    LEPP Computer Group
    Cornell University



    drstein wrote, On 4/8/2009 10:42 AM:

     

     

    Hello:

    I'm trying to create some kind of Event class hierarchy.

    I have a generic Event class /Generic, and also two subclasses: /Generic/Specific1 and /Generic/Specific2.
    Using an event transform, in a mapping which belongs to /Generic, I set the eventClass to /Generic/Specific1 or /Generic/Specific1 depending on some conditions.
    As far as I know (and tested it), the event transforms of the specific classes won't be applied.

    What I need is to get applied the event transforms for each specific subclass. Today I have a lot of code repeated in the two specific subclasses and I want to put it in a generic (upper-level) event class, and then add more specific code to the event subclasses.

    Is there any way to do this ?

    Hope you get the idea.
    thx,
    Mariano.







    _______________________________________________
    zenoss-users mailing list
    zenoss-users@zenoss.org
    http://lists.zenoss.org/mailman/listinfo/zenoss-users

    _______________________________________________
    zenoss-users mailing list
    zenoss-users@zenoss.org
    http://lists.zenoss.org/mailman/listinfo/zenoss-users
  • jmp242 ZenossMaster 4,060 posts since
    Mar 7, 2007
    Currently Being Moderated
    3. Apr 8, 2009 3:53 PM (in response to drstein)
    Apply event transform more than once
    Yea - don't forget you can also look at patching against the core code
    also, and if you're ok with the GPL + licensing form, Zenoss might even
    integrate your changes upstream.
    --
    James Pulver
    Information Technology Area Supervisor
    LEPP Computer Group
    Cornell University



    drstein wrote, On 4/8/2009 3:43 PM:

     

     

    It seems so. I will try to figure out if it's possible to implement this change via a zenpack.

    thx again.







    _______________________________________________
    zenoss-users mailing list
    zenoss-users@zenoss.org
    http://lists.zenoss.org/mailman/listinfo/zenoss-users

    _______________________________________________
    zenoss-users mailing list
    zenoss-users@zenoss.org
    http://lists.zenoss.org/mailman/listinfo/zenoss-users
  • Matt Ray Rank: Zen Master 2,484 posts since
    Apr 5, 2008
    Currently Being Moderated
    4. Apr 10, 2009 4:11 PM (in response to jmp242)
    Apply event transform more than once
    There are some changes being made to Event Transforms for 2.4. We're
    working on getting some examples added to the documentation and I
    don't think they're all in the beta yet. One of the changes will be
    cascading event transforms. Event transforms are applied down the
    event hierarchy, so that on an incoming /Business/Service/Bus event,
    the /Business transform would be applied, then the /Service
    transform, then the /Bus transform. This sounds like what you want.

    Thanks,
    Matt Ray
    Zenoss Community Manager
    community.zenoss.com
    mray@zenoss.com

    _______________________________________________
    zenoss-users mailing list
    zenoss-users@zenoss.org
    http://lists.zenoss.org/mailman/listinfo/zenoss-users
  • jmp242 ZenossMaster 4,060 posts since
    Mar 7, 2007
    Currently Being Moderated
    5. Apr 13, 2009 8:35 AM (in response to Matt Ray)
    Apply event transform more than once
    I think we'll need some good docs or examples on what happens with event
    transforms that change event class...

    If for instance, I change via transform from
    /foo/bar/baz* Transform here
    to
    /foo/baz/test

    what happens?
    /foo
    /foo/bar
    /foo/bar/baz
    /foo
    /foo/baz
    /foo/baz/test
    event transforms get applied in that order?

    /foo
    /foo/bar
    /foo/bar/baz
    /foo/baz/test
    gets applied in that order?

    /foo
    /foo/bar
    /foo/bar/baz
    and stop, with the last event transform processed is to move to
    /foo/baz/test?

    Or something else entirely?

    --
    James Pulver
    Information Technology Area Supervisor
    LEPP Computer Group
    Cornell University



    Matt Ray wrote, On 4/10/2009 4:11 PM:

     

     

    There are some changes being made to Event Transforms for 2.4. We're
    working on getting some examples added to the documentation and I
    don't think they're all in the beta yet. One of the changes will be
    cascading event transforms. Event transforms are applied down the
    event hierarchy, so that on an incoming /Business/Service/Bus event,
    the /Business transform would be applied, then the /Service
    transform, then the /Bus transform. This sounds like what you want.

    Thanks,
    Matt Ray
    Zenoss Community Manager
    community.zenoss.com
    mray@zenoss.com

    _______________________________________________
    zenoss-users mailing list
    zenoss-users@zenoss.org
    http://lists.zenoss.org/mailman/listinfo/zenoss-users

    _______________________________________________
    zenoss-users mailing list
    zenoss-users@zenoss.org
    http://lists.zenoss.org/mailman/listinfo/zenoss-users
  • Justin Shepard Rank: White Belt 14 posts since
    Feb 24, 2010
    Currently Being Moderated
    6. Aug 26, 2010 2:51 PM (in response to jmp242)
    Re: Apply event transform more than once

    I'm going to thread necromance this topic to reinforce James's questions, and add another one.

    jmp242 wrote (paraphrased):

     

    If for instance, I change via transform from /foo/bar/baz (Transform here) to /foo/baz/test, what happens?

    1. Transforms applied in order: /foo, /foo/bar, /foo/bar/baz, /foo, /foo/baz, /foo/baz/test
    2. Transforms applied in order: /foo, /foo/bar, /foo/bar/baz, /foo/baz/test
    3. Transforms applied in order: /foo, /foo/bar, /foo/bar/baz

     

    Is it possible at all, assuming the current behavior is (3), to force the destination event class transform to be applied to the event? Is there an unpublished function that can be called from the transform after the class is changed/committed that will re-run the transform using the new mapping?

  • Justin Shepard Rank: White Belt 14 posts since
    Feb 24, 2010
    Currently Being Moderated
    7. Aug 26, 2010 6:00 PM (in response to Justin Shepard)
    Re: Apply event transform more than once

    I kind of answered my own question here. This allows you to fire the transform on the destination class.

    evt.eventClass = '/Win/EventLog'
    evt.severity = 5

    import logging
    log = logging.getLogger("zen.Events")
    dest = dmd.getObjByPath(''.join(['Events',evt.eventClass]))
    if dest.transform:
    try:
      exec(dest.transform,{'evt':evt})
    except Exception, ex:
      log.error("Error processing transform on EventClass %s (%s)",dest.getPrimaryId(), ex)

More Like This

  • Retrieving data ...