def __init__(self, switch_description): log_namespace = "Monitor.Switch" + switch_description["model"] + 'CLI' self.logger = logging.getLogger(log_namespace) self.log_id = "Switch" + switch_description[ "model"] + ":" + switch_description["ip"] + ": " SSHConnection.__init__(self, switch_description["ip"], switch_description["user"], switch_description["password"], switch_description["cli_name"], log_namespace) self.OF_INSTANCE = switch_description["openflow_instance_name"] self.connect() self.COMMAND_SHOW_CPU = "display cpu-usage" self.COMMAND_RESET_OPENFLOW = [ "openflow instance " + self.OF_INSTANCE, "undo active instance", "active instance", "quit" ] self.COMMAND_GET_FLOWS_COUNT = "display openflow instance " + str( self.OF_INSTANCE) self.ENABLE_EXTENSIBILITY_TABLE = [ "openflow instance " + self.OF_INSTANCE, "undo active instance", "flow-table extensibility 20", "active instance", "quit" ] self.ENABLE_MACIP_TABLE = [ "openflow instance " + self.OF_INSTANCE, "undo active instance", "flow-table mac-ip 10", "active instance", "quit" ] self.executeCommand(["system-view"])
def __init__(self, switch_description): log_namespace = "Monitor.Switch"+switch_description["model"]+'CLI' self.logger = logging.getLogger(log_namespace) self.log_id = "Switch"+switch_description["model"]+":"+switch_description["ip"]+": " SSHConnection.__init__(self,switch_description["ip"],switch_description["user"], switch_description["password"],switch_description["cli_name"],log_namespace) self.OF_INSTANCE = switch_description["openflow_instance_name"] self.connect() self.COMMAND_SHOW_CPU = "display cpu-usage" self.COMMAND_RESET_OPENFLOW = ["openflow instance "+self.OF_INSTANCE, "undo active instance", "active instance", "quit"] self.COMMAND_GET_FLOWS_COUNT = "display openflow instance "+str(self.OF_INSTANCE) self.ENABLE_EXTENSIBILITY_TABLE = ["openflow instance "+self.OF_INSTANCE, "undo active instance", "flow-table extensibility 20", "active instance", "quit"] self.ENABLE_MACIP_TABLE = ["openflow instance "+self.OF_INSTANCE, "undo active instance", "flow-table mac-ip 10", "active instance", "quit"] self.executeCommand(["system-view"])
def __init__(self, switch_description): log_namespace = "Monitor.Switch"+switch_description["model"]+'CLI' self.logger = logging.getLogger(log_namespace) self.log_id = "Switch"+switch_description["model"]+":"+switch_description["ip"]+": " SSHConnection.__init__(self,switch_description["ip"],switch_description["user"], switch_description["password"],switch_description["cli_name"], log_namespace) self.OF_INSTANCE = switch_description["openflow_instance_name"] self.connect() self.COMMAND_SHOW_CPU = "show cpu 5" self.SF_RATE_LIMIT = 10 self.COMMAND_RESET_OPENFLOW = ["config", "openflow disable", "openflow enable", "exit"] self.COMMAND_DISABLE_OPENFLOW_INSTANCE = ["config", "openflow disable", "openflow instance "+self.OF_INSTANCE+" disable", "exit"] self.COMMAND_GET_FLOWS_COUNT = "show openflow" self.getFlowsCountOverCLI() self.updateCPU()