-
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
Netmiko dont detect mikrotik prompt but in session log it persist #3498
Comments
i tried adjusted command which if to execute it in terminal generate just single empty line
result if to use inside normal ssh session command "/ip/packing/print":
output log if to use code with netmiko and still generated Pattern not detected
last line without newline |
@jpVm5jYYRE1VIKL Try: output = net_connect.send_command(expect_string=r">", command_string='export') And see if that makes any difference (or not). |
Hi i tried it . And not got any changes ie still issue persist. But i can say more with quick and dirty just to be sure that is is possible :
and it is works quite good (but i not did shell activation) just used raw paramiko client. So i think it is something really wrong with function which expect prompt because on one of devices with another mikrotik version i got like this in session log.
Is it possible somehow to have own callback to catch lines to find moment when command execution finished ? |
Mikrotik's are weird devices from an SSH automation perspective (as you can see from the constant repainting of the line containing the command). You could try to enable Netmiko logging and post the log output here (to provide more information on why Netmiko is failing--as I don't see anything that is clearly wrong): Alternatively, you can use Netmiko's send_command() has these mechanisms built-in, but obviously we are running into an issue. |
jpVm5jYYRE1VIKL did you try |
i manually implemented(written on python) needed functionality using asyncssh and it works excellent. So most probably issue not in mikrotik. May be in paramiko lib itself |
@jpVm5jYYRE1VIKL Also did you try to increase read timeout by adding |
Well i don`t think that issue related to timeout . I have quite big network with hundreds CCR routers which are really fast and with fiber connections. In reality i think issue more related with bit weird terminal cli of mikrotik. For example they use dumb '\r' as end on line instead of normal linux '\n' and not even win '\r\n' combo. |
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)
If i look to session log .
i see at the end
last line without newline
The text was updated successfully, but these errors were encountered: