May 2, 2013 1:29 PM
Getting all events for a device in 4.2.3's ZenDMD
-
Like (0)
I am in the middle of completely revamping our monitoring model for 4.2.3 and am writing several detailed transforms that will impose a kind of heirarchy, but I'm having trouble understanding how to simply get all events for device [x] (and not necessarily the device triggering the event) in the 4.2.3 ZenDMD. I explored ZenDMD itself for a while thinking there had to be an easy function similar to ones found in version 3 and earlier. Finally after reading this page: http://wiki.zenoss.org/ZenDMD_Tip_-_Manipulate_Events I started playing around with createEventFilter. When I couldn't get it to do what I wanted, I started digging around in the source code itself. I was extremely surprised to see that out of the large number of possible options you can feed that function for an event list device is NOT included. This makes me wonder if I'm going about this in the wrong way, if there's been a fundamental shift in the Zenoss object model/mentality that I'm unknowingly fighting against.
What would be the simplest way to get all events for a given device via ZenDMD in a transform? There does not seem to be anything obvious, unless I'm misunderstanding syntax terminology somewhere. I need them *all* for just a *device*, not just a specific class, group, or any other qualifier that does work in createEventFilter. Beyond that question, is there a overall reason it's no longer as simple to do this? Has there been a change in design that makes this a sub-optimal solution? Should I be thinking about events in a different way? Is there a chunk of source code that might explain everything that someone could point me to?
Thanks!
-Matt
For anyone else running into this issue, here is the solution (thanks to Zenoss support!):
from Products.Zuul import getFacade
zep = getFacade('zep')
zep_filter = zep.createEventFilter(element_identifier=("mydevice.name"))
for summary in zep.getEventSummariesGenerator(filter=zep_filter):
pprint(summary)
element_identifier apparently is the current name of the device attribute, something that slipped right past me while going through the source code.
-Matt
Follow Us On Twitter »
|
Latest from the Zenoss Blog » | Community | Products | Services Resources | Customers Partners | About Us | ||
Copyright © 2005-2011 Zenoss, Inc.
|
||||||||