Archived community.zenoss.org | full text search
Skip navigation
1 2 Previous Next 208433 Views 28 Replies Latest reply: Nov 6, 2009 6:29 PM by Ryan Matte RSS
Ryan Matte ZenossMaster 653 posts since
Mar 26, 2009
Currently Being Moderated

Nov 5, 2009 3:44 PM

Unable to use dmd.ZenEventManager.manage_ackEvents() in a script or zendmd!

I am currently unable to use dmd.ZenEventManager.manage_ackEvents() in a script or zendmd.

When I use it in my script (as "dmd.ZenEventManager.manage_ackEvents(evt.evid)" where evt.evid is the event ID) I get:

Traceback (most recent call last):
  File "./ticket_create_test.py", line 60, in ?
    dmd.ZenEventManager.manage_ackEvents(evt.evid)
  File "/usr/local/zenoss/zenoss/Products/ZenEvents/EventManagerBase.py", line 1577, in manage_ackEvents
    self.manage_setEventStates(1 , evids, REQUEST=request)
  File "/usr/local/zenoss/zenoss/Products/ZenEvents/EventManagerBase.py", line 1606, in manage_setEventStates
    messaging.IMessageSender(self).sendToBrowser(
  File "/usr/local/zenoss/zenoss/lib/python/zope/interface/interface.py", line 682, in __call__
    raise TypeError("Could not adapt", obj, self)
TypeError: ('Could not adapt', <MySqlEventManager at /zport/dmd/ZenEventManager>, <InterfaceClass Products.ZenWidgets.interfaces.IMessageSender>)

When I use the function in zendmd I get:

>>> dmd.ZenEventManager.manage_ackEvents('50ac591d-26c6-4dd2-b35d-e9c87ce7806c')
Traceback (most recent call last):
  File "<console>", line 1, in ?
  File "/usr/local/zenoss/zenoss/Products/ZenEvents/EventManagerBase.py", line 1577, in manage_ackEvents
    self.manage_setEventStates(1 , evids, REQUEST=request)
  File "/usr/local/zenoss/zenoss/Products/ZenEvents/EventManagerBase.py", line 1608, in manage_setEventStates
    reason
  File "/usr/local/zenoss/zenoss/Products/ZenWidgets/messaging.py", line 186, in sendToBrowser
    context = self.context.REQUEST.SESSION.get('messages')
  File "/usr/local/zenoss/zenoss/lib/python/ZPublisher/HTTPRequest.py", line 1219, in __getattr__
    raise AttributeError, key
AttributeError: SESSION

Can someone shed light on what is causing this?  Is this a bug?  It certainly seems like one since I can use dmd.ZenEventManager.manage_deleteEvents(evt.evid) in my script perfectly fine.  Note that the events do actually get acknowledged in Zenoss, but then the error is thrown which crashes my script.
1 2 Previous Next

More Like This

  • Retrieving data ...

Legend

  • Correct Answers - 4 points
  • Helpful Answers - 2 points