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.RRDUtil import RRDUtil 
21  from Products.ZenRRD.Thresholds import Thresholds 
22  from RRDImpl import RRDImpl 
23  import time 
24  import logging 
25  log = logging.getLogger("zenhub") 
26   
27 -class RRDService(HubService):
28
29 - def __init__(self, dmd, instance):
30 HubService.__init__(self, dmd, instance) 31 32 # rrd is a dictionary of RRDUtil instances 33 self.rrd = {} 34 self.thresholds = Thresholds() 35 self.rrdimpl = RRDImpl(dmd)
36 37
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