def send_nodemgr_process_status(self): if self.prev_fail_status_bits == self.fail_status_bits: return self.prev_fail_status_bits = self.fail_status_bits fail_status_bits = self.fail_status_bits state, description = self._get_process_state(fail_status_bits) conn_infos = ConnectionState._connection_map.values() (cb_state, cb_description) = ConnectionState.get_conn_state_cb(conn_infos) if (cb_state == ProcessState.NON_FUNCTIONAL): state = ProcessState.NON_FUNCTIONAL if description != '': description += ' ' description += cb_description process_status = ProcessStatus(module_id=self.type_info._module_name, instance_id=self.instance_id, state=ProcessStateNames[state], description=description, connection_infos=conn_infos) process_status_list = [] process_status_list.append(process_status) node_status = NodeStatus(name=self.hostname, process_status=process_status_list) node_status_uve = NodeStatusUVE(table=self.type_info._object_table, data=node_status) msg = ('send_nodemgr_process_status: Sending UVE:' + str(node_status_uve)) self.msg_log(msg, SandeshLevel.SYS_INFO) node_status_uve.send()
def send_nodemgr_process_status_base(self, ProcessStateNames, ProcessState, ProcessStatus): if (self.prev_fail_status_bits != self.fail_status_bits): self.prev_fail_status_bits = self.fail_status_bits fail_status_bits = self.fail_status_bits state, description = self.get_process_state(fail_status_bits) process_status = ProcessStatus( module_id=self.type_info._module_name, instance_id=self.instance_id, state=state, description=description) process_status_list = [] process_status_list.append(process_status) node_status = NodeStatus(name=socket.gethostname(), process_status=process_status_list) node_status_uve = NodeStatusUVE(table=self.type_info._object_table, data=node_status) msg = 'send_nodemgr_process_status_base: Sending UVE:' + str(node_status_uve) self.msg_log(msg, SandeshLevel.SYS_INFO) node_status_uve.send()