Discussion:
Can I use custom properties in Notifications content ?
li calvin
2013-10-10 07:29:41 UTC
Permalink
li calvin [http://community.zenoss.org/people/calvin_li] created the discussion

"Can I use custom properties in Notifications content ?"

To view the discussion, visit: http://community.zenoss.org/message/74901#74901

--------------------------------------------------------------
I found I can add more  properties into device, like role, datacenter, regions, it is real good feature, but I want use these properties in event alerts when zenoss send the notifications if some event trigger.

like :
Subject: [zenoss] ${evt/device} ${evt/summary}

Body:

Device: ${evt/device}
System: ${evt/Systems}
Component: ${evt/component}
Severity: ${evt/severityString}
Time: ${evt/firstTime}
Message:
${evt/message}
<a href="${urls/eventUrl}">Event Detail</a>
<a href="${urls/ackUrl}">Acknowledge</a>
<a href="${urls/closeUrl}">Delete</a>
<a href="${urls/eventsUrl}">Device Events</a>

I want add more properties

like

Subject: [zenoss] ${evt/device} ${evt/summary} ${evt/device/cRole} ${evt/device/cRegion}

Body:

Device: ${evt/device}
System: ${evt/Systems}
Component: ${evt/component}
Severity: ${evt/severityString}
Time: ${evt/firstTime}
Role: ${evt/device/cRole}
Region: ${evt/device/cRegion}
Message:
${evt/message}
<a href="${urls/eventUrl}">Event Detail</a>
<a href="${urls/ackUrl}">Acknowledge</a>
<a href="${urls/closeUrl}">Delete</a>
<a href="${urls/eventsUrl}">Device Events</a>

but it won't take effect, I can not find any hint in zenoss manual,  so I want to ask how to do it ?

Thank you.
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/74901#74901]

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
li calvin
2013-10-11 05:36:07 UTC
Permalink
li calvin [http://community.zenoss.org/people/calvin_li] created the discussion

"Re: Can I use custom properties in Notifications content ?"

To view the discussion, visit: http://community.zenoss.org/message/74902#74902

--------------------------------------------------------------
Is there some method or solution can help me to achieve this goal ?
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/74902#74902]

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
li calvin
2013-10-12 04:56:55 UTC
Permalink
li calvin [http://community.zenoss.org/people/calvin_li] created the discussion

"Re: Can I use custom properties in Notifications content ?"

To view the discussion, visit: http://community.zenoss.org/message/74956#74956

--------------------------------------------------------------
I found this http://community.zenoss.org/message/74517#74517#74517 http://community.zenoss.org/message/74517#74517, but not work
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/74956#74956]

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
li calvin
2013-10-12 09:31:43 UTC
Permalink
li calvin [http://community.zenoss.org/people/calvin_li] created the discussion

"Re: Can I use custom properties in Notifications content ?"

To view the discussion, visit: http://community.zenoss.org/message/74957#74957

--------------------------------------------------------------
I resovle it

transformer with event class / :

device = dmd.Devices.findDevice(evt.device)
if device is not None:
    evt.datacenter = device.cDataCenter
    evt.environment = device.cEnvironment
    evt.region = device.cRegion



notification body format:
Device:     ${evt/device}
Severity:   ${evt/severityString}
ENV:        ${evt/environment}
Region:     ${evt/region}
DC:         ${evt/datacenter}
......
Message:
......
--------------------------------------------------------------

Reply to this message by replying to this email -or- go to the discussion on Zenoss Community
[http://community.zenoss.org/message/74957#74957]

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
Loading...