diff --git a/ntc_templates/templates/fortinet_fnsysctl_ifconfig.textfsm b/ntc_templates/templates/fortinet_fnsysctl_ifconfig.textfsm new file mode 100644 index 0000000000..c601476824 --- /dev/null +++ b/ntc_templates/templates/fortinet_fnsysctl_ifconfig.textfsm @@ -0,0 +1,37 @@ +Value NIC (.*?) +Value LINK_ENCAP (.*?) +Value HARDWARE_ADDRESS ([a-zA-Z0-9]{2}(:[a-zA-Z0-9]{2}){5}) +Value IP_ADDRESS (\S+) +Value BCAST (\S+) +Value MASK (\S+) +Value LINK_LOCAL6 (\S+) +Value LINK_LOCAL6_PREFIXLEN (\d+) +Value MULTICAST (.*(? Record + ^\s*$$ + ^. -> Error diff --git a/ntc_templates/templates/index b/ntc_templates/templates/index index da1bfd6461..24507ac374 100644 --- a/ntc_templates/templates/index +++ b/ntc_templates/templates/index @@ -496,6 +496,7 @@ fortinet_get_system_interface_physical.textfsm, .*, fortinet, g[[et]] sy[[stem]] fortinet_get_router_info_bgp_summary.textfsm, .*, fortinet, g[[et]] r[[outer]] info bg[[p]] su[[mmary]] fortinet_get_system_ha_status.textfsm, .*, fortinet, g[[et]] sy[[stem]] ha s[[tatus]] fortinet_get_system_interface.textfsm, .*, fortinet, g[[et]] sy[[stem]] in[[terface]] +fortinet_fnsysctl_ifconfig.textfsm, .*, fortinet, fnsysctl ifconfig fortinet_get_system_status.textfsm, .*, fortinet, g[[et]] sy[[stem]] stat[[us]] fortinet_get_system_arp.textfsm, .*, fortinet, g[[et]] sy[[stem]] arp diff --git a/tests/fortinet/fnsysctl_ifconfig/fortinet_fnsysctl_ifconfig.raw b/tests/fortinet/fnsysctl_ifconfig/fortinet_fnsysctl_ifconfig.raw new file mode 100644 index 0000000000..079240d015 --- /dev/null +++ b/tests/fortinet/fnsysctl_ifconfig/fortinet_fnsysctl_ifconfig.raw @@ -0,0 +1,84 @@ +nturbo_rx Link encap:Ethernet + UP BROADCAST MULTICAST MTU:1500 Metric:1 + RX packets:0 errors:0 dropped:0 overruns:0 frame:0 + TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 + collisions:0 txqueuelen:1000 + RX bytes:0 (0 Bytes) TX bytes:0 (0 Bytes) + +wan Link encap:Ethernet HWaddr 12:34:56:78:90:AA + inet addr:1.2.3.4 Bcast:1.2.3.5 Mask:255.255.255.252 + UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 + RX packets:7513822 errors:0 dropped:0 overruns:0 frame:0 + TX packets:12533342 errors:0 dropped:0 overruns:0 carrier:0 + collisions:0 txqueuelen:1000 + RX bytes:1116754241 (1.0 GB) TX bytes:2218288063 (2.1 GB) + +lan1 Link encap:Ethernet HWaddr 12:34:56:78:90:AB + UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 + RX packets:3336406 errors:0 dropped:0 overruns:0 frame:0 + TX packets:3382703 errors:0 dropped:0 overruns:0 carrier:0 + collisions:0 txqueuelen:1000 + RX bytes:258477533 (246.5 MB) TX bytes:365165072 (348.2 MB) + +ssl.root Link encap:Unknown + UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1 + RX packets:0 errors:0 dropped:0 overruns:0 frame:0 + TX packets:0 errors:0 dropped:2 overruns:0 carrier:0 + collisions:0 txqueuelen:0 + RX bytes:0 (0 Bytes) TX bytes:0 (0 Bytes) + +Loopback772 Link encap:Unknown + inet addr:127.0.0.1 Bcast:0.0.0.0 Mask:255.0.0.0 + UP BROADCAST LOOPBACK RUNNING NOARP MULTICAST MTU:1500 Metric:1 + RX packets:0 errors:0 dropped:0 overruns:0 frame:0 + TX packets:2 errors:0 dropped:0 overruns:0 carrier:0 + collisions:0 txqueuelen:0 + RX bytes:0 (0 Bytes) TX bytes:152 (152 Bytes) + +lan Link encap:Ethernet HWaddr 12:34:56:78:90:AC + inet addr:10.152.1.230 Bcast:10.152.1.231 Mask:255.255.255.252 + UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 + RX packets:1695331 errors:0 dropped:0 overruns:0 frame:0 + TX packets:2829487 errors:0 dropped:0 overruns:0 carrier:0 + collisions:0 txqueuelen:1000 + RX bytes:154509025 (147.4 MB) TX bytes:320990192 (306.1 MB) + +Tu-Hub01-Main Link encap:Unknown + inet addr:10.149.0.69 Mask:255.255.0.0 + UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1438 Metric:1 + RX packets:2669 errors:0 dropped:0 overruns:0 frame:0 + TX packets:64643 errors:0 dropped:0 overruns:0 carrier:0 + collisions:0 txqueuelen:0 + RX bytes:919078 (897.5 KB) TX bytes:5464602 (5.2 MB) + +Tu-Rsnnc-Main Link encap:Unknown HWaddr 12:34:56:78:90:AD + inet addr:192.168.64.10 Mask:255.255.255.252 + link-local6: fe80::200:aaaa:5f4f:54f4 prefixlen 64 + UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1476 Metric:1 + RX packets:121755 errors:0 dropped:0 overruns:0 frame:0 + TX packets:1 errors:0 dropped:0 overruns:0 carrier:0 + collisions:0 txqueuelen:0 + RX bytes:8018365 (7.6 MB) TX bytes:84 (84 Bytes) + +Vlan1 Link encap:Ethernet HWaddr 12:34:56:78:90:AE + inet addr:10.100.105.1 Bcast:10.100.105.31 Mask:255.255.255.224 + UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 + RX packets:69882 errors:0 dropped:0 overruns:0 frame:0 + TX packets:65 errors:0 dropped:0 overruns:0 carrier:0 + collisions:0 txqueuelen:0 + RX bytes:10988958 (10.5 MB) TX bytes:3128 (3.1 KB) + +port_ha Link encap:Ethernet HWaddr 12:34:56:78:90:AF + UP BROADCAST MULTICAST MTU:1496 Metric:1 + RX packets:0 errors:0 dropped:0 overruns:0 frame:0 + TX packets:0 errors:0 dropped:1 overruns:0 carrier:0 + collisions:0 txqueuelen:1000 + RX bytes:0 (0 Bytes) TX bytes:0 (0 Bytes) + +vsys_fgfm Link encap:Local Loopback + inet addr:127.0.0.1 Mask:255.0.0.0 + UP LOOPBACK RUNNING MTU:16436 Metric:1 + RX packets:0 errors:0 dropped:0 overruns:0 frame:0 + TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 + collisions:0 txqueuelen:0 + RX bytes:0 (0 Bytes) TX bytes:0 (0 Bytes) diff --git a/tests/fortinet/fnsysctl_ifconfig/fortinet_fnsysctl_ifconfig.yml b/tests/fortinet/fnsysctl_ifconfig/fortinet_fnsysctl_ifconfig.yml new file mode 100644 index 0000000000..3bc2fafb90 --- /dev/null +++ b/tests/fortinet/fnsysctl_ifconfig/fortinet_fnsysctl_ifconfig.yml @@ -0,0 +1,277 @@ +--- +parsed_sample: + - bcast: "" + collisions: "0" + hardware_address: "" + ip_address: "" + link_encap: "Ethernet" + link_local6: "" + link_local6_prefixlen: "" + mask: "" + metric: "1" + mtu: "1500" + multicast: "UP BROADCAST MULTICAST" + nic: "nturbo_rx" + rx_bytes: "0" + rx_dropped: "0" + rx_errors: "0" + rx_frame: "0" + rx_overruns: "0" + rx_packets: "0" + tx_bytes: "0" + tx_carrier: "0" + tx_dropped: "0" + tx_errors: "0" + tx_overruns: "0" + tx_packets: "0" + tx_queue_len: "1000" + - bcast: "1.2.3.5" + collisions: "0" + hardware_address: "12:34:56:78:90:AA" + ip_address: "1.2.3.4" + link_encap: "Ethernet" + link_local6: "" + link_local6_prefixlen: "" + mask: "255.255.255.252" + metric: "1" + mtu: "1500" + multicast: "UP BROADCAST RUNNING MULTICAST" + nic: "wan" + rx_bytes: "1116754241" + rx_dropped: "0" + rx_errors: "0" + rx_frame: "0" + rx_overruns: "0" + rx_packets: "7513822" + tx_bytes: "2218288063" + tx_carrier: "0" + tx_dropped: "0" + tx_errors: "0" + tx_overruns: "0" + tx_packets: "12533342" + tx_queue_len: "1000" + - bcast: "" + collisions: "0" + hardware_address: "12:34:56:78:90:AB" + ip_address: "" + link_encap: "Ethernet" + link_local6: "" + link_local6_prefixlen: "" + mask: "" + metric: "1" + mtu: "1500" + multicast: "UP BROADCAST RUNNING MULTICAST" + nic: "lan1" + rx_bytes: "258477533" + rx_dropped: "0" + rx_errors: "0" + rx_frame: "0" + rx_overruns: "0" + rx_packets: "3336406" + tx_bytes: "365165072" + tx_carrier: "0" + tx_dropped: "0" + tx_errors: "0" + tx_overruns: "0" + tx_packets: "3382703" + tx_queue_len: "1000" + - bcast: "" + collisions: "0" + hardware_address: "" + ip_address: "" + link_encap: "Unknown" + link_local6: "" + link_local6_prefixlen: "" + mask: "" + metric: "1" + mtu: "1500" + multicast: "UP POINTOPOINT RUNNING NOARP MULTICAST" + nic: "ssl.root" + rx_bytes: "0" + rx_dropped: "0" + rx_errors: "0" + rx_frame: "0" + rx_overruns: "0" + rx_packets: "0" + tx_bytes: "0" + tx_carrier: "0" + tx_dropped: "2" + tx_errors: "0" + tx_overruns: "0" + tx_packets: "0" + tx_queue_len: "0" + - bcast: "0.0.0.0" + collisions: "0" + hardware_address: "" + ip_address: "127.0.0.1" + link_encap: "Unknown" + link_local6: "" + link_local6_prefixlen: "" + mask: "255.0.0.0" + metric: "1" + mtu: "1500" + multicast: "UP BROADCAST LOOPBACK RUNNING NOARP MULTICAST" + nic: "Loopback772" + rx_bytes: "0" + rx_dropped: "0" + rx_errors: "0" + rx_frame: "0" + rx_overruns: "0" + rx_packets: "0" + tx_bytes: "152" + tx_carrier: "0" + tx_dropped: "0" + tx_errors: "0" + tx_overruns: "0" + tx_packets: "2" + tx_queue_len: "0" + - bcast: "10.152.1.231" + collisions: "0" + hardware_address: "12:34:56:78:90:AC" + ip_address: "10.152.1.230" + link_encap: "Ethernet" + link_local6: "" + link_local6_prefixlen: "" + mask: "255.255.255.252" + metric: "1" + mtu: "1500" + multicast: "UP BROADCAST RUNNING MULTICAST" + nic: "lan" + rx_bytes: "154509025" + rx_dropped: "0" + rx_errors: "0" + rx_frame: "0" + rx_overruns: "0" + rx_packets: "1695331" + tx_bytes: "320990192" + tx_carrier: "0" + tx_dropped: "0" + tx_errors: "0" + tx_overruns: "0" + tx_packets: "2829487" + tx_queue_len: "1000" + - bcast: "" + collisions: "0" + hardware_address: "" + ip_address: "10.149.0.69" + link_encap: "Unknown" + link_local6: "" + link_local6_prefixlen: "" + mask: "255.255.0.0" + metric: "1" + mtu: "1438" + multicast: "UP POINTOPOINT RUNNING NOARP MULTICAST" + nic: "Tu-Hub01-Main" + rx_bytes: "919078" + rx_dropped: "0" + rx_errors: "0" + rx_frame: "0" + rx_overruns: "0" + rx_packets: "2669" + tx_bytes: "5464602" + tx_carrier: "0" + tx_dropped: "0" + tx_errors: "0" + tx_overruns: "0" + tx_packets: "64643" + tx_queue_len: "0" + - bcast: "" + collisions: "0" + hardware_address: "12:34:56:78:90:AD" + ip_address: "192.168.64.10" + link_encap: "Unknown" + link_local6: "fe80::200:aaaa:5f4f:54f4" + link_local6_prefixlen: "64" + mask: "255.255.255.252" + metric: "1" + mtu: "1476" + multicast: "UP POINTOPOINT RUNNING NOARP MULTICAST" + nic: "Tu-Rsnnc-Main" + rx_bytes: "8018365" + rx_dropped: "0" + rx_errors: "0" + rx_frame: "0" + rx_overruns: "0" + rx_packets: "121755" + tx_bytes: "84" + tx_carrier: "0" + tx_dropped: "0" + tx_errors: "0" + tx_overruns: "0" + tx_packets: "1" + tx_queue_len: "0" + - bcast: "10.100.105.31" + collisions: "0" + hardware_address: "12:34:56:78:90:AE" + ip_address: "10.100.105.1" + link_encap: "Ethernet" + link_local6: "" + link_local6_prefixlen: "" + mask: "255.255.255.224" + metric: "1" + mtu: "1500" + multicast: "UP BROADCAST RUNNING MULTICAST" + nic: "Vlan1" + rx_bytes: "10988958" + rx_dropped: "0" + rx_errors: "0" + rx_frame: "0" + rx_overruns: "0" + rx_packets: "69882" + tx_bytes: "3128" + tx_carrier: "0" + tx_dropped: "0" + tx_errors: "0" + tx_overruns: "0" + tx_packets: "65" + tx_queue_len: "0" + - bcast: "" + collisions: "0" + hardware_address: "12:34:56:78:90:AF" + ip_address: "" + link_encap: "Ethernet" + link_local6: "" + link_local6_prefixlen: "" + mask: "" + metric: "1" + mtu: "1496" + multicast: "UP BROADCAST MULTICAST" + nic: "port_ha" + rx_bytes: "0" + rx_dropped: "0" + rx_errors: "0" + rx_frame: "0" + rx_overruns: "0" + rx_packets: "0" + tx_bytes: "0" + tx_carrier: "0" + tx_dropped: "1" + tx_errors: "0" + tx_overruns: "0" + tx_packets: "0" + tx_queue_len: "1000" + - bcast: "" + collisions: "0" + hardware_address: "" + ip_address: "127.0.0.1" + link_encap: "Local Loopback" + link_local6: "" + link_local6_prefixlen: "" + mask: "255.0.0.0" + metric: "1" + mtu: "16436" + multicast: "UP LOOPBACK RUNNING" + nic: "vsys_fgfm" + rx_bytes: "0" + rx_dropped: "0" + rx_errors: "0" + rx_frame: "0" + rx_overruns: "0" + rx_packets: "0" + tx_bytes: "0" + tx_carrier: "0" + tx_dropped: "0" + tx_errors: "0" + tx_overruns: "0" + tx_packets: "0" + tx_queue_len: "0"