def vm_utilization_rrd(host_ip,m_type=None): """ Handles periodic collection of VM and Host utilization data and updation of respective RRD file.""" logger.info("ENTERING RRD UPDATION/CREATION........on host: %s" % host_ip) try: rrd_logger.debug("Starting RRD Processing for Host: %s" % host_ip) rrd_logger.debug(host_ip) if is_pingable(host_ip): if m_type is None: update_rrd(host_ip) else: update_rrd(host_ip,m_type) else: rrd_logger.error("UNABLE TO UPDATE RRDs for host : %s" % host_ip) except Exception as e: rrd_logger.debug("ERROR OCCURED: %s" % e) finally: rrd_logger.debug("Completing RRD Processing for Host: %s" % host_ip) logger.debug("EXITING RRD UPDATION/CREATION........on host: %s" % host_ip)
def vm_utilization_rrd(host_ip, m_type=None): """ Handles periodic collection of VM and Host utilization data and updates of respective RRD file. """ logger.info("ENTERING RRD UPDATION/CREATION........on host: %s" % host_ip) try: rrd_logger.debug("Starting RRD Processing for Host: %s" % host_ip) rrd_logger.debug(host_ip) if is_pingable(host_ip): update_rrd(host_ip, m_type) else: rrd_logger.error("UNABLE TO UPDATE RRDs for host : %s" % host_ip) except Exception as e: rrd_logger.debug("ERROR OCCURED: %s" % e) finally: rrd_logger.debug("Completing RRD Processing for Host: %s" % host_ip) logger.debug("EXITING RRD UPDATION/CREATION........on host: %s" % host_ip)
def collect_data_from_host(host_ip_list,host_name_list): active_host_no=len(host_ip_list) data=[] indx_info=[] indx_info.insert(0,'current') indx_info.insert(1,'next') indx_info.insert(2,'latency') indx_info.insert(3,'throughput') data.insert(0,indx_info) for i in range(1,active_host_no+1): host_ip=host_ip_list[i-1] if is_pingable(host_ip): for j in range(1,active_host_no+1): next_host_ip=host_ip_list[j-1] if is_pingable(next_host_ip): row_info=[] latency=get_latency_btw_hosts(next_host_ip,host_ip) throughput=get_throughput_btw_hosts(next_host_ip,host_ip) row_info.insert(0,str(i)) row_info.insert(1,str(j)) row_info.insert(2,latency) row_info.insert(3,throughput) data.insert(((active_host_no*(i-1))+j),row_info) else : logger.debug( "host is unreachable") else : logger.debug("host is unreachable") file_path = os.path.join(get_context_path(), 'static/sigma/graph.tsv') _file = open(file_path, 'w'); writer = csv.writer(_file, dialect="excel-tab") for item in data: writer.writerow(item)