On May 4, 2008, at 4:01 AM, shakespear wrote:
How can I access event details in Event mappings?

e.g.

EventDetail (sent with snmp trap)

agentWorkInteger1      1
agentWorkObject         UC4P.WP001.AMSD4.EX_JOB
agentWorkString1        AMSD4
agentWorkSysID         UC4P
community                  public

This is the current Event Transformation:

evt.summary = "UC4 Executor stopped"
if evt.AgentWorkInteger1==1: evt.message="Mode: Primary"
if evt.AgentWorkInteger1==3: evt.message="Mode: Normal"
if evt.AgentWorkInteger1==4: evt.message="Mode: Communication" evt.message = evt.summary + " System/Server/Executor/Type: " + evt.AgentWorkObject + " " + evt.message

What does work:

The evt.summary gets set to "UC4 Executor stopped"

What doesn't work:

The evt.message stuff.

It's likely that the evt.AgentWorkInteger1 is a string "1" and not an integer. Try changing your conditionals to the following instead.

if evt.AgentWorkInteger1 == "1": evt.message="Mode: Primary"
_______________________________________________
zenoss-users mailing list
[email protected]
http://lists.zenoss.org/mailman/listinfo/zenoss-users

Reply via email to