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

# Source Code for Module Products.ZenHub.services.RRDService

     1  ##############################################################################
     2  #
     3  # Copyright (C) Zenoss, Inc. 2007, all rights reserved.
     4  #
     5  # This content is made available according to terms specified in
     6  # License.zenoss under the directory where your Zenoss product is installed.
     7  #
     8  ##############################################################################
     9
    10
    11  __doc__='''RRDService
    12
    13  Provides RRD services to zenhub clients.
    14  '''
    15
    16  from HubService import HubService
    17  from Products.ZenRRD.Thresholds import Thresholds
    18  from RRDImpl import RRDImpl
    19  import logging
    20  log = logging.getLogger("zenhub")
    21  from Products.ZenHub.PBDaemon import translateError
    22
    23 -class RRDService(HubService):
    24
    25 -    def __init__(self, dmd, instance):
    26          HubService.__init__(self, dmd, instance)
    27
    28          # rrd is a dictionary of RRDUtil instances
    29          self.rrd = {}
    30          self.thresholds = Thresholds()
    31          self.rrdimpl = RRDImpl(dmd)
    32
    33
    34      @translateError
    35 -    def remote_writeRRD(self, devId, compType, compId, dpName, value):
    36          '''Write the given data to its rrd file.
    37          Also check any thresholds and send events if value is out of bounds.
    38          '''
    39
    40          return self.rrdimpl.writeRRD(devId, compType, compId, dpName, value)
    41