• NetMikoTimeoutException: Timed-out reading channel, data not available


    [root@bogon good]# vi  huawei.248.py 
      1 from netmiko import ConnectHandler
      2 import logging
      3 logging.basicConfig(filename="test.log", level=logging.DEBUG)
      4 huawei = {'device_type': 'huawei', 'ip': '10.10.17.248', 'username': 'root@default', 'password': 'xxx.',     'port': 22}
      5 net_connect = ConnectHandler(**huawei)
      6 sshConfirm = net_connect.find_prompt()
      7 print('login ' + sshConfirm)
      8 commands = ['dis version']
      9 output = net_connect.send_config_set(commands)
     10 print(output)
     11 net_connect.disconnect()
    [root@bogon good]# python  huawei.248.py 
    Traceback (most recent call last):
      File "huawei.248.py", line 5, in <module>
        net_connect = ConnectHandler(**huawei)
      File "/usr/lib/python2.7/site-packages/netmiko/ssh_dispatcher.py", line 246, in ConnectHandler
        return ConnectionClass(*args, **kwargs)
      File "/usr/lib/python2.7/site-packages/netmiko/base_connection.py", line 317, in __init__
        self._open()
      File "/usr/lib/python2.7/site-packages/netmiko/base_connection.py", line 323, in _open
        self._try_session_preparation()
      File "/usr/lib/python2.7/site-packages/netmiko/base_connection.py", line 738, in _try_session_preparation
        self.session_preparation()
      File "/usr/lib/python2.7/site-packages/netmiko/huawei/huawei.py", line 15, in session_preparation
        self.disable_paging(command="screen-length 0 temporary")
      File "/usr/lib/python2.7/site-packages/netmiko/base_connection.py", line 1015, in disable_paging
        output = self.read_until_prompt()
      File "/usr/lib/python2.7/site-packages/netmiko/base_connection.py", line 605, in read_until_prompt
        return self._read_channel_expect(*args, **kwargs)
      File "/usr/lib/python2.7/site-packages/netmiko/base_connection.py", line 543, in _read_channel_expect
        "Timed-out reading channel, data not available."
    netmiko.ssh_exception.NetMikoTimeoutException: Timed-out reading channel, data not available.

     

    [root@bogon good]# vi huawei.248.py
      1 from netmiko import ConnectHandler
      2 import logging
      3 logging.basicConfig(filename="test.log", level=logging.DEBUG)xxx
      4 huawei = {'device_type': 'huawei', 'ip': '10.10.17.248', 'username': 'root@default', 'password': ' xxxxx',     'port': 23}
      5 net_connect = ConnectHandler(**huawei)
      6 sshConfirm = net_connect.find_prompt()
      7 print('login ' + sshConfirm)
      8 commands = ['dis version']
      9 output = net_connect.send_config_set(commands)
     10 print(output)
     11 net_connect.disconnect()
    
    huawei.248.py [+]                                                                               4,119-120      All
    "huawei.248.py" 11L, 453C written
    [root@bogon good]# python  huawei.248.py 
    Traceback (most recent call last):
      File "huawei.248.py", line 5, in <module>
        net_connect = ConnectHandler(**huawei)
      File "/usr/lib/python2.7/site-packages/netmiko/ssh_dispatcher.py", line 246, in ConnectHandler
        return ConnectionClass(*args, **kwargs)
      File "/usr/lib/python2.7/site-packages/netmiko/base_connection.py", line 317, in __init__
        self._open()
      File "/usr/lib/python2.7/site-packages/netmiko/base_connection.py", line 322, in _open
        self.establish_connection()
      File "/usr/lib/python2.7/site-packages/netmiko/base_connection.py", line 884, in establish_connection
        self.remote_conn_pre.connect(**ssh_connect_params)
      File "/usr/lib/python2.7/site-packages/paramiko/client.py", line 406, in connect
        t.start_client(timeout=timeout)
      File "/usr/lib/python2.7/site-packages/paramiko/transport.py", line 660, in start_client
        raise e
    paramiko.ssh_exception.SSHException: Error reading SSH protocol banner'utf8' codec can't decode byte 0xff in position 0: invalid start byte
  • 相关阅读:
    CSS background API
    Vistual Studio 2019下载离线包与离线包更新
    flex布局属性速查表
    Vuex-核心概念-State 学习笔记
    前端环境搭配ESLint和Prettier
    Windows下VScode Scss开发环境配置
    Vue2.5开发去哪儿网App 从零基础入门到实战项目之6-1 Vue项目预热
    Webpack深入与实战 慕课网 免费 讲师qbaty 学习笔记
    Linux安装RabbitMQ
    docker-compose 搭建 kafka 集群
  • 原文地址:https://www.cnblogs.com/dream397/p/13207251.html
Copyright © 2020-2023  润新知