# Path: amonagent/utils.py
# def split_and_slugify(string, separator=":"):
# 	_string = string.strip().split(separator)
# 	
# 	if len(_string) == 2: # Only key, value
# 		data = {}
# 		key = slugify(unicode(_string[0]))
# 		
# 		try:
# 			if len(_string[1]) > 0:
# 				data[key] = str(_string[1].strip())
# 		except:
# 			pass
# 
# 		return data
# 	
# 	else:
# 		return None
# 
# def to_float(value):
# 	result = value
# 	if not isinstance(value, int):
# 		result = float(value.replace(",", "."))
# 	
# 	return result


import subprocess
import re
import logging
from amonagent.utils import split_and_slugify, to_float
			"used_mb": memory_used,
			"used_percent": memory_percent_used,
			"swap_total_mb":swap_total,
			"swap_free_mb": swap_free,
			"swap_used_mb": swap_used,
			"swap_used_percent": swap_percent_used
		}

		# Convert everything to int to avoid float localization problems
		for k,v in extracted_data.items():
			extracted_data[k] = int(v)
	   
		return extracted_data


class DiskCheck(object):


	def parse_output(self, df_output):

		all_devices = [l.strip().split() for l in df_output.split("\n")]

		# Skip the header row and empty lines.
		raw_devices = [l for l in all_devices[1:] if l]

		# Flatten the disks that appear in the mulitple lines.
		flattened_devices = self._flatten_devices(raw_devices)

		# Filter fake disks.
		def keep_device(device):

# Path: amonagent/utils.py
# def split_and_slugify(string, separator=":"):
# 	_string = string.strip().split(separator)
# 	
# 	if len(_string) == 2: # Only key, value
# 		data = {}
# 		key = slugify(unicode(_string[0]))
# 		
# 		try:
# 			if len(_string[1]) > 0:
# 				data[key] = str(_string[1].strip())
# 		except:
# 			pass
# 
# 		return data
# 	
# 	else:
# 		return None
# 
# def to_float(value):
# 	result = value
# 	if not isinstance(value, int):
# 		result = float(value.replace(",", "."))
# 	
# 	return result


# Path: amonagent/modules/core.py
import subprocess
import re
import logging
from amonagent.utils import split_and_slugify, to_float

			"used_mb": memory_used,
			"used_percent": memory_percent_used,
			"swap_total_mb":swap_total,
			"swap_free_mb": swap_free,
			"swap_used_mb": swap_used,
			"swap_used_percent": swap_percent_used
		}

		# Convert everything to int to avoid float localization problems
		for k,v in extracted_data.items():
			extracted_data[k] = int(v)
	   
		return extracted_data


class DiskCheck(object):


	def parse_output(self, df_output):

		all_devices = [l.strip().split() for l in df_output.split("\n")]

		# Skip the header row and empty lines.
		raw_devices = [l for l in all_devices[1:] if l]

		# Flatten the disks that appear in the mulitple lines.
		flattened_devices = self._flatten_devices(raw_devices)

		# Filter fake disks.
		def keep_device(device):

			if not self._is_real_device(device):