sshuangliu / auto_config_get

2 stars 0 forks source link

line 592, in wrapper_decorator return func(self, *args, **kwargs) #2

Open yangshulin0017 opened 1 year ago

yangshulin0017 commented 1 year ago

你好,跑了一个H3C设备,只得到了一个dir的文件,然后就报了下面这个错误,能帮忙看下,大概是哪里的问题吗 截图_20221130181659

C:\Users\Administrator\AppData\Local\Programs\Python\Python38\python.exe "D:\360Downloads\auto_config_get-master\config_get v0.1.py"

Thread-1: 0%| | 0/24 [00:00<?, ?it/s]

Thread-2: 0%| | 0/24 [00:00<?, ?it/s] Thread-1: 4%|██▎ | 1/24 [00:00<00:04, 5.14it/s]

Thread-2: 4%|██▎ | 1/24 [00:00<00:04, 5.40it/s]

                                                                                                Exception in thread Thread-1:

Traceback (most recent call last): File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\threading.py", line 932, in _bootstrap_inner self.run() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\threading.py", line 870, in run self._target(*self._args, *self._kwargs) File "D:\360Downloads\auto_config_get-master\config_get v0.1.py", line 50, in devices_conn output = net_connect.send_command(command.strip()) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\site-packages\netmiko\utilities.py", line 592, in wrapper_decorator return func(self, args, **kwargs) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\site-packages\netmiko\base_connection.py", line 1721, in send_command raise ReadTimeout(msg) netmiko.exceptions.ReadTimeout: Pattern not detected: '<SW\-CTC>' in output.

Things you might try to fix this:

  1. Explicitly set your pattern using the expect_string argument.
  2. Increase the read_timeout to a larger value.

You can also look at the Netmiko session_log or debug log for more information.

Exception in thread Thread-2: Traceback (most recent call last): File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\threading.py", line 932, in _bootstrap_inner self.run() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\threading.py", line 870, in run self._target(*self._args, *self._kwargs) File "D:\360Downloads\auto_config_get-master\config_get v0.1.py", line 50, in devices_conn output = net_connect.send_command(command.strip()) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\site-packages\netmiko\utilities.py", line 592, in wrapper_decorator return func(self, args, **kwargs) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python38\lib\site-packages\netmiko\base_connection.py", line 1721, in send_command raise ReadTimeout(msg) netmiko.exceptions.ReadTimeout: Pattern not detected: '<SW\-CNC>' in output.

Things you might try to fix this:

  1. Explicitly set your pattern using the expect_string argument.
  2. Increase the read_timeout to a larger value.

You can also look at the Netmiko session_log or debug log for more information.

sshuangliu commented 1 year ago

terminal length 0
命令集里面最前面加个这试试