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

cisco_ios_show_vlan.template not recorded complete list of interfaces #328

Closed
JCapretta opened this issue Jan 11, 2019 · 1 comment
Closed

Comments

@JCapretta
Copy link
Contributor

ISSUE TYPE
  • Bug Report
TEMPLATE USING
Value Required VLAN_ID (\d+)
Value NAME (\S+)
Value STATUS (\S+)
Value List INTERFACES ([\w\./]+)

Start
  ^$$
  ^\w+\s+[NnAaMmEe]{4}.*$$ -> VLANS

VLANS
  ^\d+ -> Continue.Record
  ^${VLAN_ID}\s+${NAME}\s+${STATUS}\s*$$
  ^${VLAN_ID}\s+${NAME}\s+${STATUS}\s+${INTERFACES},* -> Continue
  ^\d+\s+(?:\S+\s+){3}${INTERFACES},* -> Continue
  ^\d+\s+(?:\S+\s+){4}${INTERFACES},* -> Continue
  ^\d+\s+(?:\S+\s+){5}${INTERFACES},* -> Continue
  ^\d+\s+(?:\S+\s+){6}${INTERFACES},* -> Continue
  ^\d+\s+(?:\S+\s+){7}${INTERFACES},* -> Continue
  ^\d+\s+(?:\S+\s+){8}${INTERFACES},* -> Continue
  ^\d+\s+(?:\S+\s+){9}${INTERFACES},* -> Continue
  ^\d+\s+(?:\S+\s+){10}${INTERFACES},* -> Continue
  ^\d+\s+(?:\S+\s+){11}${INTERFACES},* -> Continue
  ^\d+\s+(?:\S+\s+){12}${INTERFACES},* -> Continue
  ^\d+\s+(?:\S+\s+){13}${INTERFACES} -> Continue
  ^\s+${INTERFACES},* -> Continue
  ^\s+\S+\s+${INTERFACES},* -> Continue
  ^\s+(?:\S+\s+){2}${INTERFACES},* -> Continue
  ^\s+(?:\S+\s+){3}${INTERFACES},* -> Continue
  ^\s+(?:\S+\s+){4}${INTERFACES},* -> Continue
  ^\s+(?:\S+\s+){5}${INTERFACES},* -> Continue
  ^\s+(?:\S+\s+){6}${INTERFACES},* -> Continue
  ^\s+(?:\S+\s+){7}${INTERFACES},* -> Continue
  ^\s+(?:\S+\s+){8}${INTERFACES},* -> Continue
  ^\s+(?:\S+\s+){9}${INTERFACES},* -> Continue
  ^\s+(?:\S+\s+){10}${INTERFACES},* -> Continue
  ^\s+(?:\S+\s+){11}${INTERFACES} -> Continue
  ^\d+
  ^\s+
  ^-+
  ^\S+\s+[TtYyPpEe]{4} -> Done
  ^.+ -> Error

Done
  ^.*
SAMPLE COMMAND OUTPUT
VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Gi1/0/2, Gi1/0/3, Gi1/0/4, Gi1/0/7, Gi1/0/12, Gi1/0/16, Gi1/0/17, Gi1/0/18, Gi1/0/19, Gi1/0/22, Gi1/0/23, Gi1/0/29, Gi1/0/30, Gi1/0/31, Gi1/0/32, Gi1/0/33, Gi1/0/34, Gi1/0/35, Gi1/0/36, Gi1/0/37, Gi1/0/38, Gi1/0/39, Gi1/0/40, Gi1/0/41, Gi1/0/42, Gi1/0/43, Gi1/0/44, Gi1/0/45, Gi1/0/46, Gi1/0/50, Gi1/0/51, Gi1/0/52, Gi2/0/2, Gi2/0/3, Gi2/0/4, Gi2/0/6, Gi2/0/7, Gi2/0/8, Gi2/0/9, Gi2/0/13, Gi2/0/14, Gi2/0/15, Gi2/0/16, Gi2/0/17, Gi2/0/18, Gi2/0/19, Gi2/0/21
                                                Gi2/0/22, Gi2/0/23, Gi2/0/24, Gi2/0/25, Gi2/0/26, Gi2/0/27, Gi2/0/28, Gi2/0/29, Gi2/0/30, Gi2/0/31, Gi2/0/32, Gi2/0/33, Gi2/0/34, Gi2/0/35, Gi2/0/36, Gi2/0/37, Gi2/0/38, Gi2/0/39, Gi2/0/40, Gi2/0/41, Gi2/0/42, Gi2/0/43, Gi2/0/44, Gi2/0/45, Gi2/0/46, Gi2/0/47, Gi2/0/48, Gi2/0/49, Gi2/0/50, Gi2/0/51, Gi2/0/52
32   vlan_32                          active
35   vlan_35                          active
36   vlan_36                          active
37   vlan_37                          active
38   vlan_38                          active
39   vlan_39                          active
40   vlan_40                          active
41   vlan_41                          active
50   vlan_50                          active
1002 vlan_1002                        act/unsup
1003 vlan_1003                        act/unsup
1004 vlan_1004                        act/unsup
1005 vlan_1005                        act/unsup
2100 vlan_2100                        active
2101 vlan_2101                        active    Gi1/0/6, Gi1/0/15
2102 vlan_2102                        active
2103 vlan_2103                        active
2104 vlan_2104                        active    Gi2/0/10, Gi2/0/11, Gi2/0/12, Gi2/0/20
2111 vlan_2111                        active
2112 vlan_2112                        active    Gi1/0/21
3350 vlan_3350                        active
3351 vlan_3351                        active    Gi1/0/10, Gi1/0/28
3363 vlan_3363                        active    Gi1/0/1, Gi1/0/11, Gi2/0/1
3364 vlan_3364                        active
3365 vlan_3365                        active
3366 vlan_3366                        active
3367 vlan_3367                        active
3368 vlan_3368                        active
3369 vlan_3369                        active
3370 vlan_3370                        active
3371 vlan_3371                        active
3373 vlan_3373                        active    Gi1/0/8
3374 vlan_3374                        active    Gi1/0/20
3428 vlan_3428                        active
3460 vlan_3460                        active
3468 vlan_3468                        active
3469 vlan_3469                        active    Gi1/0/26, Gi1/0/27
3470 vlan_3470                        active
3471 vlan_3471                          
3472 vlan_3472                        active

VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
1    enet  100001     1500  -      -      -        -    -        0      0
32   enet  100032     1500  -      -      -        -    -        0      0
35   enet  100035     1500  -      -      -        -    -        0      0
36   enet  100036     1500  -      -      -        -    -        0      0
37   enet  100037     1500  -      -      -        -    -        0      0
38   enet  100038     1500  -      -      -        -    -        0      0
39   enet  100039     1500  -      -      -        -    -        0      0
40   enet  100040     1500  -      -      -        -    -        0      0
41   enet  100041     1500  -      -      -        -    -        0      0
50   enet  100050     1500  -      -      -        -    -        0      0
1002 fddi  101002     1500  -      -      -        -    -        0      0
1003 tr    101003     1500  -      -      -        -    -        0      0
1004 fdnet 101004     1500  -      -      -        ieee -        0      0
1005 trnet 101005     1500  -      -      -        ibm  -        0      0
2100 enet  102100     1500  -      -      -        -    -        0      0
2101 enet  102101     1500  -      -      -        -    -        0      0
2102 enet  102102     1500  -      -      -        -    -        0      0
2103 enet  102103     1500  -      -      -        -    -        0      0
2104 enet  102104     1500  -      -      -        -    -        0      0
2111 enet  102111     1500  -      -      -        -    -        0      0
2112 enet  102112     1500  -      -      -        -    -        0      0
3350 enet  103350     1500  -      -      -        -    -        0      0
3351 enet  103351     1500  -      -      -        -    -        0      0
3363 enet  103363     1500  -      -      -        -    -        0      0
3364 enet  103364     1500  -      -      -        -    -        0      0
3365 enet  103365     1500  -      -      -        -    -        0      0
3366 enet  103366     1500  -      -      -        -    -        0      0
3367 enet  103367     1500  -      -      -        -    -        0      0
3368 enet  103368     1500  -      -      -        -    -        0      0
3369 enet  103369     1500  -      -      -        -    -        0      0
3370 enet  103370     1500  -      -      -        -    -        0      0
3371 enet  103371     1500  -      -      -        -    -        0      0
3373 enet  103373     1500  -      -      -        -    -        0      0
3374 enet  103374     1500  -      -      -        -    -        0      0
3428 enet  103428     1500  -      -      -        -    -        0      0
3460 enet  103460     1500  -      -      -        -    -        0      0
3468 enet  103468     1500  -      -      -        -    -        0      0
3469 enet  103469     1500  -      -      -        -    -        0      0
3470 enet  103470     1500  -      -      -        -    -        0      0
3471 enet  103471     1500  -      -      -        -    -        0      0
3472 enet  103472     1500  -      -      -        -    -        0      0


Remote SPAN VLANs
------------------------------------------------------------------------------


Primary Secondary Type              Ports
------- --------- ----------------- ------------------------------------------
SUMMARY

When the list of interfaces in the "Ports" column contains more than 12 interfaces in a single line, there only the first 12 interfaces will be recorded

STEPS TO REPRODUCE

python /textfsm.py ~/ntc-templates/templates/cisco_ios_show_vlan.template /tmp/show_vlan

EXPECTED RESULTS

The complete list of interfaces in Vlan1 should be recorded

ACTUAL RESULTS

Only 24 interfaces in Vlan1 were recorded

FSM Template:
Value Required VLAN_ID (\d+)
Value NAME (\S+)
Value STATUS (\S+)
Value List INTERFACES ([\w\./]+)

Start
  ^$$
  ^\w+\s+[NnAaMmEe]{4}.*$$ -> VLANS

VLANS
  ^\d+ -> Continue.Record
  ^${VLAN_ID}\s+${NAME}\s+${STATUS}\s*$$
  ^${VLAN_ID}\s+${NAME}\s+${STATUS}\s+${INTERFACES},* -> Continue
  ^\d+\s+(?:\S+\s+){3}${INTERFACES},* -> Continue
  ^\d+\s+(?:\S+\s+){4}${INTERFACES},* -> Continue
  ^\d+\s+(?:\S+\s+){5}${INTERFACES},* -> Continue
  ^\d+\s+(?:\S+\s+){6}${INTERFACES},* -> Continue
  ^\d+\s+(?:\S+\s+){7}${INTERFACES},* -> Continue
  ^\d+\s+(?:\S+\s+){8}${INTERFACES},* -> Continue
  ^\d+\s+(?:\S+\s+){9}${INTERFACES},* -> Continue
  ^\d+\s+(?:\S+\s+){10}${INTERFACES},* -> Continue
  ^\d+\s+(?:\S+\s+){11}${INTERFACES},* -> Continue
  ^\d+\s+(?:\S+\s+){12}${INTERFACES},* -> Continue
  ^\d+\s+(?:\S+\s+){13}${INTERFACES} -> Continue
  ^\s+${INTERFACES},* -> Continue
  ^\s+\S+\s+${INTERFACES},* -> Continue
  ^\s+(?:\S+\s+){2}${INTERFACES},* -> Continue
  ^\s+(?:\S+\s+){3}${INTERFACES},* -> Continue
  ^\s+(?:\S+\s+){4}${INTERFACES},* -> Continue
  ^\s+(?:\S+\s+){5}${INTERFACES},* -> Continue
  ^\s+(?:\S+\s+){6}${INTERFACES},* -> Continue
  ^\s+(?:\S+\s+){7}${INTERFACES},* -> Continue
  ^\s+(?:\S+\s+){8}${INTERFACES},* -> Continue
  ^\s+(?:\S+\s+){9}${INTERFACES},* -> Continue
  ^\s+(?:\S+\s+){10}${INTERFACES},* -> Continue
  ^\s+(?:\S+\s+){11}${INTERFACES} -> Continue
  ^\d+
  ^\s+
  ^-+
  ^\S+\s+[TtYyPpEe]{4} -> Done
  ^.+ -> Error

Done
  ^.*


FSM Table:
['VLAN_ID', 'NAME', 'STATUS', 'INTERFACES']
['1', 'default', 'active', ['Gi1/0/2', 'Gi1/0/3', 'Gi1/0/4', 'Gi1/0/7', 'Gi1/0/12', 'Gi1/0/16', 'Gi1/0/17', 'Gi1/0/18', 'Gi1/0/19', 'Gi1/0/22', 'Gi1/0/23', 'Gi1/0/29', 'Gi2/0/22', 'Gi2/0/23', 'Gi2/0/24', 'Gi2/0/25', 'Gi2/0/26', 'Gi2/0/27', 'Gi2/0/28', 'Gi2/0/29', 'Gi2/0/30', 'Gi2/0/31', 'Gi2/0/32', 'Gi2/0/33']]
['32', 'vlan_32', 'active', []]
['35', 'vlan_35', 'active', []]
['36', 'vlan_36', 'active', []]
['37', 'vlan_37', 'active', []]
['38', 'vlan_38', 'active', []]
['39', 'vlan_39', 'active', []]
['40', 'vlan_40', 'active', []]
['41', 'vlan_41', 'active', []]
['50', 'vlan_50', 'active', []]
['1002', 'vlan_1002', 'act/unsup', []]
['1003', 'vlan_1003', 'act/unsup', []]
['1004', 'vlan_1004', 'act/unsup', []]
['1005', 'vlan_1005', 'act/unsup', []]
['2100', 'vlan_2100', 'active', []]
['2101', 'vlan_2101', 'active', ['Gi1/0/6', 'Gi1/0/15']]
['2102', 'vlan_2102', 'active', []]
['2103', 'vlan_2103', 'active', []]
['2104', 'vlan_2104', 'active', ['Gi2/0/10', 'Gi2/0/11', 'Gi2/0/12', 'Gi2/0/20']]
['2111', 'vlan_2111', 'active', []]
['2112', 'vlan_2112', 'active', ['Gi1/0/21']]
['3350', 'vlan_3350', 'active', []]
['3351', 'vlan_3351', 'active', ['Gi1/0/10', 'Gi1/0/28']]
['3363', 'vlan_3363', 'active', ['Gi1/0/1', 'Gi1/0/11', 'Gi2/0/1']]
['3364', 'vlan_3364', 'active', []]
['3365', 'vlan_3365', 'active', []]
['3366', 'vlan_3366', 'active', []]
['3367', 'vlan_3367', 'active', []]
['3368', 'vlan_3368', 'active', []]
['3369', 'vlan_3369', 'active', []]
['3370', 'vlan_3370', 'active', []]
['3371', 'vlan_3371', 'active', []]
['3373', 'vlan_3373', 'active', ['Gi1/0/8']]
['3374', 'vlan_3374', 'active', ['Gi1/0/20']]
['3428', 'vlan_3428', 'active', []]
['3460', 'vlan_3460', 'active', []]
['3468', 'vlan_3468', 'active', []]
['3469', 'vlan_3469', 'active', ['Gi1/0/26', 'Gi1/0/27']]
['3470', 'vlan_3470', 'active', []]
['3472', 'vlan_3472', 'active', []]
JCapretta added a commit to JCapretta/ntc-templates that referenced this issue Jan 11, 2019
 * template can now parse a longer list of interfaces. Previously only
   12 interface in a line were recorded. The remaining interfaces were not
   recorded.
jmcgill298 pushed a commit that referenced this issue Jan 12, 2019
* Extend the number of interfaces that can be captured per line `INTERFACES`
@jmcgill298
Copy link
Contributor

#329

jvanderaa pushed a commit that referenced this issue Nov 10, 2021
* Extend the number of interfaces that can be captured per line `INTERFACES`
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