Closed Mr-Jayden closed 8 months ago
@Mr-Jayden Do you get an exception stack trace when this command doesn't work?
conn.send_command("display dev man")
I open the session.log, not any exception. When I don't make any changes, the output I get is the host name. I use send_command_timings to get the full output, but the first output contains "screen-length disable" + "hostname" + "correct output". I think the command "screen-length disable" was executed when the connection was established. I don't know why it appears in the command I executed.
Of course, this abnormal output does not affect my use, I just need to remove the content before "display version" on the line. I just want to know why? thank you.
I would probably try:
conn.send_command("display dev man", expect_string=r"\]")
Either that or put in a time.sleep(2)
before you do your send_command to clear out data that hasn't been read.
time.sleep(2)
conn.clear_buffer()
conn.send_command("display dev man", expect_string=r"\]")
It looks like Netmiko is getting ahead of the device (i.e. Netmiko is ahead of where the device is just after login and this is causing some problems).
I solved my problem through the method you gave me, thank you very much.
Hi, I sent the ‘display dev man’ command through the send_command method, but only half of the message was returned. When I increase the value of loop_delay in line 1709 of 'base_connection.py', the problem is fixed. Is there any other way I can get a full return?
Netmiko version
netmiko==4.3.0 device_type=h3c-s5560-56c-hi login param: auth = { 'device_type': 'hp_comware', 'host': "", 'username': "", 'password': "", 'port': 22, 'session_log': 'session.log' }
Steps to Reproduce the Issue
Error Traceback
(Paste the complete traceback of the exception between quotes below)
"Power 2:" followed by some content but not returned
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)