Пример #1
0
    def __init__(self, cfgid):
	# bh: Load config via rrd_plugin
        RRDPlugin.__init__(self, 'RRD')
	
	# bh: Set the default value for config 'rrd_groups'
	self.cfg[RRDGroupPlugin.RRD_GROUPS] = []
	self.cfg[RRDGroupPlugin.REDIS_HOST] = '127.0.0.1'
	self.cfg[RRDGroupPlugin.REDIS_PORT] = 6379
	self.cfg[RRDGroupPlugin.REDIS_DB] = 0

	self.kwHandlers[RRDGroupPlugin.RRD_GROUPS] = self._parseRrdGroups
	self.kwHandlers[RRDGroupPlugin.REDIS_HOST] = self._parseRedisHost
	self.kwHandlers[RRDGroupPlugin.REDIS_PORT] = self._parseRedisPort
	self.kwHandlers[RRDGroupPlugin.REDIS_DB] = self._parseRedisDB
	
	GmetadPlugin.__init__(self, 'REDIS')
	GmetadPlugin.__init__(self, cfgid)

	self.hostCache = {}
	
	try:
		self.hostRedis = redis.StrictRedis(
			host=self.cfg[RRDGroupPlugin.REDIS_HOST],
			port=self.cfg[RRDGroupPlugin.REDIS_PORT],
			db=self.cfg[RRDGroupPlugin.REDIS_DB]
		)
		self.hostRedis.ping()
	except redis.ConnectionError:
		logging.error('Redis server [%s:%d/%s] not ready' % (self.cfg[RRDGroupPlugin.REDIS_HOST], self.cfg[RRDGroupPlugin.REDIS_PORT], self.cfg[RRDGroupPlugin.REDIS_DB]))
		raise

	self._getHostInfo('vminfo')
Пример #2
0
    def __init__(self):
        threading.Thread.__init__(self)
        # Call the base class init so that we have access to its configuration directives.
        RRDPlugin.__init__(self, 'RRD')

        self._cond = threading.Condition()
        self._running = False
        self._shuttingDown = False
Пример #3
0
    def __init__(self):
        threading.Thread.__init__(self)
        # Call the base class init so that we have access to its configuration directives.
        RRDPlugin.__init__(self, 'RRD')

        self._cond = threading.Condition()
        self._running = False
        self._shuttingDown = False
    def __init__(self, cfgid):
        # bh: Load config via rrd_plugin
        RRDPlugin.__init__(self, "RRD")

        # bh: Set the default value for config 'rrd_groups'
        self.cfg[RRDGroupPlugin.RRD_GROUPS] = []
        self.cfg[RRDGroupPlugin.REDIS_HOST] = "127.0.0.1"
        self.cfg[RRDGroupPlugin.REDIS_PORT] = 6379
        self.cfg[RRDGroupPlugin.REDIS_DB] = 0

        self.kwHandlers[RRDGroupPlugin.RRD_GROUPS] = self._parseRrdGroups
        self.kwHandlers[RRDGroupPlugin.REDIS_HOST] = self._parseRedisHost
        self.kwHandlers[RRDGroupPlugin.REDIS_PORT] = self._parseRedisPort
        self.kwHandlers[RRDGroupPlugin.REDIS_DB] = self._parseRedisDB

        GmetadPlugin.__init__(self, "REDIS")
        GmetadPlugin.__init__(self, cfgid)

        self.hostCache = {}

        try:
            self.hostRedis = redis.StrictRedis(
                host=self.cfg[RRDGroupPlugin.REDIS_HOST],
                port=self.cfg[RRDGroupPlugin.REDIS_PORT],
                db=self.cfg[RRDGroupPlugin.REDIS_DB],
            )
            self.hostRedis.ping()
        except redis.ConnectionError:
            logging.error(
                "Redis server [%s:%d/%s] not ready"
                % (
                    self.cfg[RRDGroupPlugin.REDIS_HOST],
                    self.cfg[RRDGroupPlugin.REDIS_PORT],
                    self.cfg[RRDGroupPlugin.REDIS_DB],
                )
            )
            raise

        self._getHostInfo("vminfo")
Пример #5
0
 def __init__(self, cfgid):
     RRDPlugin.__init__(self, 'RRD')
Пример #6
0
 def __init__(self, cfgid):
     RRDPlugin.__init__(self, 'RRD')