From 2b60d45632fe0ffafc8417330e21d1b8160cb732 Mon Sep 17 00:00:00 2001 From: Pavel_Komissarov Date: Fri, 12 Mar 2021 01:46:50 +0300 Subject: [PATCH] New Template - cisco_ios_show_object-group (#850) --- templates/cisco_ios_show_object-group.textfsm | 31 ++ templates/index | 1 + .../cisco_ios_show_object-group.raw | 31 ++ .../cisco_ios_show_object-group.yml | 498 ++++++++++++++++++ 4 files changed, 561 insertions(+) create mode 100644 templates/cisco_ios_show_object-group.textfsm create mode 100644 tests/cisco_ios/show_object-group/cisco_ios_show_object-group.raw create mode 100644 tests/cisco_ios/show_object-group/cisco_ios_show_object-group.yml diff --git a/templates/cisco_ios_show_object-group.textfsm b/templates/cisco_ios_show_object-group.textfsm new file mode 100644 index 0000000000..cce83b80fc --- /dev/null +++ b/templates/cisco_ios_show_object-group.textfsm @@ -0,0 +1,31 @@ +Value Required,Filldown TYPE (Service|Network) +Value Required,Filldown NAME (\S+) +Value DESCRIPTION (.+) +Value NESTED_GROUPS (\S+) +Value ANY (any) +Value HOST (\d+\.\d+\.\d+\.\d+) +Value HOST_RANGE_START (\d+\.\d+\.\d+\.\d+) +Value HOST_RANGE_END (\d+\.\d+\.\d+\.\d+) +Value NETWORK (\d+\.\d+\.\d+\.\d+) +Value NETMASK (\d+\.\d+\.\d+\.\d+) +Value PROTOCOL (\S+) +Value PORT_MATCH (eq|neq|range|lt|gt) +Value PORT ((? Continue.Clearall + ^${TYPE}\s+object\s+group\s+${NAME}\s*$$ -> Record + ^\s+Description\s+${DESCRIPTION}$$ -> Record + ^\s+group-object\s+${NESTED_GROUPS}\s*$$ -> Record + ^\s+(host\s+${HOST}|range\s+${HOST_RANGE_START}\s+${HOST_RANGE_END}|${ANY}|${NETWORK}\s+${NETMASK})\s*$$ -> Record + ^\s+icmp\s+${ICMP_TYPE}\s*$$ -> Record + ^\s+${PROTOCOL}\s+${PORT_MATCH}\s+(${PORT_RANGE_START}\s+${PORT_RANGE_END}|${PORT})\s*$$ -> Record + ^\s+${PROTOCOL}\s*$$ -> Record + ^\s*$$ + ^. -> Error + +EOF + diff --git a/templates/index b/templates/index index acfbb5fb2c..b5da6447a8 100644 --- a/templates/index +++ b/templates/index @@ -215,6 +215,7 @@ cisco_ios_show_processes_cpu.textfsm, .*, cisco_ios, sh[[ow]] proc[[esses]] [[cp cisco_ios_show_spanning-tree.textfsm, .*, cisco_ios, sh[[ow]] sp[[anning-tree]] cisco_ios_show_standby_brief.textfsm, .*, cisco_ios, sh[[ow]] standby(?:\s+\S+)? br[[ief]] cisco_ios_show_ip_interface.textfsm, .*, cisco_ios, sh[[ow]] ip int[[erface]] +cisco_ios_show_object-group.textfsm, .*, cisco_ios, sh[[ow]] ob[[ject-group]] cisco_ios_show_power_status.textfsm, .*, cisco_ios, sh[[ow]] pow[[er]] st[[atus]] cisco_ios_show_access-list.textfsm, .*, cisco_ios, sh[[ow]] acc[[ess-list]] cisco_ios_show_isdn_status.textfsm, .*, cisco_ios, sh[[ow]] isd[[n]] st[[atus]] diff --git a/tests/cisco_ios/show_object-group/cisco_ios_show_object-group.raw b/tests/cisco_ios/show_object-group/cisco_ios_show_object-group.raw new file mode 100644 index 0000000000..f040a55b90 --- /dev/null +++ b/tests/cisco_ios/show_object-group/cisco_ios_show_object-group.raw @@ -0,0 +1,31 @@ +Network object group NNNN +Service object group SSSS +Service object group TEST-SVC-OGR + Description ! Test Service Group ! + icmp echo-reply + tcp eq smtp + udp eq tacacs + udp range tacacs 50 + tcp range 79 www + tcp eq www + tcp eq 81 + udp lt 999 + udp gt 97 + tcp-udp range 12200 12700 + icmp + tcp + udp + tcp-udp range 0 65535 + group-object SSSS + ip + ipinip + 99 +Network object group TEST_NET_OGR + Description ###TEST NETWORK OGR### + any + host 1.1.1.1 + range 2.2.2.2 3.3.3.3 + group-object NNNN + 1.1.1.0 255.255.255.0 +Network object group XXXX +Network object group YYYY diff --git a/tests/cisco_ios/show_object-group/cisco_ios_show_object-group.yml b/tests/cisco_ios/show_object-group/cisco_ios_show_object-group.yml new file mode 100644 index 0000000000..562100bd28 --- /dev/null +++ b/tests/cisco_ios/show_object-group/cisco_ios_show_object-group.yml @@ -0,0 +1,498 @@ +--- +parsed_sample: + - type: "Network" + name: "NNNN" + description: "" + nested_groups: "" + any: "" + host: "" + host_range_start: "" + host_range_end: "" + network: "" + netmask: "" + protocol: "" + port_match: "" + port: "" + port_range_start: "" + port_range_end: "" + icmp_type: "" + - type: "Service" + name: "SSSS" + description: "" + nested_groups: "" + any: "" + host: "" + host_range_start: "" + host_range_end: "" + network: "" + netmask: "" + protocol: "" + port_match: "" + port: "" + port_range_start: "" + port_range_end: "" + icmp_type: "" + - type: "Service" + name: "TEST-SVC-OGR" + description: "" + nested_groups: "" + any: "" + host: "" + host_range_start: "" + host_range_end: "" + network: "" + netmask: "" + protocol: "" + port_match: "" + port: "" + port_range_start: "" + port_range_end: "" + icmp_type: "" + - type: "Service" + name: "TEST-SVC-OGR" + description: "! Test Service Group !" + nested_groups: "" + any: "" + host: "" + host_range_start: "" + host_range_end: "" + network: "" + netmask: "" + protocol: "" + port_match: "" + port: "" + port_range_start: "" + port_range_end: "" + icmp_type: "" + - type: "Service" + name: "TEST-SVC-OGR" + description: "" + nested_groups: "" + any: "" + host: "" + host_range_start: "" + host_range_end: "" + network: "" + netmask: "" + protocol: "" + port_match: "" + port: "" + port_range_start: "" + port_range_end: "" + icmp_type: "echo-reply" + - type: "Service" + name: "TEST-SVC-OGR" + description: "" + nested_groups: "" + any: "" + host: "" + host_range_start: "" + host_range_end: "" + network: "" + netmask: "" + protocol: "tcp" + port_match: "eq" + port: "smtp" + port_range_start: "" + port_range_end: "" + icmp_type: "" + - type: "Service" + name: "TEST-SVC-OGR" + description: "" + nested_groups: "" + any: "" + host: "" + host_range_start: "" + host_range_end: "" + network: "" + netmask: "" + protocol: "udp" + port_match: "eq" + port: "tacacs" + port_range_start: "" + port_range_end: "" + icmp_type: "" + - type: "Service" + name: "TEST-SVC-OGR" + description: "" + nested_groups: "" + any: "" + host: "" + host_range_start: "" + host_range_end: "" + network: "" + netmask: "" + protocol: "udp" + port_match: "range" + port: "" + port_range_start: "tacacs" + port_range_end: "50" + icmp_type: "" + - type: "Service" + name: "TEST-SVC-OGR" + description: "" + nested_groups: "" + any: "" + host: "" + host_range_start: "" + host_range_end: "" + network: "" + netmask: "" + protocol: "tcp" + port_match: "range" + port: "" + port_range_start: "79" + port_range_end: "www" + icmp_type: "" + - type: "Service" + name: "TEST-SVC-OGR" + description: "" + nested_groups: "" + any: "" + host: "" + host_range_start: "" + host_range_end: "" + network: "" + netmask: "" + protocol: "tcp" + port_match: "eq" + port: "www" + port_range_start: "" + port_range_end: "" + icmp_type: "" + - type: "Service" + name: "TEST-SVC-OGR" + description: "" + nested_groups: "" + any: "" + host: "" + host_range_start: "" + host_range_end: "" + network: "" + netmask: "" + protocol: "tcp" + port_match: "eq" + port: "81" + port_range_start: "" + port_range_end: "" + icmp_type: "" + - type: "Service" + name: "TEST-SVC-OGR" + description: "" + nested_groups: "" + any: "" + host: "" + host_range_start: "" + host_range_end: "" + network: "" + netmask: "" + protocol: "udp" + port_match: "lt" + port: "999" + port_range_start: "" + port_range_end: "" + icmp_type: "" + - type: "Service" + name: "TEST-SVC-OGR" + description: "" + nested_groups: "" + any: "" + host: "" + host_range_start: "" + host_range_end: "" + network: "" + netmask: "" + protocol: "udp" + port_match: "gt" + port: "97" + port_range_start: "" + port_range_end: "" + icmp_type: "" + - type: "Service" + name: "TEST-SVC-OGR" + description: "" + nested_groups: "" + any: "" + host: "" + host_range_start: "" + host_range_end: "" + network: "" + netmask: "" + protocol: "tcp-udp" + port_match: "range" + port: "" + port_range_start: "12200" + port_range_end: "12700" + icmp_type: "" + - type: "Service" + name: "TEST-SVC-OGR" + description: "" + nested_groups: "" + any: "" + host: "" + host_range_start: "" + host_range_end: "" + network: "" + netmask: "" + protocol: "icmp" + port_match: "" + port: "" + port_range_start: "" + port_range_end: "" + icmp_type: "" + - type: "Service" + name: "TEST-SVC-OGR" + description: "" + nested_groups: "" + any: "" + host: "" + host_range_start: "" + host_range_end: "" + network: "" + netmask: "" + protocol: "tcp" + port_match: "" + port: "" + port_range_start: "" + port_range_end: "" + icmp_type: "" + - type: "Service" + name: "TEST-SVC-OGR" + description: "" + nested_groups: "" + any: "" + host: "" + host_range_start: "" + host_range_end: "" + network: "" + netmask: "" + protocol: "udp" + port_match: "" + port: "" + port_range_start: "" + port_range_end: "" + icmp_type: "" + - type: "Service" + name: "TEST-SVC-OGR" + description: "" + nested_groups: "" + any: "" + host: "" + host_range_start: "" + host_range_end: "" + network: "" + netmask: "" + protocol: "tcp-udp" + port_match: "range" + port: "" + port_range_start: "0" + port_range_end: "65535" + icmp_type: "" + - type: "Service" + name: "TEST-SVC-OGR" + description: "" + nested_groups: "SSSS" + any: "" + host: "" + host_range_start: "" + host_range_end: "" + network: "" + netmask: "" + protocol: "" + port_match: "" + port: "" + port_range_start: "" + port_range_end: "" + icmp_type: "" + - type: "Service" + name: "TEST-SVC-OGR" + description: "" + nested_groups: "" + any: "" + host: "" + host_range_start: "" + host_range_end: "" + network: "" + netmask: "" + protocol: "ip" + port_match: "" + port: "" + port_range_start: "" + port_range_end: "" + icmp_type: "" + - type: "Service" + name: "TEST-SVC-OGR" + description: "" + nested_groups: "" + any: "" + host: "" + host_range_start: "" + host_range_end: "" + network: "" + netmask: "" + protocol: "ipinip" + port_match: "" + port: "" + port_range_start: "" + port_range_end: "" + icmp_type: "" + - type: "Service" + name: "TEST-SVC-OGR" + description: "" + nested_groups: "" + any: "" + host: "" + host_range_start: "" + host_range_end: "" + network: "" + netmask: "" + protocol: "99" + port_match: "" + port: "" + port_range_start: "" + port_range_end: "" + icmp_type: "" + - type: "Network" + name: "TEST_NET_OGR" + description: "" + nested_groups: "" + any: "" + host: "" + host_range_start: "" + host_range_end: "" + network: "" + netmask: "" + protocol: "" + port_match: "" + port: "" + port_range_start: "" + port_range_end: "" + icmp_type: "" + - type: "Network" + name: "TEST_NET_OGR" + description: "###TEST NETWORK OGR###" + nested_groups: "" + any: "" + host: "" + host_range_start: "" + host_range_end: "" + network: "" + netmask: "" + protocol: "" + port_match: "" + port: "" + port_range_start: "" + port_range_end: "" + icmp_type: "" + - type: "Network" + name: "TEST_NET_OGR" + description: "" + nested_groups: "" + any: "any" + host: "" + host_range_start: "" + host_range_end: "" + network: "" + netmask: "" + protocol: "" + port_match: "" + port: "" + port_range_start: "" + port_range_end: "" + icmp_type: "" + - type: "Network" + name: "TEST_NET_OGR" + description: "" + nested_groups: "" + any: "" + host: "1.1.1.1" + host_range_start: "" + host_range_end: "" + network: "" + netmask: "" + protocol: "" + port_match: "" + port: "" + port_range_start: "" + port_range_end: "" + icmp_type: "" + - type: "Network" + name: "TEST_NET_OGR" + description: "" + nested_groups: "" + any: "" + host: "" + host_range_start: "2.2.2.2" + host_range_end: "3.3.3.3" + network: "" + netmask: "" + protocol: "" + port_match: "" + port: "" + port_range_start: "" + port_range_end: "" + icmp_type: "" + - type: "Network" + name: "TEST_NET_OGR" + description: "" + nested_groups: "NNNN" + any: "" + host: "" + host_range_start: "" + host_range_end: "" + network: "" + netmask: "" + protocol: "" + port_match: "" + port: "" + port_range_start: "" + port_range_end: "" + icmp_type: "" + - type: "Network" + name: "TEST_NET_OGR" + description: "" + nested_groups: "" + any: "" + host: "" + host_range_start: "" + host_range_end: "" + network: "1.1.1.0" + netmask: "255.255.255.0" + protocol: "" + port_match: "" + port: "" + port_range_start: "" + port_range_end: "" + icmp_type: "" + - type: "Network" + name: "XXXX" + description: "" + nested_groups: "" + any: "" + host: "" + host_range_start: "" + host_range_end: "" + network: "" + netmask: "" + protocol: "" + port_match: "" + port: "" + port_range_start: "" + port_range_end: "" + icmp_type: "" + - type: "Network" + name: "YYYY" + description: "" + nested_groups: "" + any: "" + host: "" + host_range_start: "" + host_range_end: "" + network: "" + netmask: "" + protocol: "" + port_match: "" + port: "" + port_range_start: "" + port_range_end: "" + icmp_type: ""