Re-mapping events to a specific event mapping

36 views
Skip to first unread message

pa...@fielding.ca

unread,
May 13, 2022, 12:41:35 PM5/13/22
to Zenoss Core
Hey folks.  So, I have some events being generated by template Thresholds.  They are mapped to the /Perf/Web event class.

However, I'm going to start having a number of different events going to /perf/web for which I want to do some custom transforms, depending on the event.  Rather than making a massive transform in /perf/web (which currently has a general transform to to some stuff for me), I'd like to catch my custom ones in a class mapping in /Perf/Web so that I can add a transform to just that mapping.  In this way /Perf/Web would develop a bunch of mappings, each with their own transform, that doesn't have to get in the way of the other mappings' transforms.

I'm having trouble convincing Zenoss to map these to a mapping.  I thought I could set the mapping's event key to 'defaultmapping', and then add a rule such as :

"Foobar" in evt.description

to match what I want and apply the mapping.  I have this working in a few places with traps.  But I can't seem to make this work on an event generated by a Threshold.    Any suggestions on making the mapping happen?

Paul

jstan...@gmail.com

unread,
May 19, 2022, 10:11:34 AM5/19/22
to Zenoss Core
Mappings are for eventClassKey and there are some weird rules on when an event will actually get mapped (I cant recall them atm).

I would suggest making a subclass of /Perf/Web to send your custom events to.

If you have to have the events in just /Perf/Web, but want to use mappings, then defausend your event with eventClassKey (no eventClass) that matches the event class key mapping under /Perf/Web

Creating a 'defaultmapping' needs to have a rule to match events on. Something like:

rule:
str(getattr(evt, 'eventClassKey', '').startswith('MyWebEvent_')

Jane Curry

unread,
May 19, 2022, 2:34:09 PM5/19/22
to Zenoss Core
Paul raises a question I have heard several times so I have written a paper on the Zenoss wiki at http://wiki.zenoss.org/EventClassMappingForThresholdEvents .  It started out small but rather grew into a wider explanation of event class mapping.  Please provide feedback.

Cheers,
Jane
Reply all
Reply to author
Forward
0 new messages