Closed ghost closed 3 years ago
I don't see anything at all from your terminal server? Looking at the log there is never a read_channel() where you actually get any data besides white space?
I don't see anything at all from your terminal server? Looking at the log there is never a read_channel() where you actually get any data besides white space?
Hi Kirk,
Correct, the first connection is not getting any data from the console_server. I'm not quite sure what else I need to add after the ConnectHandler(**console_server)
I've tried adding extra read and write_channel()
statements at the top but it still can't find the prompt. I can see that it tries to make a connection, but it cannot read anything from the console_server.
Edit: I figured it out thanks to eoprede on https://github.com/ktbyers/netmiko/issues/1062
All I needed to add was a net_connect.write_channel("\r")
after net_connect = ConnectHandler(**console_server)
to get some kind of response back by entering a blank line in the terminal server.
My setup is similar to the question described here: https://stackoverflow.com/questions/55136892/python-connect-to-network-device-through-terminal-using-password
But, unfortunately after many different attempts I'm still getting a
ValueError(f"Unable to find prompt: {prompt}")
When I login to putty with my personal username and password, then run the python script, it enters the device username and password correctly and I get access to the device, but without logging in with my credentials to putty first I get the prompt not found. Not sure why.
Here's the code:
Heres the log: