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

Source Code for Module ZenHub.services.RRDService

 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   
14  __doc__='''RRDService 
15   
16  Provides RRD services to zenhub clients. 
17  ''' 
18   
19  from HubService import HubService 
20  from Products.ZenRRD.Thresholds import Thresholds 
21  from RRDImpl import RRDImpl 
22  import logging 
23  log = logging.getLogger("zenhub") 
24  from Products.ZenHub.PBDaemon import translateError 
25   
26 -class RRDService(HubService):
27
28 - def __init__(self, dmd, instance):
29 HubService.__init__(self, dmd, instance) 30 31 # rrd is a dictionary of RRDUtil instances 32 self.rrd = {} 33 self.thresholds = Thresholds() 34 self.rrdimpl = RRDImpl(dmd)
35 36 37 @translateError
38 - def remote_writeRRD(self, devId, compType, compId, dpName, value):
39 '''Write the given data to its rrd file. 40 Also check any thresholds and send events if value is out of bounds. 41 ''' 42 43 return self.rrdimpl.writeRRD(devId, compType, compId, dpName, value)
44