Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Fortinet [Netmiko Login] #12

Open
evilmonkey19 opened this issue May 11, 2024 · 0 comments
Open

Issue with Fortinet [Netmiko Login] #12

evilmonkey19 opened this issue May 11, 2024 · 0 comments

Comments

@evilmonkey19
Copy link
Contributor

Netmiko keeps waiting for the following output during the connection establishment:

Traceback (most recent call last):
  File ".../testing_netmiko.py", line 17, in <module>
    with ConnectHandler(**credentials) as conn:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../versions/fakenos-3.11/lib/python3.11/site-packages/netmiko/ssh_dispatcher.py", line 399, in ConnectHandler
    return ConnectionClass(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../versions/fakenos-3.11/lib/python3.11/site-packages/netmiko/base_connection.py", line 488, in __init__
    self._open()
  File ".../versions/fakenos-3.11/lib/python3.11/site-packages/netmiko/base_connection.py", line 494, in _open
    self._try_session_preparation()
  File ".../versions/fakenos-3.11/lib/python3.11/site-packages/netmiko/fortinet/fortinet_ssh.py", line 24, in _try_session_preparation
    super()._try_session_preparation(force_data=force_data)
  File ".../versions/fakenos-3.11/lib/python3.11/site-packages/netmiko/base_connection.py", line 988, in _try_session_preparation
    self.session_preparation()
  File ".../versions/fakenos-3.11/lib/python3.11/site-packages/netmiko/fortinet/fortinet_ssh.py", line 29, in session_preparation
    data = self._test_channel_read(pattern=f"to accept|{self.prompt_pattern}")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../versions/fakenos-3.11/lib/python3.11/site-packages/netmiko/base_connection.py", line 1235, in _test_channel_read
    return self.read_until_pattern(pattern=pattern, read_timeout=20)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File ".../versions/fakenos-3.11/lib/python3.11/site-packages/netmiko/base_connection.py", line 746, in read_until_pattern
    raise ReadTimeout(msg)
netmiko.exceptions.ReadTimeout: 

Pattern not detected: 'to accept|[#$]' 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.

Please, can someone provide the output when doing starting the session in Fortinet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant