Closed murrad01 closed 5 years ago
Did you follow the step in this article for setting it up? https://pynet.twb-tech.com/blog/automation/netmiko-textfsm.html
Did you put the templates in your home directory or set an environment variable for the location of the templates? Typically, when you get unstructured data, it is due to it not being able to find the templates.
I can test this at work as well, but figured I'd at least have you check some of the basics prior to that.
Yes, the templates are in my home directory. Other templates are working fine.
Thanks!
On Wed, Jul 25, 2018 at 7:19 AM, FragmentedPacket notifications@github.com wrote:
Did you follow the step in this article for setting it up? https://pynet.twb-tech.com/blog/automation/netmiko-textfsm.html
Did you put the templates in your home directory or set an environment variable for the location of the templates? Typically, when you get unstructured data, it is due to it not being able to find the templates.
I can test this at work as well, but figured I'd at least have you check some of the basics prior to that.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/networktocode/ntc-templates/issues/231#issuecomment-407770752, or mute the thread https://github.com/notifications/unsubscribe-auth/AdekIEkNMJxKqyWm0CuSmaHYQnqjczAEks5uKH5WgaJpZM4VZtFR .
Looks like I'm able to reproduce the issue as well. I'll try and work on it over the next few days, but someone else might possibly chime in before.
Thanks for checking this out, really appreciate it.
BTW, I wanted to take a stab a creating my own templates. Any recommendations for resource material?
Thanks!
On Wed, Jul 25, 2018 at 2:05 PM, FragmentedPacket notifications@github.com wrote:
Looks like I'm able to reproduce the issue as well. I'll try and work on it over the next few days, but someone else might possibly chime in before.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/networktocode/ntc-templates/issues/231#issuecomment-407895396, or mute the thread https://github.com/notifications/unsubscribe-auth/AdekIDn75NFSv3bZRfClavBLD_UdcJoeks5uKN2MgaJpZM4VZtFR .
I just kind of jumped in and helped people, I believe. The TextFSM templates I first worked on were way less convoluted than this one.
You may want to read a blog post Jason has in regards to this: http://jedelman.com/home/programmatic-access-to-cli-devices-with-textfsm/
Jason's blog has a link to a regex parser online that I use as well when troubleshooting/creating templates.
I've used this site as well: https://github.com/google/textfsm/wiki/TextFSM
You're also more than welcome to join NetworkToCode Slack. The feedback loop is much faster and short as well: https://networktocode.slack.com/
Not sure how I request an account for networktocode.slack.com
Sign in to networktocode
networktocode.slack.com
Don't have an account on this workspace yet?Contact the workspace administrator for an invitation
On Wed, Jul 25, 2018 at 4:05 PM, FragmentedPacket notifications@github.com wrote:
I just kind of jumped in and helped people, I believe. The TextFSM templates I first worked on were way less convoluted than this one.
You may want to read a blog post Jason has in regards to this: http://jedelman.com/home/programmatic-access-to-cli-devices-with-textfsm/
Jason's blog has a link to a regex parser online that I use as well when troubleshooting/creating templates.
I've used this site as well: https://github.com/google/textfsm/wiki/TextFSM
You're also more than welcome to join NetworkToCode Slack. The feedback loop is much faster and short as well: https://networktocode.slack.com/
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/networktocode/ntc-templates/issues/231#issuecomment-407924125, or mute the thread https://github.com/notifications/unsubscribe-auth/AdekIOww3c0Ilm-npvvDMUjT_mu3eE11ks5uKPnSgaJpZM4VZtFR .
Here it is: http://slack.networktocode.com/
thanks!
On Wed, Jul 25, 2018 at 6:45 PM, FragmentedPacket notifications@github.com wrote:
Here it is: http://slack.networktocode.com/
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/networktocode/ntc-templates/issues/231#issuecomment-407949479, or mute the thread https://github.com/notifications/unsubscribe-auth/AdekIDQvh4GlYzWfAzKU38tXzXWChitUks5uKR8pgaJpZM4VZtFR .
@murrad01 when you run that command on the ASA, do you not have a section that looks like this?
Session Type: LAN-to-LAN Detailed
Connection : 172.16.0.1
Index : 1 IP Addr : 172.16.0.1
Protocol : IPSecLAN2LAN Encryption : AES256
Bytes Tx : 48484156 Bytes Rx : 875049248
Login Time : 09:32:03 est Mon Aug 2 2004
Duration : 6:16:26
Filter Name :
IKE Sessions: 1 IPSec Sessions: 2
Session Type: LAN-to-LAN Detailed
is being required, and since the output you provided does not have that line, it is not recording anything. I also see that you have a NAC section which is not accounted for in the current template.
Here's a section of my submitted output. Shouldn't this work? Wouldn't the NAC section just be ignored?
'\nSession Type: LAN-to-LAN Detailed\n\nConnection
ya, I think I chopped that off when I was reformatting the \n
to be newlines. I think the NAC is causing the issue b/c of the EOF
in the template. I can get some data to record by removing that, but then there are other issues with the Record
, so this template really needs more work than I have time for at this moment
https://github.com/networktocode/ntc-templates/pull/237
I think I have it figured out, but feedback is welcomed.
ISSUE TYPE
TEMPLATE USING
SAMPLE COMMAND OUTPUT
SUMMARY
Not getting formatted data back, only a long string
STEPS TO REPRODUCE
EXPECTED RESULTS
expected formatted data like I get from the following command output = net_conn.send_command("show running-config tunnel-group", use_textfsm=True)
[{'name': 'x.x.x.x', 'type': 'ipsec-l2l', 'dhcp_selection': [], 'dhcp_server': [], 'authorization': '', 'authorization_intfc': '', 'authorization_grp': '', 'accounting_grp': '', 'ipv4_pool_intfc': '', 'ipv4_pool_name': '', 'authentication_intfc': '', 'authentication_pri_grp': '', 'authentication_sec_grp': '', 'authentication_svr': '', 'authenticated_user': '', 'group_policy': 'gp-lab1', 'ipv6_pool_intfc': '', 'ipv6_pool_name': '', 'nat_intfc': '', 'scep_enroll': '', 'sec_authentication_grp_intfc': '', 'sec_authentication_pri_grp': '', 'sec_authentication_sec_grp': '', 'sec_authentication_use_pri_user': '', 'sec_cert_codes': '', 'sec_cert_fallback': '', 'pri_cert_codes': '', 'pri_cert_fallback': '', 'strip_grp': '', 'strip_realm': '', 'ikev1_psk': '', 'chain': '', 'client_os': [], 'update_url': [], 'revs': [], 'trust_point': '', 'ikev1_user_auth_intfc': [], 'ikev1_user_auth_type': [], 'ikev2_local_auth_cert': '', 'ikev2_remote_auth_type': [], 'peer_id_validate': '', 'radius_with_expiry': '', 'ppp_auth_type': [], 'webvpn_auth': '', 'webvpn_custom': '', 'dns_grp': '', 'webvpn_grp_alias': [], 'webvpn_grp_alias_state': [], 'webvpn_grp_url': [], 'webvpn_grp_url_state': [], 'nbns_svr': [], 'nbns_master': [], 'nbns_timeout': [], 'nbns_retry': [], 'override_svc_download': '', 'pri_prefill_user_type': [], 'sec_prefill_user_type': [], 'proxy_auth': '', 'radius_reject_msg': '', 'saml_id_provider': '', 'without_csd': ''},
ACTUAL RESULTS