Discussion:
transform strange behaviour
aletatone
2013-08-29 14:44:33 UTC
Permalink
aletatone [http://community.zenoss.org/people/aletatone] created the discussion

"transform strange behaviour"

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

--------------------------------------------------------------
Hi All,

i'm traing to change summary of some events generated by cisco trap: "topologyChange".
I added to the summary the name of interface in this way:

evt.summary = evt.summary + ' - Interface ' + evt.ifName

and it work fine.
Than i tried to add also the vlan number involved in "topologyChange"

evt.summary = evt.summary + ' - Interface ' + evt.ifName + ' - vlan ' + evt.vtpVlanIndex

using this nothing happend a no one event appears in events page.

Than i tried something easier:

evt.summary = evt.summary + evt.vtpVlanIndex

but still nothing at all, no one event in the events page.

Than the last one, i tried this:

evt.summary = evt.vtpVlanIndex

And it works! But of course i don't want to have an event with only a number as a summary.
If i try this:

evt.summary = "Vlan: " + evt.vtpVlanIndex

it doesn't work.

I had also tried this:
vlan = evt.vtpVlanIndex
evt.summary = "Vlan: " + vlan

but still nothing.

Why does evt.vtpVlanIndex seem to not work in summary if i put it with other "words" and why does evt.ifName work in any condition?

Thanks
Ale
--------------------------------------------------------------

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

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

"Re: transform strange behaviour"

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

--------------------------------------------------------------
Hello,

try this :

evt.summary = "Vlan: " + *str(evt.vtpVlanIndex)*
instead of
evt.summary = "Vlan: " + evt.vtpVlanIndex

I suppose you are adding an integer to string which makes the transform crash.

Good luck,
--------------------------------------------------------------

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

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

"Re: transform strange behaviour"

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

--------------------------------------------------------------
Thank You very mush Photon!!!

Using *str(evt.vtpVlanIndex)* everything works fine.

I have another little problem.

I need to have all the Events generated by a trap in the same Class, so I created the Class Trap and I added this easy transform to the main event class so that all the trap will be classified correctly:

if evt.agent.find('zentrap') >= 0:
   evt.eventClass='/Trap'

Every works fine an all my traps are classified in the Trap Class but if I add a transform to the Trap Class it is complitely ignored (or it seems to be ignored)?

What could be the problem? is there any log to check what is happend?

Thanks
--------------------------------------------------------------

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

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

"Re: transform strange behaviour"

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

--------------------------------------------------------------
You're welcome ^^

zeneventd is the daemon that executes transforms as far as I know. When your transform crashes (python exception) you can see it in $ZENHOME/log/zeneventd.log. You can also try stopping zeneventd and starting it in debug mode (as zenoss user) :
zeneventd stop
zeneventd run -v10

As for changing an event class, I think it should be done via event mapping not transforms. If I understand your issue correctly, Zenoss considers your event having the main event class. Even if you change it via a transform, Zenoss shouldn't re-check for the new class' transfrom : that step is already done. But if you had mapped your event to the /Trap class, then your transform would have been activated. You should check Jane Curry's event management paper for event mapping. It's quite good !

Also, cascading event transforms might be of interest to you.

Good luck,
--------------------------------------------------------------

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

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