def send_init_info(self): # system_cpu_info mem_cpu_usage_data = MemCpuUsageData(os.getpid(), self.last_cpu, self.last_time) sys_cpu = SystemCpuInfo() sys_cpu.num_socket = mem_cpu_usage_data.get_num_socket() sys_cpu.num_cpu = mem_cpu_usage_data.get_num_cpu() sys_cpu.num_core_per_socket = mem_cpu_usage_data.get_num_core_per_socket() sys_cpu.num_thread_per_core = mem_cpu_usage_data.get_num_thread_per_core() node_status = NodeStatus( name=socket.gethostname(), system_cpu_info=sys_cpu, build_info = self.get_build_info()) # installed/running package version installed_package_version = \ NodeMgrUtils.get_package_version(self.get_package_name()) if installed_package_version is None: sys.stderr.write("Error getting %s package version\n" % (self.get_package_name())) exit(-1) else: self.installed_package_version = installed_package_version node_status.installed_package_version = installed_package_version node_status.running_package_version = installed_package_version node_status_uve = NodeStatusUVE(table=self.table, data=node_status) node_status_uve.send()
def send_init_info(self): self.group_names = list(set([pstat.group for pstat in self.process_state_db.values()])) for group in self.group_names: key = next(key for key, pstat in self.process_state_db.items() if pstat.group == group) # system_cpu_info mem_cpu_usage_data = MemCpuUsageData(os.getpid(), self.last_cpu, self.last_time) sys_cpu = SystemCpuInfo() sys_cpu.num_socket = mem_cpu_usage_data.get_num_socket() sys_cpu.num_cpu = mem_cpu_usage_data.get_num_cpu() sys_cpu.num_core_per_socket = mem_cpu_usage_data.get_num_core_per_socket() sys_cpu.num_thread_per_core = mem_cpu_usage_data.get_num_thread_per_core() node_status = NodeStatus( name=self.process_state_db[key].name, system_cpu_info=sys_cpu, build_info = self.get_build_info()) # installed/running package version installed_package_version = \ NodeMgrUtils.get_package_version(self.get_package_name()) if installed_package_version is None: sys.stderr.write("Error getting %s package version\n" % (self.get_package_name())) exit(-1) else: self.installed_package_version = installed_package_version node_status.installed_package_version = installed_package_version node_status.running_package_version = installed_package_version node_status_uve = NodeStatusUVE(table=self.type_info._object_table, data=node_status) node_status_uve.send()
def send_init_info(self, group_name): key = next(key for key in self.process_state_db[group_name]) # system_cpu_info mem_cpu_usage_data = MemCpuUsageData(os.getpid(), self.last_cpu, self.last_time) sys_cpu = SystemCpuInfo() sys_cpu.num_socket = mem_cpu_usage_data.get_num_socket() sys_cpu.num_cpu = mem_cpu_usage_data.get_num_cpu() sys_cpu.num_core_per_socket = mem_cpu_usage_data.get_num_core_per_socket( ) sys_cpu.num_thread_per_core = mem_cpu_usage_data.get_num_thread_per_core( ) node_status = NodeStatus( name=self.process_state_db[group_name][key].name, system_cpu_info=sys_cpu, build_info=self.get_build_info()) # installed/running package version installed_package_version = \ NodeMgrUtils.get_package_version(self.get_package_name()) if installed_package_version is None: self.msg_log( 'Error getting %s package version' % (self.get_package_name()), SandeshLevel.SYS_ERR) exit(-1) else: self.installed_package_version = installed_package_version node_status.installed_package_version = installed_package_version node_status.running_package_version = installed_package_version node_status_uve = NodeStatusUVE(table=self.type_info._object_table, data=node_status) node_status_uve.send()
def send_init_info(self, group_name): key = next(key for key in self.process_state_db[group_name]) # system_cpu_info mem_cpu_usage_data = MemCpuUsageData(os.getpid(), self.last_cpu, self.last_time) sys_cpu = SystemCpuInfo() sys_cpu.num_socket = mem_cpu_usage_data.get_num_socket() sys_cpu.num_cpu = mem_cpu_usage_data.get_num_cpu() sys_cpu.num_core_per_socket = mem_cpu_usage_data.get_num_core_per_socket() sys_cpu.num_thread_per_core = mem_cpu_usage_data.get_num_thread_per_core() node_status = NodeStatus( name=self.process_state_db[group_name][key].name, system_cpu_info=sys_cpu, build_info = self.get_build_info()) # installed/running package version installed_package_version = \ NodeMgrUtils.get_package_version(self.get_package_name()) if installed_package_version is None: self.msg_log('Error getting %s package version' % (self.get_package_name()), SandeshLevel.SYS_ERR) exit(-1) else: self.installed_package_version = installed_package_version node_status.installed_package_version = installed_package_version node_status.running_package_version = installed_package_version node_status_uve = NodeStatusUVE(table=self.type_info._object_table, data=node_status) node_status_uve.send()
def send_init_info(self): # system_cpu_info mem_cpu_usage_data = MemCpuUsageData(os.getpid(), self.last_cpu, self.last_time) sys_cpu = SystemCpuInfo() sys_cpu.num_socket = mem_cpu_usage_data.get_num_socket() sys_cpu.num_cpu = mem_cpu_usage_data.get_num_cpu() sys_cpu.num_core_per_socket = mem_cpu_usage_data.get_num_core_per_socket() sys_cpu.num_thread_per_core = mem_cpu_usage_data.get_num_thread_per_core() node_status = NodeStatus( name=socket.gethostname(), system_cpu_info=sys_cpu, build_info = self.get_build_info()) # installed/running package version installed_package_version = \ NodeMgrUtils.get_package_version(self.get_package_name()) if installed_package_version is None: sys.stderr.write("Error getting %s package version\n" % (self.get_package_name())) exit(-1) else: self.installed_package_version = installed_package_version node_status.installed_package_version = installed_package_version node_status.running_package_version = installed_package_version node_status_uve = NodeStatusUVE(table=self.type_info._object_table, data=node_status) node_status_uve.send()
def send_system_cpu_info(self): mem_cpu_usage_data = MemCpuUsageData(os.getpid(), self.last_cpu, self.last_time) sys_cpu = SystemCpuInfo() sys_cpu.num_socket = mem_cpu_usage_data.get_num_socket() sys_cpu.num_cpu = mem_cpu_usage_data.get_num_cpu() sys_cpu.num_core_per_socket = mem_cpu_usage_data.get_num_core_per_socket() sys_cpu.num_thread_per_core = mem_cpu_usage_data.get_num_thread_per_core() node_status = NodeStatus(name=socket.gethostname(), system_cpu_info=sys_cpu) node_status_uve = NodeStatusUVE(table=self.table, data=node_status) node_status_uve.send()
def send_init_info(self): # system_cpu_info mem_cpu_usage_data = MemCpuUsageData(os.getpid(), self.last_cpu, self.last_time) sys_cpu = SystemCpuInfo() sys_cpu.num_socket = mem_cpu_usage_data.get_num_socket() sys_cpu.num_cpu = mem_cpu_usage_data.get_num_cpu() sys_cpu.num_core_per_socket = mem_cpu_usage_data.get_num_core_per_socket() sys_cpu.num_thread_per_core = mem_cpu_usage_data.get_num_thread_per_core() # installed/running package version self.installed_package_version = NodeMgrUtils.get_package_version \ (self.get_package_name()) node_status = NodeStatus( name=socket.gethostname(), system_cpu_info=sys_cpu, installed_package_version=self.installed_package_version, running_package_version=self.installed_package_version, build_info = self.get_build_info()) node_status_uve = NodeStatusUVE(table=self.table, data=node_status) node_status_uve.send()