Discussion:
Customize notification messages to show additional device information
Hector Akamine
2013-08-27 19:38:41 UTC
Permalink
Hector Akamine [http://community.zenoss.org/people/haa] created the discussion

"Customize notification messages to show additional device information"

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

--------------------------------------------------------------
Hello,
I would like to include the following information in a notification message:
- The location of the device
- SNMP information of the device (SNMP SysName, SNMP Description, etc)

I guess I can use something like ${evt/device/+some_variable_here+} to do this. Could it be possible? Read the Core Administration Guide (2.6.2.3 Defining Notification Content), but couldn't find information.

Thank you
Hector
--------------------------------------------------------------

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

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
j053ph4
2013-08-28 20:09:11 UTC
Permalink
j053ph4 [http://community.zenoss.org/people/j053ph4] created the discussion

"Re: Customize notification messages to show additional device information"

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

--------------------------------------------------------------
Yes it's very possible, just the way you describe...what i do is assign a variable within an event transform, somthing like:

evt.test = "test"

and then the notification can reference it with a TALES expression ${evt/test}

Hope this helps,
Joseph
--------------------------------------------------------------

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

Start a new discussion in zenoss-users at Zenoss Community
[http://community.zenoss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2003]
jcurry
2013-09-03 09:34:40 UTC
Permalink
jcurry [http://community.zenoss.org/people/jcurry] created the discussion

"Re: Customize notification messages to show additional device information"

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

--------------------------------------------------------------
So in a transform, you might have something like:

evt.mySnmpSysLoc = device.snmpLocation
evt.mySnmpSysContact = device.snmpContact
evt.mySnmpStatus = device.getSnmpStatusString()
evt.mySnmpDescr = device.snmpDescr
evt.myMappingSummary = "Event class mapping summary " + evt.mySummary

Then in your notification you have:


Device: ${evt/device}
Component: ${evt/component}
Severity: ${evt/severity}
Time: ${evt/lastTime}
Message:
${evt/message}
Location:
${evt/Location}
SNMP system info:
sys Contact is ${evt/mySnmpSysContact};  snmp status is ${evt/mySnmpStatus}
SNMP Description is ${evt/mySnmpDescr}

<a href="${urls/eventUrl}">Event Detail</a>
<a href="${urls/ackUrl}">Acknowledge</a>
<a href="${urls/closeUrl}">Close</a>
<a href="${urls/eventsUrl}">Device Events</a>


You can see all your custom variables in the event detail so can check them there.

If the notification doesn't quite work correctly, my usual error is either the wrong brackets (they should be curly braces) or non-matching brackets.

Cheers,
Jane
--------------------------------------------------------------

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

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...