Package Products :: Package ZenHub :: Package services :: Module EventService
[hide private]
[frames] | no frames]

Source Code for Module Products.ZenHub.services.EventService

 1  ########################################################################### 
 2  # 
 3  # This program is part of Zenoss Core, an open source monitoring platform. 
 4  # Copyright (C) 2007, Zenoss Inc. 
 5  # 
 6  # This program is free software; you can redistribute it and/or modify it 
 7  # under the terms of the GNU General Public License version 2 or (at your 
 8  # option) any later version as published by the Free Software Foundation. 
 9  # 
10  # For complete information please visit: http://www.zenoss.com/oss/ 
11  # 
12  ########################################################################### 
13  #! /usr/bin/env python  
14   
15  from twisted.spread import pb 
16   
17  from Products.ZenEvents.Event import Event 
18  pb.setUnjellyableForClass(Event, Event) 
19   
20  from zenoss.protocols.services import ServiceConnectionError 
21  from Products.ZenHub.HubService import HubService 
22  from Products.ZenHub.services.ThresholdMixin import ThresholdMixin 
23  from Products.ZenHub.PBDaemon import translateError 
24  from Products.Zuul import getFacade 
25 26 -class EventService(HubService, ThresholdMixin):
27 28
29 - def __init__(self, dmd, instance):
30 HubService.__init__(self, dmd, instance) 31 self.config = self.dmd.Monitors.Performance._getOb(self.instance) 32 self.methodPriorityMap = { 33 'sendEvent': 0.0, 34 'sendEvents': 0.0, 35 }
36 37 @translateError
38 - def remote_sendEvent(self, evt):
39 try: 40 return self.zem.sendEvent(evt) 41 except Exception, ex: 42 import logging 43 log = logging.getLogger('log') 44 log.exception(ex)
45 46 @translateError
47 - def remote_sendEvents(self, evts):
48 return self.zem.sendEvents(evts)
49 50 @translateError
51 - def remote_getDevicePingIssues(self, *args, **kwargs):
52 zep = getFacade('zep') 53 try: 54 return zep.getDevicePingIssues() 55 except ServiceConnectionError, e: 56 raise pb.Error("Unable to contact ZEP.")
57 58 @translateError
59 - def remote_getDeviceIssues(self, *args, **kwargs):
60 zep = getFacade('zep') 61 return zep.getDeviceIssues()
62 63 @translateError 66 67 @translateError
69 return self.zem.defaultPriority
70