Open iniagolov opened 3 months ago
That is not "ios_xr" i.e. your device_type is wrong.
Also disabling of output paging is not working and there are ANSI escape codes are in the output?
It is a bit unclear what the actual operating system of the catalyst 1300 is? You can try "cisco_ios", but you will need to figure out why terminal length 0
is not working.
Also you probably need to disable the output paging, from looking at the CLI manual for Cat 1300, it looks like `Example The following example dumps all output immediately after entering a show command.
terminal datadump
Also need to set:
net_connect.ansi_escape_codes = True
So your code should become:
from netmiko import ConnectHandler
import logging
logging.basicConfig(filename="test.log", level=logging.DEBUG)
logger = logging.getLogger("netmiko")
net_connect = ConnectHandler(
host="192.168.10.1",
username="username",
password="password",
device_type="cisco_ios", # Note change
secret="", port=22,
)
net_connect.send_command("terminal datadump", expect_string=r"#")
net_connect.ansi_escape_codes = True
# Then try your "show" command using the "send_command" method.
Let me know if this works and we can build a driver for this platform.
Reference to notes on Operating System for Catalyst 1200 (and assume 1300):
https://www.reddit.com/r/Cisco/comments/185xmg0/os_used_in_the_catalyst_1200/
Of course I would like you to create a driver for this platform, just tell me what I can help with.
Code:
from netmiko import ConnectHandler
import logging
logging.basicConfig(filename="test.log", level=logging.DEBUG)
logger = logging.getLogger("netmiko")
net_connect = ConnectHandler(host="192.168.10.1", username="username", password="password", device_type="cisco_ios", secret="", port=22, )
net_connect.send_command("terminal datadump", expect_string=r"#")
net_connect.ansi_escape_codes = True
net_connect.send_command("show ver")
net_connect.send_command("show interface status")
net_connect.disconnect()
Result
>>> net_connect.disconnect()
>>> net_connect = ConnectHandler(host="192.168.10.1", username="networkmanager", password="N@Man390erp", device_type="cisco_ios", secret="", port=22, )
>>> net_connect.send_command("terminal datadump", expect_string=r"#")
'\nciscoS1#'
>>> net_connect.ansi_escape_codes = True
>>> net_connect.send_command("show ver")
'\nActive-image: flash://system/images/image_c1300_4.1.3.36_official_key.bin\n Version: 4.1.3.36\n MD5 Digest: 90803a985c9110cef9aa4d576206b629\n Date: 19-May-2024\n Time: 08:17:26\nInactive-image: flash://system/images/_image_c1300_4.1.3.36_official_key.bin\n Version: 4.1.3.36\n MD5 Digest: 90803a985c9110cef9aa4d576206b629\n Date: 19-May-2024\n Time: 08:17:26\nciscoS1#'
>>>
>>> net_connect.send_command("show interface status")
'\n Flow Link Back Mdix\nPort Type Duplex Speed Neg ctrl State Pressure Mode\n-------- ------------ ------ ----- -------- ---- ----------- -------- -------\ngi1/0/1 1G-Copper Full 1000 Enabled Off Up Disabled Off \ngi1/0/2 1G-Copper -- -- -- -- Down -- -- \ngi1/0/3 1G-Copper -- -- -- -- Down -- -- \ngi1/0/4 1G-Copper -- -- -- -- Down -- -- \ngi1/0/5 1G-Copper -- -- -- -- Down -- -- \ngi1/0/6 1G-Copper -- -- -- -- Down -- -- \ngi1/0/7 1G-Copper -- -- -- -- Down -- -- \ngi1/0/8 1G-Copper -- -- -- -- Down -- -- \ngi1/0/9 1G-Copper -- -- -- -- Down -- -- \ngi1/0/10 1G-Copper -- -- -- -- Down -- -- \ngi1/0/11 1G-Copper -- -- -- -- Down -- -- \ngi1/0/12 1G-Copper -- -- -- -- Down -- -- \ngi1/0/13 1G-Copper Full 1000 Enabled Off Up Disabled Off \ngi1/0/14 1G-Copper Full 1000 Enabled Off Up Disabled Off \ngi1/0/15 1G-Copper -- -- -- -- Down -- -- \ngi1/0/16 1G-Copper Full 1000 Enabled Off Up Disabled Off \ngi1/0/17 1G-Copper -- -- -- -- Down -- -- \ngi1/0/18 1G-Copper -- -- -- -- Down -- -- \ngi1/0/19 1G-Copper -- -- -- -- Down -- -- \ngi1/0/20 1G-Copper -- -- -- -- Down -- -- \ngi1/0/21 1G-Copper -- -- -- -- Down -- -- \ngi1/0/22 1G-Copper -- -- -- -- Down -- -- \ngi1/0/23 1G-Copper Full 1000 Enabled Off Up Disabled On \ngi1/0/24 1G-Copper Full 1000 Enabled Off Up Disabled Off \nte1/0/1 10G-Fiber Full 10000 Disabled Off Up Disabled Off \nte1/0/2 10G-Fiber Full 10000 Disabled Off Up Disabled Off \ngi2/0/1 1G-Copper Full 1000 Enabled Off Up Disabled On \ngi2/0/2 1G-Copper -- -- -- -- Down -- -- \ngi2/0/3 1G-Copper -- -- -- -- Down -- -- \ngi2/0/4 1G-Copper -- -- -- -- Down -- -- \ngi2/0/5 1G-Copper -- -- -- -- Down -- -- \ngi2/0/6 1G-Copper -- -- -- -- Down -- -- \ngi2/0/7 1G-Copper -- -- -- -- Down -- -- \ngi2/0/8 1G-Copper -- -- -- -- Down -- -- \ngi2/0/9 1G-Copper -- -- -- -- Down -- -- \ngi2/0/10 1G-Copper -- -- -- -- Down -- -- \ngi2/0/11 1G-Copper -- -- -- -- Down -- -- \ngi2/0/12 1G-Copper Full 1000 Enabled Off Up Disabled Off \ngi2/0/13 1G-Copper -- -- -- -- Down -- -- \ngi2/0/14 1G-Copper -- -- -- -- Down -- -- \ngi2/0/15 1G-Copper -- -- -- -- Down -- -- \ngi2/0/16 1G-Copper Full 1000 Enabled Off Up Disabled Off \ngi2/0/17 1G-Copper -- -- -- -- Down -- -- \ngi2/0/18 1G-Copper Full 1000 Enabled Off Up Disabled Off \ngi2/0/19 1G-Copper -- -- -- -- Down -- -- \ngi2/0/20 1G-Copper -- -- -- -- Down -- -- \ngi2/0/21 1G-Copper -- -- -- -- Down -- -- \ngi2/0/22 1G-Copper -- -- -- -- Down -- -- \ngi2/0/23 1G-Copper Full 1000 Enabled Off Up Disabled Off \ngi2/0/24 1G-Copper -- -- -- -- Down -- -- \nte2/0/1 10G-Fiber Full 10000 Disabled Off Up Disabled Off \nte2/0/2 10G-Fiber Full 10000 Disabled Off Up Disabled Off \n\n Flow Link \nCh Type Duplex Speed Neg control State \n-------- ------- ------ ----- -------- ------- ----------- \nPo1 10G Full 10000 Enabled Off Up \nPo2 10G Full 10000 Enabled Off Up \nPo3 1G Full 1000 Enabled Off Up \nPo4 -- -- -- -- -- Not Present \nPo5 -- -- -- -- -- Not Present \nPo6 -- -- -- -- -- Not Present \nPo7 -- -- -- -- -- Not Present \nPo8 -- -- -- -- -- Not Present \nciscoS1#'
>>>
>>> net_connect.disconnect()
>>>
Debug result test.log
@iniagolov Did that all work properly from an end-user perspective?
>>> net_connect.send_command("show interface status")
'\n Flow Link Back Mdix\nPort Type Duplex Speed Neg ctrl State Pressure Mode\n-------- ------------ ------ ----- -------- ---- ----------- -------- -------\ngi1/0/1 1G-Copper Full 1000 Enabled Off Up Disabled Off \ngi1/0/2 1G-Copper -- -- -- -- Down -- -- \ngi1/0/3 1G-Copper -- -- -- -- Down -- -- \ngi1/0/4 1G-Copper -- -- -- -- Down -- -- \ngi1/0/5 1G-Copper -- -- -- -- Down -- -- \ngi1/0/6 1G-Copper -- -- -- -- Down -- -- \ngi1/0/7 1G-Copper -- -- -- -- Down -- -- \ngi1/0/8 1G-Copper -- -- -- -- Down -- -- \ngi1/0/9 1G-Copper -- -- -- -- Down -- -- \ngi1/0/10 1G-Copper -- -- -- -- Down -- -- \ngi1/0/11 1G-Copper -- -- -- -- Down -- -- \ngi1/0/12 1G-Copper -- -- -- -- Down -- -- \ngi1/0/13 1G-Copper Full 1000 Enabled Off Up Disabled Off \ngi1/0/14 1G-Copper Full 1000 Enabled Off Up Disabled Off \ngi1/0/15 1G-Copper -- -- -- -- Down -- -- \ngi1/0/16 1G-Copper Full 1000 Enabled Off Up Disabled Off \ngi1/0/17 1G-Copper -- -- -- -- Down -- -- \ngi1/0/18 1G-Copper -- -- -- -- Down -- -- \ngi1/0/19 1G-Copper -- -- -- -- Down -- -- \ngi1/0/20 1G-Copper -- -- -- -- Down -- -- \ngi1/0/21 1G-Copper -- -- -- -- Down -- -- \ngi1/0/22 1G-Copper -- -- -- -- Down -- -- \ngi1/0/23 1G-Copper Full 1000 Enabled Off Up Disabled On \ngi1/0/24 1G-Copper Full 1000 Enabled Off Up Disabled Off \nte1/0/1 10G-Fiber Full 10000 Disabled Off Up Disabled Off \nte1/0/2 10G-Fiber Full 10000 Disabled Off Up Disabled Off \ngi2/0/1 1G-Copper Full 1000 Enabled Off Up Disabled On \ngi2/0/2 1G-Copper -- -- -- -- Down -- -- \ngi2/0/3 1G-Copper -- -- -- -- Down -- -- \ngi2/0/4 1G-Copper -- -- -- -- Down -- -- \ngi2/0/5 1G-Copper -- -- -- -- Down -- -- \ngi2/0/6 1G-Copper -- -- -- -- Down -- -- \ngi2/0/7 1G-Copper -- -- -- -- Down -- -- \ngi2/0/8 1G-Copper -- -- -- -- Down -- -- \ngi2/0/9 1G-Copper -- -- -- -- Down -- -- \ngi2/0/10 1G-Copper -- -- -- -- Down -- -- \ngi2/0/11 1G-Copper -- -- -- -- Down -- -- \ngi2/0/12 1G-Copper Full 1000 Enabled Off Up Disabled Off \ngi2/0/13 1G-Copper -- -- -- -- Down -- -- \ngi2/0/14 1G-Copper -- -- -- -- Down -- -- \ngi2/0/15 1G-Copper -- -- -- -- Down -- -- \ngi2/0/16 1G-Copper Full 1000 Enabled Off Up Disabled Off \ngi2/0/17 1G-Copper -- -- -- -- Down -- -- \ngi2/0/18 1G-Copper Full 1000 Enabled Off Up Disabled Off \ngi2/0/19 1G-Copper -- -- -- -- Down -- -- \ngi2/0/20 1G-Copper -- -- -- -- Down -- -- \ngi2/0/21 1G-Copper -- -- -- -- Down -- -- \ngi2/0/22 1G-Copper -- -- -- -- Down -- -- \ngi2/0/23 1G-Copper Full 1000 Enabled Off Up Disabled Off \ngi2/0/24 1G-Copper -- -- -- -- Down -- -- \nte2/0/1 10G-Fiber Full 10000 Disabled Off Up Disabled Off \nte2/0/2 10G-Fiber Full 10000 Disabled Off Up Disabled Off \n\n Flow Link \nCh Type Duplex Speed Neg control State \n-------- ------- ------ ----- -------- ------- ----------- \nPo1 10G Full 10000 Enabled Off Up \nPo2 10G Full 10000 Enabled Off Up \nPo3 1G Full 1000 Enabled Off Up \nPo4 -- -- -- -- -- Not Present \nPo5 -- -- -- -- -- Not Present \nPo6 -- -- -- -- -- Not Present \nPo7 -- -- -- -- -- Not Present \nPo8 -- -- -- -- -- Not Present \nciscoS1#'
>>>
work
but this not work!
>>> net_connect.send_command("show interface status", use_textfsm=True)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/var/www/networkmanager.tss.bg/.venv/lib/python3.11/site-packages/netmiko/base_connection.py", line 111, in wrapper_decorator
return_val = func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/networkmanager.tss.bg/.venv/lib/python3.11/site-packages/netmiko/utilities.py", line 596, in wrapper_decorator
return func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/networkmanager.tss.bg/.venv/lib/python3.11/site-packages/netmiko/base_connection.py", line 1834, in send_command
return_val = structured_data_converter(
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/networkmanager.tss.bg/.venv/lib/python3.11/site-packages/netmiko/utilities.py", line 560, in structured_data_converter
structured_output_tfsm = get_structured_data_textfsm(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/networkmanager.tss.bg/.venv/lib/python3.11/site-packages/netmiko/utilities.py", line 380, in get_structured_data_textfsm
output = _textfsm_parse(textfsm_obj, raw_output, attrs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/networkmanager.tss.bg/.venv/lib/python3.11/site-packages/netmiko/utilities.py", line 344, in _textfsm_parse
tfsm_parse(raw_output, attrs)
File "/var/www/networkmanager.tss.bg/.venv/lib/python3.11/site-packages/textfsm/clitable.py", line 282, in ParseCmd
self.table = self._ParseCmdItem(self.raw, template_file=template_files[0])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/networkmanager.tss.bg/.venv/lib/python3.11/site-packages/textfsm/clitable.py", line 315, in _ParseCmdItem
for record in fsm.ParseText(cmd_input):
^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/networkmanager.tss.bg/.venv/lib/python3.11/site-packages/textfsm/parser.py", line 895, in ParseText
self._CheckLine(line)
File "/var/www/networkmanager.tss.bg/.venv/lib/python3.11/site-packages/textfsm/parser.py", line 944, in _CheckLine
if self._Operations(rule, line):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/networkmanager.tss.bg/.venv/lib/python3.11/site-packages/textfsm/parser.py", line 1024, in _Operations
raise TextFSMError('State Error raised. Rule Line: %s. Input Line: %s'
textfsm.parser.TextFSMError: State Error raised. Rule Line: 17. Input Line: Flow Link Back Mdix
>>>
Debug
DEBUG:netmiko:read_channel: 08-Aug-2024 23:11:35 %COPY-I-FILECPY: Files Copy - source URL running-config destination URL flash://system/configuration/startup-config
08-Aug-2024 23:11:40 %COPY-N-TRAP: The copy operation was completed successfully
DEBUG:netmiko:Clear buffer detects data in the channel
DEBUG:netmiko:read_channel:
DEBUG:netmiko:write_channel: b'\n'
DEBUG:netmiko:read_channel:
DEBUG:netmiko:write_channel: b'\n'
DEBUG:netmiko:read_channel:
DEBUG:netmiko:write_channel: b'\n'
DEBUG:netmiko:read_channel:
DEBUG:netmiko:write_channel: b'\n'
DEBUG:netmiko:read_channel:
ciscoS1#
DEBUG:netmiko:read_channel:
DEBUG:netmiko:[find_prompt()]: prompt is ciscoS1#
DEBUG:netmiko:write_channel: b'show interface status\n'
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel:
ciscoS1#
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel:
ciscoS1#
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel:
ciscoS1#
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel: show inter
DEBUG:netmiko:read_channel: face status
DEBUG:netmiko:Pattern found: (show\ interface\ status)
ciscoS1#
ciscoS1#
ciscoS1#show interface status
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel:
Flow Link Back Mdix
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel:
Port Type Duplex Speed Neg ctrl State Pressure Mode
-------- ------------ ------ ----- -------- ---- ----------- -------- -------
gi1/0/1 1G-Copper Full 1000 Enabled Off Up Disabled Off
gi1/0/2 1G-Copper -- -- -- -- Down -- --
gi1/0/3 1G-Copper -- -- -- -- Down -- --
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel: gi1/0/4 1G-Copper -- -- -- -- Down -- --
gi1/0/5 1G-Copper -- -- -- -- Down -- --
gi1/0/6 1G-Copper -- -- -- -- Down -- --
gi1/0/7 1G-Copper -- -- -- -- Down -- --
gi1/0/8 1G-Copper -- -- -- -- Down -- --
gi1/0/9 1G-Copper -- -- -- -- Down -- --
gi1/0/10 1G-Copper -- -- -- -- Down -- --
gi1/0/11 1G-Copper -- -- -- -- Down -- --
gi1/0/12 1G-Copper -- -- -- -- Down -- --
gi1/0/13 1G-Copper Full 1000 Enabled Off Up Disabled Off
DEBUG:netmiko:read_channel:
gi1/0/14 1G-Copper Full 1000 Enabled Off Up Disabled Off
DEBUG:netmiko:read_channel:
gi1/0/15 1G-Copper -- -- -- -- Down -- --
gi1/0/16 1G-Copper Full 1000 Enabled Off Up Disabled Off
DEBUG:netmiko:read_channel:
gi1/0/17 1G-Copper -- -- -- -- Down -- --
DEBUG:netmiko:read_channel: gi1/0/18 1G-Copper -- -- -- -- Down -- --
gi1/0/19 1G-Copper -- -- -- -- Down -- --
DEBUG:netmiko:read_channel:
gi1/0/20 1G-Copper -- -- -- -- Down -- --
gi1/0/21 1G-Copper -- -- -- -- Down -- --
DEBUG:netmiko:read_channel:
gi1/0/22 1G-Copper -- -- -- -- Down -- --
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel:
gi1/0/23 1G-Copper Full 1000 Enabled Off Up Disabled On
gi1/0/24 1G-Copper Full 1000 Enabled Off Up Disabled Off
te1/0/1 10G-Fiber Full 10000 Disabled Off Up Disabled Off
DEBUG:netmiko:read_channel: te1/0/2 10G-Fiber Full 10000 Disabled Off Up Disabled Off
gi2/0/1 1G-Copper Full 1000 Enabled Off Up Disabled On
DEBUG:netmiko:read_channel: gi2/0/2 1G-Copper -- -- -- -- Down -- --
DEBUG:netmiko:read_channel: gi2/0/3 1G-Copper -- -- -- -- Down -- --
DEBUG:netmiko:read_channel: gi2/0/4 1G-Copper -- -- -- -- Down -- --
gi2/0/5 1G-Copper -- -- -- -- Down -- --
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel: gi2/0/6 1G-Copper -- -- -- -- Down -- --
gi2/0/7 1G-Copper -- -- -- -- Down -- --
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel: gi2/0/8 1G-Copper -- -- -- -- Down -- --
gi2/0/9 1G-Copper -- -- -- -- Down -- --
gi2/0/10 1G-Copper -- -- -- -- Down -- --
gi2/0/11 1G-Copper -- -- -- -- Down -- --
gi2/0/12 1G-Copper Full 1000 Enabled Off Up Disabled Off
gi2/0/13 1G-Copper -- -- -- -- Down -- --
gi2/0/14 1G-Copper -- -- -- -- Down -- --
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel: gi2/0/15 1G-Copper -- -- -- -- Down -- --
gi2/0/16 1G-Copper Full 1000 Enabled Off Up Disabled Off
gi2/0/17 1G-Copper -- -- -- -- Down -- --
gi2/0/18 1G-Copper Full 1000 Enabled Off Up Disabled Off
DEBUG:netmiko:read_channel:
gi2/0/19 1G-Copper -- -- -- -- Down -- --
DEBUG:netmiko:read_channel: gi2/0/20 1G-Copper -- -- -- -- Down -- --
gi2/0/21 1G-Copper -- -- -- -- Down -- --
DEBUG:netmiko:read_channel:
gi2/0/22 1G-Copper -- -- -- -- Down -- --
DEBUG:netmiko:read_channel:
gi2/0/23 1G-Copper Full 1000 Enabled Off Up Disabled Off
DEBUG:netmiko:read_channel:
gi2/0/24 1G-Copper -- -- -- -- Down -- --
DEBUG:netmiko:read_channel: te2/0/1 10G-Fiber Full 10000 Disabled Off Up Disabled Off
DEBUG:netmiko:read_channel: te2/0/2 10G-Fiber Full 10000 Disabled Off Up Disabled Off
DEBUG:netmiko:read_channel:
Flow Link
Ch Type Duplex Speed Neg control State
-------- ------- ------ ----- -------- ------- -----------
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel: Po1 10G Full 10000 Enabled Off Up
DEBUG:netmiko:read_channel:
Po2 10G Full 10000 Enabled Off Up
DEBUG:netmiko:read_channel:
Po3 1G Full 1000 Enabled Off Up
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel:
Po4 -- -- -- -- -- Not Present
Po5 -- -- -- -- -- Not Present
Po6 -- -- -- -- -- Not Present
Po7 -- -- -- -- -- Not Present
Po8 -- -- -- -- -- Not Present
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel:
DEBUG:netmiko:read_channel:
ciscoS1#
That doesn't work either
from netmiko import ConnectHandler
import logging
logging.basicConfig(filename="test.log", level=logging.DEBUG)
logger = logging.getLogger("netmiko")
net_connect = ConnectHandler(host="192.168.10.1", username="networkmanager", password="N@Man390erp", device_type="cisco_ios", secret="", port=22, )
net_connect.send_command("terminal datadump", expect_string=r"#")
net_connect.ansi_escape_codes = True
net_connect.send_config_set('int gi1/0/3,no shutdown')
net_connect.disconnect()
Result
>>> net_connect.send_config_set('int gi1/0/3,no shutdown')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/var/www/networkmanager.tss.bg/.venv/lib/python3.11/site-packages/netmiko/base_connection.py", line 111, in wrapper_decorator
return_val = func(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/networkmanager.tss.bg/.venv/lib/python3.11/site-packages/netmiko/base_connection.py", line 2289, in send_config_set
output += self.config_mode()
^^^^^^^^^^^^^^^^^^
File "/var/www/networkmanager.tss.bg/.venv/lib/python3.11/site-packages/netmiko/cisco_base_connection.py", line 53, in config_mode
return super().config_mode(
^^^^^^^^^^^^^^^^^^^^
File "/var/www/networkmanager.tss.bg/.venv/lib/python3.11/site-packages/netmiko/base_connection.py", line 2124, in config_mode
output += self.read_until_prompt(read_entire_line=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/networkmanager.tss.bg/.venv/lib/python3.11/site-packages/netmiko/base_connection.py", line 839, in read_until_prompt
return self.read_until_pattern(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/www/networkmanager.tss.bg/.venv/lib/python3.11/site-packages/netmiko/base_connection.py", line 748, in read_until_pattern
raise ReadTimeout(msg)
netmiko.exceptions.ReadTimeout:
Pattern not detected: '\x1b\\[KciscoS1.*' in output.
Things you might try to fix this:
1. Adjust the regex pattern to better identify the terminating string. Note, in
many situations the pattern is automatically based on the network device's prompt.
2. Increase the read_timeout to a larger value.
You can also look at the Netmiko session_log or debug log for more information.
>>>
Debug test.log
TextFSM likely won't wors as Catalyst 1300 is not really IOS so parsing will fail.
This is not valid syntactically:
net_connect.send_config_set('int gi1/0/3,no shutdown')
You need to provide a list of commands i.e.
cmds = ['int gi1/0/3', 'no shutdown']
net_connect.send_config_set(cmds)
Netmiko version
Netmiko device_type (if relevant to the issue)
======
Code
Error Traceback
======
Code
Error Traceback
======
Litle info from switch