Closed mirceaulinic closed 7 years ago
I think the problem is actually after establishing: it executes: dir
.
But the result of this command is not as expected:
vpn-sfo01# dir
Directory of disk0:/
11 drwx 4096 07:01:42 Apr 21 2016 log
22 drwx 4096 20:57:38 Jul 08 2014 crypto_archive
23 drwx 4096 09:16:20 Jun 11 2014 coredumpinfo
158 -rwx 38191104 09:18:26 Jun 11 2014 asa912-smp-k8.bin
159 -rwx 18097844 09:19:54 Jun 11 2014 asdm-713.bin
... many other files ...
175 -rwx 38676 09:25:52 Dec 04 2015 20151204.conf
176 -rwx 12131504 14:01:06 Oct 07 2015 anyconnect-linux-3.1.11004-k9.pkg
<--- More --->
My understanding is that the <--- More --->
block is not handled under the send_command
method in netmiko's BaseConnection
class.
Probably in netmiko should send terminal pager 0
before anything else. What do you think @ktbyers?
An ASA? I don't think it's even supported. ASA doesn't run IOS, does it? Haven't seen one of those since version 7.
@dbarrosop According to the netmiko's readme, ASA is in the list of "Regularly tested"
Yeah, but that's just transport. napalm-ios
might be doing something IOS specific when opening the connection or the way configuration is loaded might be completely different. Honestly, I don't know : )
I am not sure either, but they are all using netmiko and it's just scraping the CLI at the end of the day. There may be differences in terms of commands excuted inside the napalm's methods - I don't know, it is the very first time when I try to use these boxes :D
Yes, ASA does not run Cisco IOS so Netmiko supports ASA, but napalm-ios does not support the ASA.
If you want to use Netmiko on an ASA, you need to use the ''cisco_asa' device_type.
Note, ASA does not have any "configure replace" operation and I would expect many/most of the getters would not work.
You could try a proof-of-concept on the ASA (and see what happens) if you replace the device_type argument to the ConnectHandler in the NAPALM with 'cisco_asa'.
Thanks for clarifying this @ktbyers!
Would make sense to you to have an optional argument in napalm-ios to specify the device type?
I would hack it locally to test first, I agree with @ktbyers in that most of the code is probably not gonna work with ASA so a napalm-asa
might be needed.
Oh right
I would expect many/most of the getters would not work
I did not see the "not"
@dbarrosop Yes, I haven't seen a reasonable way to achieve the NAPALM config operations (particularly replace). I know Patrick Ogenstad did some work on newer ASA OS, but I don't think I ever saw a solution that looked reasonable.
get_ntp_stats
and ping
are the only methods that worked :)
I see that it fails when executing the commands:
>>> e.get_interfaces()
executing: show ip interface brief
received:
received: show ip interface brief
^
ERROR: % Invalid input detected at '^' marker.
I will check if the getters would work if we'd use the appropriate command.
I will check if the getters would work if we'd use the appropriate command.
Nope :)
Closing this issue, apologise for the false alarm. FTM hacking the local napalm-ios version to use the cisco_asa parameter is enough for what I need.
Thanks for your help @dbarrosop and @ktbyers!
Yes, ASA is a pretty different beast from IOS so even commands for getters would probably/possibly be different (in addition to the output).
Description of Issue
I'm trying to open the connection with a Cisco ASA device.
napalm-ios version
netmiko version
IOS version and platform details
Error Traceback
Looks like it does not like a hostname containing hyphen?
Also, it would probably be good in the
close
method to check if the connection has been established before trying to close: