<s> from amonone . core . collector . collector import system_info_collector , process_info_collector <EOL> from amonone . core import settings <EOL> from amonone . utils . dates import unix_utc_now <EOL> import sys <EOL> class Runner ( object ) : <EOL> def system ( self ) : <EOL> system_info_dict = { } <EOL> memory = system_info_collector . get_memory_info ( ) <EOL> cpu = system_info_collector . get_cpu_utilization ( ) <EOL> loadavg = system_info_collector . get_load_average ( ) <EOL> disk = system_info_collector . get_disk_usage ( ) <EOL> network = system_info_collector . get_network_traffic ( ) <EOL> uptime = system_info_collector . get_uptime ( ) <EOL> if memory != False : <EOL> system_info_dict [ '<STR_LIT>' ] = memory <EOL> if cpu != False : <EOL> system_info_dict [ '<STR_LIT>' ] = cpu <EOL> if loadavg != False : <EOL> system_info_dict [ '<STR_LIT>' ] = loadavg <EOL> if disk != False : <EOL> system_info_dict [ '<STR_LIT>' ] = disk <EOL> if network != False : <EOL> system_info_dict [ '<STR_LIT>' ] = network <EOL> if uptime != False : <EOL> system_info_dict [ '<STR_LIT>' ] = uptime <EOL> system_info_dict [ '<STR_LIT:time>' ] = unix_utc_now ( ) <EOL> return system_info_dict <EOL> def processes ( self ) : <EOL> process_checks = process_info_collector . process_list ( ) <EOL> process_info_dict = { } <EOL> for process in process_checks : <EOL> command = process [ "<STR_LIT>" ] <EOL> command = command . replace ( "<STR_LIT:.>" , "<STR_LIT>" ) <EOL> del process [ "<STR_LIT>" ] <EOL> process_info_dict [ command ] = process <EOL> process_info_dict [ '<STR_LIT:time>' ] = unix_utc_now ( ) <EOL> return process_info_dict <EOL> def distribution_info ( self ) : <EOL> distribution_info = system_info_collector . get_system_info ( ) <EOL> return distribution_info <EOL> runner = Runner ( ) </s>
