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

Source Code for Module 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 as published by 
 8  # 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 Products.ZenHub.HubService import HubService 
21  from Products.ZenHub.services.ThresholdMixin import ThresholdMixin 
22  from Products.ZenHub.PBDaemon import translateError 
23   
24 -class EventService(HubService, ThresholdMixin):
25 26
27 - def __init__(self, dmd, instance):
28 HubService.__init__(self, dmd, instance) 29 self.config = self.dmd.Monitors.Performance._getOb(self.instance) 30 self.methodPriorityMap = { 31 'sendEvent': 0.0, 32 'sendEvents': 0.0, 33 }
34 35 @translateError
36 - def remote_sendEvent(self, evt):
37 try: 38 return self.zem.sendEvent(evt) 39 except Exception, ex: 40 import logging 41 log = logging.getLogger('log') 42 log.exception(ex)
43 44 45 @translateError
46 - def remote_sendEvents(self, evts):
47 return self.zem.sendEvents(evts)
48 49 50 @translateError
51 - def remote_getDevicePingIssues(self, *args, **kwargs):
52 return self.zem.getDevicePingIssues(*args, **kwargs)
53 54 55 @translateError
56 - def remote_getDeviceIssues(self, *args, **kwargs):
57 return self.zem.getDeviceIssues(*args, **kwargs)
58 59 60 @translateError
61 - def remote_getWmiConnIssues(self):
62 return self.zem.getWmiConnIssues()
63 64 @translateError 67 68 @translateError
70 return self.zem.defaultPriority
71 72 @translateError
73 - def remote_oid2name(self, oid, exactMatch=True, strip=False):
74 "get oids, even if we're handed slightly wrong values" 75 name = self.dmd.Mibs.oid2name(oid, exactMatch, strip) 76 return name or oid
77