Skip to content
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

my script using netmiko works fine on linux server in Lab, but not working remotely from my laptop through VPN #2932

Open
linfeng16 opened this issue Sep 4, 2022 · 1 comment

Comments

@linfeng16
Copy link

The target devices is hp_comware device, I run it from the linux machine(ubuntu) in the lab where the target device resides, it worked perfectly, but when I run the same script remotely from my MacBook through a VPN , the ssh connection ok, but the output from the device took long time, caused read timeout, even after I changed timeout to 100 secs, still not working, I thought may be network too slow, I tried ssh to the device from my MacBook, and run the same CLI commands, it responded right away, looks like not much delay, why with send_comand() the output take long time to get the output from the device? any ideas?

here's part of my script

with open(file_name, 'w') as f:
    for cmd in cmd_list:
        f.write(net_connect.send_command(cmd))
    f.close()

the cmd_list:
"display irf topology",
"display irf link",
"display irf configuration",
"display irf-port load-sharing mode",
"display mad verbose"

here's sample of the output when it works on the linux server:
==============================display irf topology==============================
Topology Info

           IRF-Port1                IRF-Port2          

MemberID Link neighbor Link neighbor Belong To
1 DIS --- DIS --- 00e0-fc0f-8c02

================================display irf link================================
Member 1
IRF Port Interface Status
1 disable --
2 disable --

===========================display irf configuration============================
MemberID NewID IRF-Port1 IRF-Port2
1 1 disable disable

=======================display irf-port load-sharing mode=======================
irf-port Load-Sharing Mode:
Layer 2 traffic: packet type-based sharing
Layer 3 traffic: packet type-based sharing

==============================display mad verbose===============================
Multi-active recovery state: No
Excluded ports (user-configured):
Excluded ports (system-configured):
MAD ARP disabled.
MAD ND disabled.
MAD LACP disabled.
MAD BFD disabled.

thanks
Feng

@ktbyers
Copy link
Owner

ktbyers commented Sep 8, 2022

How about increasing the read_timeout here?

        f.write(net_connect.send_command(cmd, read_timeout=100))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants