Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Netgear model: Does not detect end of configuration file #1100
It seems part of #920 is still unsolved.
I am seeing the exact same issue even with the fixed code. After running "show running-config", the prompt is returned at the end, but it seems that it is not matched correctly. Instead I get a timeout like this:
My code is stock except for a small change to the prompt regex as per PR #1099
Do you have the actual session log to the device? Does it drop to another prompt or is it asking a question like in the original report showed?
The session logs can be collected with setting
You will then find the session logs in a
For reference - what model/version of software is the device?
Yes, I have the actual session log. The actual configuration is sensitive and I don't want to post it here, but here is an abbreviated version with the actual config data excluded:
Also here is a hex dump of the very end of it, to exclude any possible non-printing characters:
Here is the device info:
Also, here's the stdout with the global debug set to true:
Notice how it says "Running pre_logout commands"? This tells me what it happening is that it is detecting the end prompt, but then the pre_logout command does... nothing... and then it times out waiting for something to happen.
OK, I've done some more investigation, and I think I'm getting closer to an answer.
The root cause seems to be that "falling off the edge" of an SSH session and a telnet session are actually handled differently, so it's failing for SSH but actually working for telnet!
For SSH, if there's a time out waiting for nothing to happen, it throws an error.
However, for telnet, there is no such treatment. See the below logs, first you'll see a failed attempt using ssh and a successful attempt using telnet.
See the disconnect methods of the telnet and ssh classes and the disconnect_cli method in cli.rb
Therefore, I think that while #923 fixed telnet (by adding checks for telnet login prompts etc) it also broke SSH by no longer explicitly quitting any more.
I think the real fix needs to happen at either the ssh or telnet module to make them act consistently. I'd submit a PR but my Ruby isn't quite strong enough and I'm sure I'd end up breaking more stuff than fixed.