示例#1
0
	def __init__(self, retention=0, dca_min_length = 250, logging_level=logging.INFO, cache=True, **kwargs):
		self.logger = logging.getLogger('manager')
		self.logger.setLevel(logging_level)

		# Store
		self.store = store(logging_level=logging_level, **kwargs)
		
		self.dca_min_length = dca_min_length
		
		# Seconds
		self.retention = retention
		
		# Cache
		self.cache = cache
		self.cache_max_size = 5000
		self.cache_size = 0
		self.md5_cache = {}
		
		self.fields_map = {
				'retention':	('r', self.retention),
				'type':			('t', 'GAUGE'),
				'unit':			('u', None),
				'min':			('mi', None),
				'max':			('ma', None),
				'thd_warn':		('tw', None),
				'thd_crit':		('tc', None)
		}
示例#2
0
	def __init__(self, mongo_collection='perfdata2', retention=0, dca_min_length = 250, logging_level=logging.INFO, cache=True, mongo_safe=False):
		self.logger = logging.getLogger('manager')
		self.logger.setLevel(logging_level)
		
		self.store = store(mongo_collection=mongo_collection, logging_level=logging_level, mongo_safe=mongo_safe)
		
		self.dca_min_length = dca_min_length
		
		# Seconds
		self.retention = retention
		
		# Cache
		self.cache = cache
		self.cache_max_size = 5000
		self.cache_size = 0
		self.md5_cache = {}
		
		self.fields_map = {
				'retention':	('r', self.retention),
				'type':			('t', 'GAUGE'),
				'unit':			('u', None),
				'min':			('mi', None),
				'max':			('ma', None),
				'thd_warn':		('tw', None),
				'thd_crit':		('tc', None)
		}