diff --git a/templates/cisco_nxos_show_interface_description.textfsm b/templates/cisco_nxos_show_interface_description.textfsm new file mode 100644 index 0000000000..74aae50935 --- /dev/null +++ b/templates/cisco_nxos_show_interface_description.textfsm @@ -0,0 +1,16 @@ +Value PORT (\S+) +Value TYPE (\S+) +Value SPEED (\d+G?) +Value DESCRIPTION (\S.*?) + +Start + ^Interface\s+Description\s*$$ -> Begin + +Begin + ^-+ + ^Port\s+Type\s+Speed\s+Description\s*$$ + ^Interface\s+Description\s*$$ + ^${PORT}\s+${TYPE}\s+${SPEED}(?:\s+${DESCRIPTION})?\s*$$ -> Record + ^${PORT}\s+(?:\s+${DESCRIPTION})?\s*$$ -> Record + ^\s*$$ + ^. -> Error diff --git a/templates/index b/templates/index index f8ba99af8e..8a4e212907 100644 --- a/templates/index +++ b/templates/index @@ -239,6 +239,7 @@ cisco_nxos_show_configuration_session_summary.textfsm, .*, cisco_nxos, sh[[ow]] cisco_nxos_show_interface_transceiver_details.textfsm, .*, cisco_nxos, sh[[ow]] int[[erface]] tra[[nsceiver]] de[[tails]] cisco_nxos_show_environment_temperature.textfsm, .*, cisco_nxos, sh[[ow]] env[[ironment]] t[[emperature]] cisco_nxos_show_forwarding_ipv4_route.textfsm, .*, cisco_nxos, sh[[ow]] fo[[rwarding]] ipv4 ro[[ute]] +cisco_nxos_show_interface_description.textfsm, .*, cisco_nxos, sh[[ow]] int[[erface]] desc[[ription]] cisco_nxos_show_interface_transceiver.textfsm, .*, cisco_nxos, sh[[ow]] int[[erface]] tra[[nsceiver]] cisco_nxos_show_interfaces_switchport.textfsm, .*, cisco_nxos, sh[[ow]] int[[erfaces]] sw[[itchport]] cisco_nxos_show_ip_dhcp_relay_address.textfsm, .*, cisco_nxos, sh[[ow]] ip dh[[cp]] r[[elay]] a[[ddress]] diff --git a/tests/cisco_nxos/show_interface_description/cisco_nxos_show_interface_description.raw b/tests/cisco_nxos/show_interface_description/cisco_nxos_show_interface_description.raw new file mode 100644 index 0000000000..7f38fb71ee --- /dev/null +++ b/tests/cisco_nxos/show_interface_description/cisco_nxos_show_interface_description.raw @@ -0,0 +1,131 @@ + +------------------------------------------------------------------------------- +Interface Description +------------------------------------------------------------------------------- +mgmt0 -- + +------------------------------------------------------------------------------- +Port Type Speed Description +------------------------------------------------------------------------------- +Eth4/1 eth 10G -- +Eth4/2 eth 1000 -- +Eth4/3 eth 10G This is a test description +Eth4/4 eth 10G This is a test description +Eth4/5 eth 10G This is a test description +Eth4/6 eth 1000 This is a test description +Eth4/7 eth 10G This is a test description +Eth4/8 eth 1000 This is a test description +Eth4/9 eth 10G This is a test description +Eth4/10 eth 10G This is a test description +Eth4/11 eth 10G This is a test description +Eth4/12 eth 10G This is a test description +Eth4/13 eth 1000 This is a test description +Eth4/14 eth 10G -- +Eth4/15 eth 10G This is a test description +Eth4/16 eth 10G This is a test description +Eth4/17 eth 1000 This is a test description +Eth4/18 eth 10G This is a test description +Eth4/19 eth 1000 This is a test description +Eth4/20 eth 10G This is a test description +Eth4/21 eth 10G This is a test description +Eth4/22 eth 10G This is a test description +Eth4/23 eth 10G This is a test description +Eth4/24 eth 10G This is a test description +Eth6/1 eth 10G This is a description on line card 6 +Eth6/2 eth 10G This is a description on line card 6 +Eth6/3 eth 1000 This is a description on line card 6 +Eth6/4 eth 1000 This is a description on line card 6 +Eth6/5 eth 10G This is a description on line card 6 +Eth6/6 eth 1000 This is a description on line card 6 +Eth6/7 eth 10G This is a description on line card 6 +Eth6/8 eth 10G This is a description on line card 6 +Eth6/9 eth 10G This is a description on line card 6 +Eth6/10 eth 10G This is a description on line card 6 +Eth6/11 eth 10G This is a description on line card 6 +Eth6/12 eth 10G This is a description on line card 6 +Eth6/13 eth 10G This is a description on line card 6 +Eth6/14 eth 10G This is a description on line card 6 +Eth6/15 eth 10G This is a description on line card 6 +Eth6/16 eth 1000 This is a description on line card 6 +Eth6/17 eth 10G This is a description on line card 6 +Eth6/18 eth 1000 This is a description on line card 6 +Eth6/19 eth 10G This is a description on line card 6 +Eth6/20 eth 10G This is a description on line card 6 +Eth6/21 eth 10G This is a description on line card 6 +Eth6/22 eth 10G This is a description on line card 6 +Eth6/23 eth 10G This is a description on line card 6 +Eth6/24 eth 10G This is a description on line card 6 +Eth6/25 eth 1000 This is a description on line card 6 +Eth6/26 eth 1000 This is a description on line card 6 +Eth6/27 eth 10G This is a description on line card 6 +Eth6/28 eth 1000 This is a description on line card 6 +Eth6/29 eth 10G This is a description on line card 6 +Eth6/30 eth 10G This is a description on line card 6 +Eth6/31 eth 10G This is a description on line card 6 +Eth6/32 eth 10G This is a description on line card 6 +Eth6/33 eth 10G This is a description on line card 6 +Eth6/34 eth 1000 This is a description on line card 6 +Eth6/35 eth 10G This is a description on line card 6 +Eth6/36 eth 1000 This is a description on line card 6 +Eth6/37 eth 10G This is a description on line card 6 +Eth6/38 eth 10G This is a description on line card 6 +Eth6/39 eth 1000 This is a description on line card 6 +Eth6/40 eth 10G This is a description on line card 6 +Eth6/41 eth 10G This is a description on line card 6 +Eth6/42 eth 10G This is a description on line card 6 +Eth6/43 eth 10G This is a description on line card 6 +Eth6/44 eth 10G This is a description on line card 6 +Eth6/45 eth 10G This is a description on line card 6 +Eth6/46 eth 10G This is a description on line card 6 +Eth6/47 eth 10G This is a description on line card 6 +Eth6/48 eth 10G This is a description on line card 6 + +------------------------------------------------------------------------------- +Interface Description +------------------------------------------------------------------------------- +Po10 This is a portchannel +Po20 This is a portchannel +Po25 This is a portchannel +Po300 This is a portchannel + +------------------------------------------------------------------------------- +Interface Description +------------------------------------------------------------------------------- +Lo0 This is a loopback +Lo1 This is a loopback +Lo2 This is a loopback +Lo20 -- +Lo30 -- +Vlan1 -- +Vlan9 Nice little VLAN interface here +Vlan10 Nice little VLAN interface here +Vlan20 Nice little VLAN interface here +Vlan30 Nice little VLAN interface here + +------------------------------------------------------------------------------- +Port Type Speed Description +------------------------------------------------------------------------------- +Eth100/1/1 eth 1000 This is another description +Eth100/1/2 eth 1000 This is another description +Eth100/1/3 eth 1000 This is another description +Eth100/1/4 eth 1000 This is another description +Eth100/1/5 eth 1000 This is another description +Eth100/1/6 eth 1000 This is another description +Eth100/1/7 eth 1000 This is another description +Eth100/1/8 eth 1000 This is another description +Eth100/1/9 eth 1000 This is another description +Eth100/1/10 eth 1000 This is another description +Eth100/1/11 eth 1000 This is another description +Eth100/1/12 eth 1000 This is another description +Eth100/1/13 eth 1000 This is another description +Eth100/1/14 eth 1000 This is another description +Eth100/1/15 eth 1000 This is another description +Eth100/1/16 eth 1000 This is another description +Eth100/1/17 eth 1000 This is another description +Eth100/1/18 eth 1000 This is another description +Eth100/1/19 eth 1000 This is another description +Eth100/1/20 eth 1000 This is another description +Eth100/1/21 eth 1000 This is another description +Eth100/1/22 eth 1000 This is another description +Eth100/1/23 eth 1000 This is another description +Eth100/1/24 eth 1000 This is another description diff --git a/tests/cisco_nxos/show_interface_description/cisco_nxos_show_interface_description.yml b/tests/cisco_nxos/show_interface_description/cisco_nxos_show_interface_description.yml new file mode 100644 index 0000000000..a7eeae4783 --- /dev/null +++ b/tests/cisco_nxos/show_interface_description/cisco_nxos_show_interface_description.yml @@ -0,0 +1,446 @@ +--- +parsed_sample: + - port: "mgmt0" + type: "" + speed: "" + description: "--" + - port: "Eth4/1" + type: "eth" + speed: "10G" + description: "--" + - port: "Eth4/2" + type: "eth" + speed: "1000" + description: "--" + - port: "Eth4/3" + type: "eth" + speed: "10G" + description: "This is a test description" + - port: "Eth4/4" + type: "eth" + speed: "10G" + description: "This is a test description" + - port: "Eth4/5" + type: "eth" + speed: "10G" + description: "This is a test description" + - port: "Eth4/6" + type: "eth" + speed: "1000" + description: "This is a test description" + - port: "Eth4/7" + type: "eth" + speed: "10G" + description: "This is a test description" + - port: "Eth4/8" + type: "eth" + speed: "1000" + description: "This is a test description" + - port: "Eth4/9" + type: "eth" + speed: "10G" + description: "This is a test description" + - port: "Eth4/10" + type: "eth" + speed: "10G" + description: "This is a test description" + - port: "Eth4/11" + type: "eth" + speed: "10G" + description: "This is a test description" + - port: "Eth4/12" + type: "eth" + speed: "10G" + description: "This is a test description" + - port: "Eth4/13" + type: "eth" + speed: "1000" + description: "This is a test description" + - port: "Eth4/14" + type: "eth" + speed: "10G" + description: "--" + - port: "Eth4/15" + type: "eth" + speed: "10G" + description: "This is a test description" + - port: "Eth4/16" + type: "eth" + speed: "10G" + description: "This is a test description" + - port: "Eth4/17" + type: "eth" + speed: "1000" + description: "This is a test description" + - port: "Eth4/18" + type: "eth" + speed: "10G" + description: "This is a test description" + - port: "Eth4/19" + type: "eth" + speed: "1000" + description: "This is a test description" + - port: "Eth4/20" + type: "eth" + speed: "10G" + description: "This is a test description" + - port: "Eth4/21" + type: "eth" + speed: "10G" + description: "This is a test description" + - port: "Eth4/22" + type: "eth" + speed: "10G" + description: "This is a test description" + - port: "Eth4/23" + type: "eth" + speed: "10G" + description: "This is a test description" + - port: "Eth4/24" + type: "eth" + speed: "10G" + description: "This is a test description" + - port: "Eth6/1" + type: "eth" + speed: "10G" + description: "This is a description on line card 6" + - port: "Eth6/2" + type: "eth" + speed: "10G" + description: "This is a description on line card 6" + - port: "Eth6/3" + type: "eth" + speed: "1000" + description: "This is a description on line card 6" + - port: "Eth6/4" + type: "eth" + speed: "1000" + description: "This is a description on line card 6" + - port: "Eth6/5" + type: "eth" + speed: "10G" + description: "This is a description on line card 6" + - port: "Eth6/6" + type: "eth" + speed: "1000" + description: "This is a description on line card 6" + - port: "Eth6/7" + type: "eth" + speed: "10G" + description: "This is a description on line card 6" + - port: "Eth6/8" + type: "eth" + speed: "10G" + description: "This is a description on line card 6" + - port: "Eth6/9" + type: "eth" + speed: "10G" + description: "This is a description on line card 6" + - port: "Eth6/10" + type: "eth" + speed: "10G" + description: "This is a description on line card 6" + - port: "Eth6/11" + type: "eth" + speed: "10G" + description: "This is a description on line card 6" + - port: "Eth6/12" + type: "eth" + speed: "10G" + description: "This is a description on line card 6" + - port: "Eth6/13" + type: "eth" + speed: "10G" + description: "This is a description on line card 6" + - port: "Eth6/14" + type: "eth" + speed: "10G" + description: "This is a description on line card 6" + - port: "Eth6/15" + type: "eth" + speed: "10G" + description: "This is a description on line card 6" + - port: "Eth6/16" + type: "eth" + speed: "1000" + description: "This is a description on line card 6" + - port: "Eth6/17" + type: "eth" + speed: "10G" + description: "This is a description on line card 6" + - port: "Eth6/18" + type: "eth" + speed: "1000" + description: "This is a description on line card 6" + - port: "Eth6/19" + type: "eth" + speed: "10G" + description: "This is a description on line card 6" + - port: "Eth6/20" + type: "eth" + speed: "10G" + description: "This is a description on line card 6" + - port: "Eth6/21" + type: "eth" + speed: "10G" + description: "This is a description on line card 6" + - port: "Eth6/22" + type: "eth" + speed: "10G" + description: "This is a description on line card 6" + - port: "Eth6/23" + type: "eth" + speed: "10G" + description: "This is a description on line card 6" + - port: "Eth6/24" + type: "eth" + speed: "10G" + description: "This is a description on line card 6" + - port: "Eth6/25" + type: "eth" + speed: "1000" + description: "This is a description on line card 6" + - port: "Eth6/26" + type: "eth" + speed: "1000" + description: "This is a description on line card 6" + - port: "Eth6/27" + type: "eth" + speed: "10G" + description: "This is a description on line card 6" + - port: "Eth6/28" + type: "eth" + speed: "1000" + description: "This is a description on line card 6" + - port: "Eth6/29" + type: "eth" + speed: "10G" + description: "This is a description on line card 6" + - port: "Eth6/30" + type: "eth" + speed: "10G" + description: "This is a description on line card 6" + - port: "Eth6/31" + type: "eth" + speed: "10G" + description: "This is a description on line card 6" + - port: "Eth6/32" + type: "eth" + speed: "10G" + description: "This is a description on line card 6" + - port: "Eth6/33" + type: "eth" + speed: "10G" + description: "This is a description on line card 6" + - port: "Eth6/34" + type: "eth" + speed: "1000" + description: "This is a description on line card 6" + - port: "Eth6/35" + type: "eth" + speed: "10G" + description: "This is a description on line card 6" + - port: "Eth6/36" + type: "eth" + speed: "1000" + description: "This is a description on line card 6" + - port: "Eth6/37" + type: "eth" + speed: "10G" + description: "This is a description on line card 6" + - port: "Eth6/38" + type: "eth" + speed: "10G" + description: "This is a description on line card 6" + - port: "Eth6/39" + type: "eth" + speed: "1000" + description: "This is a description on line card 6" + - port: "Eth6/40" + type: "eth" + speed: "10G" + description: "This is a description on line card 6" + - port: "Eth6/41" + type: "eth" + speed: "10G" + description: "This is a description on line card 6" + - port: "Eth6/42" + type: "eth" + speed: "10G" + description: "This is a description on line card 6" + - port: "Eth6/43" + type: "eth" + speed: "10G" + description: "This is a description on line card 6" + - port: "Eth6/44" + type: "eth" + speed: "10G" + description: "This is a description on line card 6" + - port: "Eth6/45" + type: "eth" + speed: "10G" + description: "This is a description on line card 6" + - port: "Eth6/46" + type: "eth" + speed: "10G" + description: "This is a description on line card 6" + - port: "Eth6/47" + type: "eth" + speed: "10G" + description: "This is a description on line card 6" + - port: "Eth6/48" + type: "eth" + speed: "10G" + description: "This is a description on line card 6" + - port: "Po10" + type: "" + speed: "" + description: "This is a portchannel" + - port: "Po20" + type: "" + speed: "" + description: "This is a portchannel" + - port: "Po25" + type: "" + speed: "" + description: "This is a portchannel" + - port: "Po300" + type: "" + speed: "" + description: "This is a portchannel" + - port: "Lo0" + type: "" + speed: "" + description: "This is a loopback" + - port: "Lo1" + type: "" + speed: "" + description: "This is a loopback" + - port: "Lo2" + type: "" + speed: "" + description: "This is a loopback" + - port: "Lo20" + type: "" + speed: "" + description: "--" + - port: "Lo30" + type: "" + speed: "" + description: "--" + - port: "Vlan1" + type: "" + speed: "" + description: "--" + - port: "Vlan9" + type: "" + speed: "" + description: "Nice little VLAN interface here" + - port: "Vlan10" + type: "" + speed: "" + description: "Nice little VLAN interface here" + - port: "Vlan20" + type: "" + speed: "" + description: "Nice little VLAN interface here" + - port: "Vlan30" + type: "" + speed: "" + description: "Nice little VLAN interface here" + - port: "Eth100/1/1" + type: "eth" + speed: "1000" + description: "This is another description" + - port: "Eth100/1/2" + type: "eth" + speed: "1000" + description: "This is another description" + - port: "Eth100/1/3" + type: "eth" + speed: "1000" + description: "This is another description" + - port: "Eth100/1/4" + type: "eth" + speed: "1000" + description: "This is another description" + - port: "Eth100/1/5" + type: "eth" + speed: "1000" + description: "This is another description" + - port: "Eth100/1/6" + type: "eth" + speed: "1000" + description: "This is another description" + - port: "Eth100/1/7" + type: "eth" + speed: "1000" + description: "This is another description" + - port: "Eth100/1/8" + type: "eth" + speed: "1000" + description: "This is another description" + - port: "Eth100/1/9" + type: "eth" + speed: "1000" + description: "This is another description" + - port: "Eth100/1/10" + type: "eth" + speed: "1000" + description: "This is another description" + - port: "Eth100/1/11" + type: "eth" + speed: "1000" + description: "This is another description" + - port: "Eth100/1/12" + type: "eth" + speed: "1000" + description: "This is another description" + - port: "Eth100/1/13" + type: "eth" + speed: "1000" + description: "This is another description" + - port: "Eth100/1/14" + type: "eth" + speed: "1000" + description: "This is another description" + - port: "Eth100/1/15" + type: "eth" + speed: "1000" + description: "This is another description" + - port: "Eth100/1/16" + type: "eth" + speed: "1000" + description: "This is another description" + - port: "Eth100/1/17" + type: "eth" + speed: "1000" + description: "This is another description" + - port: "Eth100/1/18" + type: "eth" + speed: "1000" + description: "This is another description" + - port: "Eth100/1/19" + type: "eth" + speed: "1000" + description: "This is another description" + - port: "Eth100/1/20" + type: "eth" + speed: "1000" + description: "This is another description" + - port: "Eth100/1/21" + type: "eth" + speed: "1000" + description: "This is another description" + - port: "Eth100/1/22" + type: "eth" + speed: "1000" + description: "This is another description" + - port: "Eth100/1/23" + type: "eth" + speed: "1000" + description: "This is another description" + - port: "Eth100/1/24" + type: "eth" + speed: "1000" + description: "This is another description"