ktbyers / netmiko

Multi-vendor library to simplify Paramiko SSH connections to network devices
MIT License
3.59k stars 1.31k forks source link

HP Comware doesn't support a "terminal width" setting #1714

Closed shukimi closed 2 years ago

shukimi commented 4 years ago

hi, i am new to the whole using netmiko been learning it for a couple of days. read a lot. but failed with a timeout on an command from a command text list. tried global delay factor and delay factor on the specific command without success. i use comware and trying all on gns3. seems like long commands dont work well. i checked the premission - no problem. the issue is on command like: ntp-service authentication-keyid 4 authentication-mode md5 simple QWER-YUIOP snmp-agent usm-user v3 USER-user GROUP123 sim authentication-mode sha PRIVATE privacy-mode aes128 PUBLIC-public and more...

the issue works perfectely by adding : "fast_cli": True, why is it? what is fast cli?

version using: Python 3.8.1 Name: netmiko Version: 3.1.0 Name: paramiko Version: 2.7.1

any help will be appreciated, thanks

python-script.txt test.log config-comware.txt

ktbyers commented 4 years ago

Using fast_cli=True probably caused cmd_verify to be disabled (definitely some assumptions on my part here).

It looks like there was an issue with terminal width i.e. the length of the command caused cmd_verify to fail. It would be interesting to know if the problem exists on the Netmiko develop branch or not?

shukimi commented 4 years ago

thanks for the respond. is there other type of verification? is it recommenced to use "fast cli" to configure a switch ? can commands be ignored in "fast cli" or not be configured?

thanks

ktbyers commented 4 years ago

I wouldn't generally use fast_cli.

fast_cli emphasizes performance over reliability (and I usually value reliability over performance).

Yes, commands can get dropped in certain contexts (particularly if you send a large number of commands and fill up the input buffer). This would show up in the output, however.

The dropping of commands (especially config commands) is an important reason for the existence of cmd_verify.

It would be interesting to know if Comware and cmd_verify (not using fast_cli=True) works properly using the develop branch.

shukimi commented 4 years ago

how do i use the develop branch? is there a install guide? im using OS Ubuntu 64-bit-18.04.4.

thanks,

TanY0Y0 commented 4 years ago

its the screen width problem, it seems not support set width in ssh way, or its duo to gns3/OS version, use cmd_verify=False to ignore echo check

ktbyers commented 4 years ago

It doesn't look like to me that Comware has anyway of setting the terminal width (nor does it look like it honors the terminal width from shell).

Because of this I am going to disable cmd_verify globally for comware.

If anyone knows a way to set terminal width on Comware, let me know.

Thanks, Kirk

ktbyers commented 4 years ago

Fix is here (if someone wants to test it):

https://github.com/ktbyers/netmiko/pull/1763