-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Mikrotik version > 6.48 = 'export' command incomplete #3405
Comments
I would probably try on your send_command() statement to make it. import re
# rest of your code
output = mikrotik_connection.send_command(
f'export',
cmd_verify=False,
expect_string=re.escape("[user@RTR-FW-NNN-NNN-01] >")
) Does that help? |
Hi, It still didn't work. I can't use a fixed expect_string, it must be a regex because the user and hostname will be variable in another complete script, that has a loop (for) to catch the running-config (export) from a list of devices. |
Hi, Additional information:
the amount of lines captured is not fixed, this time only 5 lines were captured before the command
no visible errors generated |
I've experienced a similar issue with my MikroTik. The problem seems to be that the router might repaint the input string after a command has been entered. When it causes the router captures the prompt string at the beginning of command execution, and then closes the connection. |
@Tonygratta and @prtomasi I wonder if we can do this?
In other words, configure the Mikrotik to be a dumb terminal so that a lot of the very problematic Mikrotik terminal behavior is bypassed. Can anyone try this? |
Related to this...it seems like we should be setting the
Once again does someone want to test this? Modified like would be: self.username += "+cet511w4098h" |
I've tried this method (adding "e" to the '_modify_connection_params' function), but it doesn't seem to be working. The router's output log slightly differs from the default, so I think the router has really been switched to a dumb mode. However, in both cases, the export doesn't work on my device. |
My router doesn't accept this command:
Do you have any documentation related to this command? I couldn't find anything. |
Hi, The Mikrotik Help has some information about the parameters I tried to change When using How do I insert |
@Tonygratta I should have double checked it. It looks like ChatGPT made it up. But we have that "e" option...which looks like it is not working anyways. |
@prtomasi Easiest way is to modify the one line in the Netmiko code, but @Tonygratta already tested it and it didn't work :-( |
The more tests, the better.
|
Hello, This code seems to be working:
It seems now netmiko only stops when it sees the prompt I also added the
|
Great! |
Tried adding "e" to the login string by modifying this line. Although it helps for short export statements (e.g.
|
@amyasnikov Did you try |
Hi, I think this issue is solved. There was no need for me to change default username parameters in
|
@Tonygratta it does help, but still not perfect.
@prtomasi in my opinion, the issue can't be considered solved unless plain |
We already have pull request #3467 based on mentioned solving but it needs more testing.
That is unusual. There should be none of them at all because netmiko filters out the prompt in the |
@Tonygratta I've found out it's "e" added to the username is causing these excessive prompts to appear in
With "e" previously added by me to the username this code causes prompts at the end of the output. Without this "e" everything works fine. |
Description of Issue/Question
Note: Please check https://guides.github.com/features/mastering-markdown/
to see how to properly format your request.
Setup
Netmiko version
(Paste verbatim output from
pip freeze | grep netmiko
between quotes below)Netmiko device_type (if relevant to the issue)
(Paste
device_type
between quotes below)Steps to Reproduce the Issue
Error Traceback
(Paste the complete traceback of the exception between quotes below)
Relevant Python code
(Please try to essentialize your Python code to the minimum code needed to reproduce the issue)
(Paste the code between the quotes below)
Test
I noticed netmiko is breaking the output of 'export' command when the Mikrotik RouterOS version is > 6.48
The following was tested with 6.49.8 version
# mar/19/2024 11:25:34 by RouterOS 6.49.8
With the python code above, only 27 lines (from a total of 275 lines) were captured by netmiko, no errors were generated
When I use PuTTY to run 'export' command in the same device, the output is complete and has 275 lines
line 278 --> prompt:
I asked for help at Mikrotik Forum, but I was ignored:
https://forum.mikrotik.com/viewtopic.php?t=205175
The text was updated successfully, but these errors were encountered: