-
Notifications
You must be signed in to change notification settings - Fork 926
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
Netgear model: Does not detect end of configuration file #1100
Comments
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 oxidized/lib/oxidized/input/cli.rb Lines 30 to 33 in b7f8236
oxidized/lib/oxidized/input/ssh.rb Lines 88 to 96 in b7f8236
oxidized/lib/oxidized/input/telnet.rb Lines 60 to 66 in 0b5af45
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. |
Thanks for all of the info. Unfortunately I don't have the answer, maybe someone else will help out. |
We were seeing SSH logins to Netgear switches fail with the timeout as detailed above. I've put back the two I'm afraid that this is just a report that that's the regression for SSH users and a workaround, not the real fix. |
I can confirm that putting the |
This makes sense: I am only using telnet to Netgear devices. (The smaller devices only support telnet not ssh. With some larger devices I had problems with certain models crashing after a few months. In those cases I was also checking the SSH port with Nagios every 5 minutes. That was a few years ago; it's possible it has been fixed since then) |
It seems part of #920 is still unsolved.
@candlerb mentioned:
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
The text was updated successfully, but these errors were encountered: