TECHZEN Zenoss User Community ARCHIVE  

transform not working to drop events

Subject: transform not working to drop events
Author: [Not Specified]
Posted: 2014-12-05 10:09

I think I overwrote previous ones that were working :( ...not sure how to revert... oh well.

Not a python guru here, and I don't know what's different about my entries, vs. ones I've found online, vs. why it's now not working.

Probably missing one silly thing here.

---
if evt.summary.startswith("Message text from Windows not available. See source system's event log."):
evt._action = "drop"
---

I'm just looking to drop some of the events here, based on summary.

Another example I've found online, that I based previous (working) ones on included another line, but I'm not clear on whether or not that's needed as a condition to enforce things or not.

---
if evt.summary.startswith("Bad counter for device"):
if evt.summary.endswith("Active Sessions"):
evt._action = "drop"
----

Does it need the "endswith" line, in order to be "complete"
If so, is there any other way to base it on the summary, or, end it with something like () so that it doesn't rely on the end part of the summary that may change slightly



Subject: transform not working to drop events
Author: [Not Specified]
Posted: 2014-12-05 11:58

You definitely don't need endswith along with startswith method. Another test could be something like:
if 'Message text from Windows not available' in evt.summary:
evt._action = 'drop'

--Rob




Subject: Thank you for clarification
Author: [Not Specified]
Posted: 2014-12-05 13:04

Thank you for clarification on that. Wouldn't have thought so, but thought it was worth asking.
Trying the method you suggested on a few - should know within a day at most, and if it works, I'll just convert all the others.

Thanks!



< Previous
incorrect time in graphs
  Next
zenoss event dependancy when server down
>