I spent hours researching this yesterday and hopefully I can save someone some pain. I discovered two answers for this, and we'll start with the easy one.
No transforms required
In the Notification Content tab, simply replace
${evt.device}
with
${eventSummary/actor/element_title}
Discovered via: http://community.zenoss.org/message/71252#71252
(thanks to Philip Warren)
Using transforms
Ophir's answer above will work for real events, but I discovered that it will not work for any manually created (a.k.a. test) events. The Transform itself will parse properly, but, for whatever reason, test events cannot properly parse custom attributes used in the Notification Contents and will fail with an "Unable to perform TALES evaluation" error. This makes it difficult to test custom attributes, so hopefully Zenoss will fix this soon.
I would also recommend changing the last line of his transform, otherwise it might fail when "d" is not found. Here's the full reworked Transform code:
d = dmd.Devices.findDevice(evt.device)
if d is not None:
evt.device_title = d.title
else:
evt.device_title = evt.device.title
Discovered via: http://www.eventenrichment.com/zenoss-event-enrichment-5-min-less
Um... How do I Transform anything?
For those that haven't done it before (like me, as of yesterday) you do not need to use Zope to get to the Transform area. Just follow these steps in Zenoss to add a Transform to the Root Event:
- Click on Events > Event Classes
- Click on the bottom-left gear
- Click on Transform
- Type the code in to the Transform field area
- Click Save
If you feel like using Zope instead (because "Danger" is your middle name) then you can browse to http[s]://yourserver.com[:port]/zport/dmd/Events/manage and then click on the Properties tab to get to the Transform field.