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
cisco_ios_show_interfaces_status.textfsm parse error for PortChannels #1606
Comments
Figured it out looks like the template is looking for TYPE when its blank for the "Po" interfaces. I added these two lines and tested and it works: ^\s*${PORT}\s+${NAME}\s+${STATUS}\s+${VLAN_ID}\s+${DUPLEX}\s+${SPEED}\s*$$ -> Record Maybe we can modify the repo's template to skip the type? |
@kuraijay I also proceeded to confirm it parses via the NTC yaml generator script ( Might you be able to share another block of sample command output and the error that is thrown by textfsm? |
it's the only sample I got sorry. It parses fine on the website, but when I went to write the script to run the command and use the template that's the only time it errored. Maybe there some kind of value it sees when disappears when you copy it over. |
Hello @kuraijay I'd like to help figure this out so please bear with me while I ask some questions below. Thank you! 😃
Together we'll solve this. |
Hello @kuraijay I've done some digging and located output where the type for port-channels is ➡️ Answers to questions in my comment from a few days ago will be extremely helpful in order for me to help solve the templating issue. |
What Cisco IOS version? 16.3.6 What are the modules and versions of those modules is your script using?
Would you be willing to save the raw output to a plain text file and attach it on this thread? |
@kuraijay I took your plaintext file, removed the host name prompts, the --more--, and the extra column headers. Then I ran that entire long file through NTC's I'm not able to identify a discrepancy in the output. Based on the output from git blame, 7 years ago the
|
@kuraijay The unfortunate news is that the output I retrieved from it parses fine just like earlier raw output examples. Your Jan 24 comment mentions the TYPE capture group. The regex for TYPE is I can't find an issue with the template. 😞 ➡️ Based on your Please double check that your script is not accidentally referencing an old version of ntc-templates. You might go as far as manually referencing a Hope this helps. |
Was this done still copying and pasting the output? or did you have a script to run the command and usetextfsm? |
In this specific case, I captured the text in a file since it was no longer network-connected. I'll take this further soon to plumb the 16.3.6 switch up temporarily so I can validate with the device directly. |
A day ago I fired up a 3650 running 6.3.6 code and added a port-channel interface. Next I ran a quick netmiko script (using the If you haven't yet,
Hope this helps! |
ISSUE TYPE
TEMPLATE USING
SAMPLE COMMAND OUTPUT
SUMMARY
Script runs the show interfaces status command and text parses the data. anything that has the Po (port channel) interfaces throws the error
textfsm.parser.TextFSMError: State Error raised. Rule Line: 28. Input Line: Po3 Wireless Controlle notconnect unassigned auto auto
STEPS TO REPRODUCE
Write a script that will run the command "show interfaces status" then use TextFSM to parse it.
EXPECTED RESULTS
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: