![]() |
![]() |
Subject: | Dropping event transform, pulling my hair out |
Author: | R S |
Posted: | 2015-07-17 09:21 |
I have been trying to use just about every type of transform I could google to drop certain events that I don't care about. Nothing seems to work (this is my first drop transform), the events are just waiting for me to acknowledge them. Here's the current version of the transform and below that is a screenshot of the message. I've tried the 'summary.find and summary.startswith...
if evt.summary.find("Service: User: Type: Microsoft.Dynamics.Nav.Service.WebServices.ServiceBrokerException") >= 0:
evt._action= "drop"
https://drive.google.com/file/d/0B2bBIURzbxB4aXVybDh0dVNpUGc/viewusp=sh...
Please help :-)
Subject: | Did you know that we have a |
Author: | Andrew Kirch |
Posted: | 2015-07-17 10:47 |
Did you know that we have a whole section of our wiki dedicated to user submitted and curated transforms
http://wiki.zenoss.org/Category:Transforms
I think that this transform will help:
http://wiki.zenoss.org/Drop_Events_with_Transforms
Andrew Kirch
akirch@gvit.com
Need Zenoss support, consulting or custom development Look no further. Email or PM me!
Ready for Distributed Topology (collectors) for Zenoss 5 Coming May 1st from GoVanguard
Subject: | I realize that, which is why |
Author: | R S |
Posted: | 2015-07-17 10:55 |
I realize that, which is why I ask my question. I have tried those, and others. I'll try......again
this is on 4.2.3
Subject: | those should all be valid for |
Author: | [Not Specified] |
Posted: | 2015-07-17 11:08 |
those should all be valid for 4.2.x
Subject: | If I use |
Author: | R S |
Posted: | 2015-07-17 12:21 |
If I use
import re
regex = re.compile('Text to match which will then be dropped')
if re.match(regex, evt.summary):
evt._action = "drop"
Is an exact match required, or will that work for all events that have that text somewhere in the summary
Subject: | I suspect this is something |
Author: | Jane Curry |
Posted: | 2015-07-31 05:12 |
I suspect this is something horrible like differing whitespace between the text that actually comes in on the summary field and the text you are using in the transform.
I might uses zendmd to test out the matching. Cut and paste the string to match out of a detailed display of an actual event.
[zenoss@zen42 Windows]$ zendmd
Welcome to the Zenoss dmd command shell!
'dmd' is bound to the DataRoot. 'zhelp()' to get a list of commands.
Use TAB-TAB to see a list of zendmd related commands.
Tab completion also works for objects -- hit tab after an object name and '.'
(eg dmd. + tab-key).
>>> myStr = 'Service: User: Type: Microsoft.Dynamics.Nav.Service.WebServices.ServiceBrokerException'
>>> myMatchStr = 'Service: User: Type: Microsoft.Dynamics.Nav.Service.WebServices.ServiceBrokerException'
>>> if myStr.find(myMatchStr) >=0:
... print 'got match'
... else:
... print 'no match'
...
got match
>>>
>>>
>>> myStrExtraSpace = 'Service: User: Type: Microsoft.Dynamics.Nav.Service.WebServices.ServiceBrokerException'
>>> if myStrExtraSpace.find(myMatchStr) >=0:
... print 'got match'
... else:
... print 'no match'
...
no match
Grrr - the forum post always seems to mess-up white space indentation on Python snippets - the above needs usual Python indentation to make it legal.
Email: jane.curry@skills-1st.co.uk Web: https://www.skills-1st.co.uk
Subject: | I wish that made any sense to |
Author: | R S |
Posted: | 2015-09-03 14:03 |
I wish that made any sense to me. Transforms still aren't working
Subject: | You might use 'zensendevent' |
Author: | Andrew Kirch |
Posted: | 2015-09-04 13:12 |
You might use 'zensendevent' from the CLI to test.
Andrew Kirch
akirch@gvit.com
Need Zenoss support, consulting or custom development Look no further. Email or PM me!
Ready for Distributed Topology (collectors) for Zenoss 5 Coming May 1st from GoVanguard
Subject: | I've tested the transform |
Author: | R S |
Posted: | 2015-09-09 10:24 |
I've tested the transform using the zensendevent command. It works as expected. However, I've just received another alert that isn't dropped. Same as my test event. This is happening with all the transforms in the \unknown class. Yet, when tested manually the event never makes it into the console as it is being dropped.
Here is a screenshot of the actual event, not one using zensendevent
https://drive.google.com/file/d/0B2bBIURzbxB4em1FbEtXZlNfZmc/viewusp=sh...
Here is my current transform
if 'dbextclr11.exe Framework Version: v4.0.30319' in evt.summary:
evt._action='drop'
I have also tried...
import re
regex = re.compile('dbextclr11.exe Framework Version: v4.0.30319')
if re.match(regex, evt.summary):
evt._action = 'drop'
This also works when running a test with zensendevent. Despite the formatting shown here, the evt._action is tabbed in
Subject: | Would this have anything to |
Author: | R S |
Posted: | 2015-09-09 11:05 |
Would this have anything to do with the event summary containing ( )'s And the transform getting tripped up because of it
< |
Previous threshold of high utilization exceeded on lo interface |
Next zenactiond errors in log |
> |