From 1c9fc9e2c42fa90a4a683026789ab14504071742 Mon Sep 17 00:00:00 2001 From: kjoyce77 Date: Tue, 31 Mar 2020 08:32:52 -0500 Subject: [PATCH] New template: cisco_ios_show_ip_route_summary (#635) --- .../cisco_ios_show_ip_route_summary.textfsm | 34 ++++++++++ templates/index | 1 + .../cisco_ios_show_ip_route_summary.raw | 13 ++++ .../cisco_ios_show_ip_route_summary.yml | 58 +++++++++++++++++ .../cisco_ios_show_ip_route_summary2.raw | 14 ++++ .../cisco_ios_show_ip_route_summary2.yml | 65 +++++++++++++++++++ .../cisco_ios_show_ip_route_summary3.raw | 7 ++ .../cisco_ios_show_ip_route_summary3.yml | 30 +++++++++ 8 files changed, 222 insertions(+) create mode 100644 templates/cisco_ios_show_ip_route_summary.textfsm create mode 100644 tests/cisco_ios/show_ip_route_summary/cisco_ios_show_ip_route_summary.raw create mode 100644 tests/cisco_ios/show_ip_route_summary/cisco_ios_show_ip_route_summary.yml create mode 100644 tests/cisco_ios/show_ip_route_summary/cisco_ios_show_ip_route_summary2.raw create mode 100644 tests/cisco_ios/show_ip_route_summary/cisco_ios_show_ip_route_summary2.yml create mode 100644 tests/cisco_ios/show_ip_route_summary/cisco_ios_show_ip_route_summary3.raw create mode 100644 tests/cisco_ios/show_ip_route_summary/cisco_ios_show_ip_route_summary3.yml diff --git a/templates/cisco_ios_show_ip_route_summary.textfsm b/templates/cisco_ios_show_ip_route_summary.textfsm new file mode 100644 index 0000000000..1036ca5a43 --- /dev/null +++ b/templates/cisco_ios_show_ip_route_summary.textfsm @@ -0,0 +1,34 @@ +Value Required ROUTE_SOURCE ([^\s][\S ]+?) +Value Filldown NAME (.*) +Value NETWORKS (\d*) +Value SUBNETS (\d*) +Value REPLICATES (\d*) +Value OVERHEAD (\d*) +Value MEMORY (\d*) + +Start + # Checking for header + ^IP\s+routing\s+table\s+name\s+is\s+${NAME}\s*$$ + ^IP\s+routing\s+table\s+maximum-paths\s+is\s+\d+\s*$$ + ^Route\s+Source\s+Networks\s+Subnets\s+Overhead\s+Memory\s+\(bytes\)\s*$$ -> RouteData1 + ^Route\s+Source\s+Networks\s+Subnets\s+Replicates\s+Overhead\s+Memory\s+\(bytes\)\s*$$ -> RouteData2 + ^\s*$$ + ^. -> Error + +RouteData1 + ^${ROUTE_SOURCE}\s{2,16}${NETWORKS}\s{1,12}${SUBNETS}\s{1,12}${OVERHEAD}\s{1,12}${MEMORY}\s*$$ -> Record + ^\s+External:\s+\d+\s+Internal:\s+\d+\s+Local:\s+\d+\s*$$ + ^\s+Level\s+1:\s+\d+\s+Level\s+2:\s+\d+\s+Inter-area:\s+\d+\s*$$ + ^\s+Intra-area:\s+\d+\s+Inter-area:\s+\d+\s+External-1:\s+\d+\s+External-2:\s+\d+\s*$$ + ^\s+NSSA\s+External-1:\s+\d+\s+NSSA\s+External-2:\s+\d+\s*$$ + ^\s*$$ + ^. -> Error + +RouteData2 + ^${ROUTE_SOURCE}\s{2,16}${NETWORKS}\s{1,12}${SUBNETS}\s{1,12}${REPLICATES}\s{1,12}${OVERHEAD}\s{1,12}${MEMORY}\s*$$ -> Record + ^\s+External:\s+\d+\s+Internal:\s+\d+\s+Local:\s+\d+\s*$$ + ^\s+Level\s+1:\s+\d+\s+Level\s+2:\s+\d+\s+Inter-area:\s+\d+\s*$$ + ^\s+Intra-area:\s+\d+\s+Inter-area:\s+\d+\s+External-1:\s+\d+\s+External-2:\s+\d+\s*$$ + ^\s+NSSA\s+External-1:\s+\d+\s+NSSA\s+External-2:\s+\d+\s*$$ + ^\s*$$ + ^. -> Error diff --git a/templates/index b/templates/index index fbb71fa952..8b05e62c1c 100644 --- a/templates/index +++ b/templates/index @@ -165,6 +165,7 @@ cisco_ios_show_mac-address-table.textfsm, .*, cisco_ios, sh[[ow]] mac[[-address- cisco_ios_show_ip_bgp_neighbors.textfsm, .*, cisco_ios, sh[[ow]] ip bgp nei[[ghbors]] cisco_ios_show_ip_ospf_database.textfsm, .*, cisco_ios, sh[[ow]] ip ospf data[[base]] cisco_ios_show_ip_ospf_neighbor.textfsm, .*, cisco_ios, sh[[ow]] ip ospf nei[[ghbor]] +cisco_ios_show_ip_route_summary.textfsm, .*, cisco_ios, sh[[ow]] ip ro[[ute]] sum[[mary]] cisco_ios_show_ip_access-lists.textfsm, .*, cisco_ios, sh[[ow]] ip acce[[ss-lists]] cisco_ios_show_mpls_interfaces.textfsm, .*, cisco_ios, sh[[ow]] mpls interfa[[ces]] cisco_ios_show_power_available.textfsm, .*, cisco_ios, sh[[ow]] pow[[er]] a[[vailable]] diff --git a/tests/cisco_ios/show_ip_route_summary/cisco_ios_show_ip_route_summary.raw b/tests/cisco_ios/show_ip_route_summary/cisco_ios_show_ip_route_summary.raw new file mode 100644 index 0000000000..a514b6b8bb --- /dev/null +++ b/tests/cisco_ios/show_ip_route_summary/cisco_ios_show_ip_route_summary.raw @@ -0,0 +1,13 @@ +IP routing table name is default (0x0) +IP routing table maximum-paths is 32 +Route Source Networks Subnets Replicates Overhead Memory (bytes) +connected 0 41 0 3936 11808 +static 0 3 0 288 864 +application 0 0 0 0 0 +nhrp 0 0 0 0 0 +eigrp 65329 3 3013 0 481920 868608 +ospf 20 1 0 0 384 292 + Intra-area: 0 Inter-area: 0 External-1: 0 External-2: 1 + NSSA External-1: 0 NSSA External-2: 0 +internal 24 240672 +Total 28 3057 0 486528 1122244 diff --git a/tests/cisco_ios/show_ip_route_summary/cisco_ios_show_ip_route_summary.yml b/tests/cisco_ios/show_ip_route_summary/cisco_ios_show_ip_route_summary.yml new file mode 100644 index 0000000000..cb6ad40018 --- /dev/null +++ b/tests/cisco_ios/show_ip_route_summary/cisco_ios_show_ip_route_summary.yml @@ -0,0 +1,58 @@ +--- +parsed_sample: + - route_source: "connected" + name: "default (0x0)" + networks: "0" + subnets: "41" + replicates: "0" + overhead: "3936" + memory: "11808" + - route_source: "static" + name: "default (0x0)" + networks: "0" + subnets: "3" + replicates: "0" + overhead: "288" + memory: "864" + - route_source: "application" + name: "default (0x0)" + networks: "0" + subnets: "0" + replicates: "0" + overhead: "0" + memory: "0" + - route_source: "nhrp" + name: "default (0x0)" + networks: "0" + subnets: "0" + replicates: "0" + overhead: "0" + memory: "0" + - route_source: "eigrp 65329" + name: "default (0x0)" + networks: "3" + subnets: "3013" + replicates: "0" + overhead: "481920" + memory: "868608" + - route_source: "ospf 20" + name: "default (0x0)" + networks: "1" + subnets: "0" + replicates: "0" + overhead: "384" + memory: "292" + - route_source: "internal" + name: "default (0x0)" + networks: "24" + subnets: "" + replicates: "" + overhead: "" + memory: "240672" + - route_source: "Total" + name: "default (0x0)" + networks: "28" + subnets: "3057" + replicates: "0" + overhead: "486528" + memory: "1122244" diff --git a/tests/cisco_ios/show_ip_route_summary/cisco_ios_show_ip_route_summary2.raw b/tests/cisco_ios/show_ip_route_summary/cisco_ios_show_ip_route_summary2.raw new file mode 100644 index 0000000000..19486af76e --- /dev/null +++ b/tests/cisco_ios/show_ip_route_summary/cisco_ios_show_ip_route_summary2.raw @@ -0,0 +1,14 @@ +Route Source Networks Subnets Replicates Overhead Memory (bytes) +connected 0 6 0 408 1080 +static 0 0 0 0 0 +application 0 0 0 0 0 +eigrp 100 0 0 0 0 0 +bgp 65001 0 0 0 0 0 + External: 0 Internal: 0 Local: 0 +isis test1 0 0 0 0 0 + Level 1: 0 Level 2: 0 Inter-area: 0 +ospf 188 0 0 0 0 0 + Intra-area: 0 Inter-area: 0 External-1: 0 External-2: 0 + NSSA External-1: 0 NSSA External-2: 0 +internal 2 920 +Total 2 6 0 408 2000 diff --git a/tests/cisco_ios/show_ip_route_summary/cisco_ios_show_ip_route_summary2.yml b/tests/cisco_ios/show_ip_route_summary/cisco_ios_show_ip_route_summary2.yml new file mode 100644 index 0000000000..d495fda14e --- /dev/null +++ b/tests/cisco_ios/show_ip_route_summary/cisco_ios_show_ip_route_summary2.yml @@ -0,0 +1,65 @@ +--- +parsed_sample: + - route_source: "connected" + name: "" + networks: "0" + subnets: "6" + replicates: "0" + overhead: "408" + memory: "1080" + - route_source: "static" + name: "" + networks: "0" + subnets: "0" + replicates: "0" + overhead: "0" + memory: "0" + - route_source: "application" + name: "" + networks: "0" + subnets: "0" + replicates: "0" + overhead: "0" + memory: "0" + - route_source: "eigrp 100" + name: "" + networks: "0" + subnets: "0" + replicates: "0" + overhead: "0" + memory: "0" + - route_source: "bgp 65001" + name: "" + networks: "0" + subnets: "0" + replicates: "0" + overhead: "0" + memory: "0" + - route_source: "isis test1" + name: "" + networks: "0" + subnets: "0" + replicates: "0" + overhead: "0" + memory: "0" + - route_source: "ospf 188" + name: "" + networks: "0" + subnets: "0" + replicates: "0" + overhead: "0" + memory: "0" + - route_source: "internal" + name: "" + networks: "2" + subnets: "" + replicates: "" + overhead: "" + memory: "920" + - route_source: "Total" + name: "" + networks: "2" + subnets: "6" + replicates: "0" + overhead: "408" + memory: "2000" diff --git a/tests/cisco_ios/show_ip_route_summary/cisco_ios_show_ip_route_summary3.raw b/tests/cisco_ios/show_ip_route_summary/cisco_ios_show_ip_route_summary3.raw new file mode 100644 index 0000000000..1953696417 --- /dev/null +++ b/tests/cisco_ios/show_ip_route_summary/cisco_ios_show_ip_route_summary3.raw @@ -0,0 +1,7 @@ +IP routing table name is Default-IP-Routing-Table(0) +IP routing table maximum-paths is 16 +Route Source Networks Subnets Overhead Memory (bytes) +connected 0 4 288 544 +static 1 2 216 408 +internal 3 3468 +Total 4 6 504 4420 diff --git a/tests/cisco_ios/show_ip_route_summary/cisco_ios_show_ip_route_summary3.yml b/tests/cisco_ios/show_ip_route_summary/cisco_ios_show_ip_route_summary3.yml new file mode 100644 index 0000000000..cced7a1b9e --- /dev/null +++ b/tests/cisco_ios/show_ip_route_summary/cisco_ios_show_ip_route_summary3.yml @@ -0,0 +1,30 @@ +--- +parsed_sample: + - route_source: "connected" + name: "Default-IP-Routing-Table(0)" + networks: "0" + subnets: "4" + replicates: "" + overhead: "288" + memory: "544" + - route_source: "static" + name: "Default-IP-Routing-Table(0)" + networks: "1" + subnets: "2" + replicates: "" + overhead: "216" + memory: "408" + - route_source: "internal" + name: "Default-IP-Routing-Table(0)" + networks: "3" + subnets: "" + replicates: "" + overhead: "" + memory: "3468" + - route_source: "Total" + name: "Default-IP-Routing-Table(0)" + networks: "4" + subnets: "6" + replicates: "" + overhead: "504" + memory: "4420"