How do I send special characters to a Cisco router using Netmiko

33 Views Asked by At

I wonder if you can assist me please.. I'm using Netmiko to communicate with a Cisco router:

class IosxeSteadyStateTestSetup(object):
    def iosxe_session_setup2(self, ip:ipaddress, username:str, password: str, device_type: str):
        logger.console("IOS Session Setup")
        lab_dut = {
            'host': ip,
            'username': username,
            'password': password,
            'device_type': device_type
        }
        self.net_connect = ConnectHandler(**lab_dut)

    def iosxe_send_command_p(self, command:str):
        logger.console(command)
        output = self.net_connect.send_command_timing(
            command_string=command,
            strip_prompt=False,
            strip_command=False
        )

mydog = IosxeSteadyStateTestSetup()
mydog.iosxe_session_setup2(ip='10.10.10.10’, username='cisco', password=‘cisco', device_type='cisco_xe')
mydog.iosxe_send_command_p(command=‘’)

I need to send the following 4-key combination: shift+ctrl+6+X to terminate the session. How do I do that please?

Thanks in advance

0

There are 0 best solutions below