07-01-2019 09:12 AM
I have a project coming up to do some DHCP helper updates enterprise wide. I was hoping to use pyATS to confirm the changes. I started with this simple yaml file in my lab. I get a failed to connect even though the log shows it connecting. I think I'm missing something simple. I can't really come up with a simpler test. The yaml file is attached.
Test device is a Catalyst 3560. I can successfully login with the credentials and have priv 15 access.
Command:
genie learn all -v -v -v --testbed-file example.yaml
loading yaml file example.yaml
Learning '['acl', 'arp', 'bgp', 'dot1x', 'eigrp', 'fdb', 'hsrp', 'igmp', 'interface', 'lag', 'lisp', 'lldp', 'mcast', 'mld', 'msdp', 'nd', 'ntp', 'ospf', 'pim', 'platform', 'prefix_list', 'rip', 'route_policy', 'routing', 'static_routing', 'stp', 'vlan', 'vrf', 'vxlan', 'config']' on devices '['sw1']'
failed to connect to sw1
Log:
[2019-07-01 10:50:25,016] +++ sw1 logfile ./connection_sw1.txt +++
[2019-07-01 10:50:25,016] +++ Unicon plugin ios +++
Trying 192.168.1.157...
[2019-07-01 10:50:25,023] +++ connection to spawn: telnet 192.168.1.157, id: 140148915360768 +++
[2019-07-01 10:50:25,023] connection to sw1
Connected to 192.168.1.157.
Escape character is '^]'.
User Access Verification
Username: cisco
Password:
SW1#
07-02-2019 12:30 AM
Hi there,
I've not had a chance to test pyATS yet, but I'm going to take a wild guess...
The device name (or maybe the alias) probably has to match the hostname shown on the CLI prompt. This is probably a fail safe to verify you have connected to the device you think it is. I'd suggest changing your yaml file to:
testbed: name: genie tacacs: username: "cisco" passwords: tacacs: "cisco" enable: "cisco" line: "cisco" devices: SW1: alias: SW1 ....<etc>....
cheers,
Seb.
07-18-2019 04:17 AM
I had the same problem but thanks to @Seb Rupik hint the connection to devices is now working without a problem
Thank you again @Seb Rupik
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide