def checkMetrics(self):
		"""Return a Nagios specific performance metrics string given keys and parameter definitions"""
		metrics = ''
		warning = ''
		critical = ''
		if self.rules.metric_list != None:
			for metric in self.rules.metric_list:
				key = metric
				minimum = maximum = warn_range = crit_range = None
				uom = ''
				if ',' in metric:
					vals = metric.split(',')
					if len(vals) == 2:
						key,uom = vals
					if len(vals) == 4:
						key,uom,warn_range,crit_range = vals
					if len(vals) == 6:
						key,uom,warn_range,crit_range,minimum,maximum = vals
				key, alias = _getKeyAlias(key)
				if self.helper.exists(key):
					metrics += "'%s'=%s" % (alias, self.helper.get(key))
					if uom: metrics += uom
					if warn_range != None:
						warning += self.checkThreshold(key, alias, warn_range)
						metrics += ";%s" % warn_range
					if crit_range != None:
						critical += self.checkThreshold(key, alias, crit_range)
						metrics += ";%s" % crit_range
					if minimum != None:
						critical += self.checkThreshold(key, alias, minimum + ':')
						metrics += ";%s" % minimum
					if maximum != None:
						critical += self.checkThreshold(key, alias, '~:' + maximum)
						metrics += ";%s" % maximum
				metrics += ' '
		return ("%s" % metrics, warning, critical)
dataset/ETHPy150Open drewkerrigan/nagios-http-json/check_http_json.py/JsonRuleProcessor.checkMetrics/original