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

Fortinet 'fnsysctl ifconfig' template #1484

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions ntc_templates/templates/fortinet_fnsysctl_ifconfig.textfsm
Original file line number Diff line number Diff line change
@@ -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 (.*(?<!\s))
Value MTU (\d+)
Value METRIC (\d+)
Value RX_PACKETS (\d+)
Value RX_ERRORS (\d+)
Value RX_DROPPED (\d+)
Value RX_OVERRUNS (\d+)
Value RX_FRAME (\d+)
Value TX_PACKETS (\d+)
Value TX_ERRORS (\d+)
Value TX_DROPPED (\d+)
Value TX_OVERRUNS (\d+)
Value TX_CARRIER (\d+)
Value COLLISIONS (\d+)
Value TX_QUEUE_LEN (\d+)
Value RX_BYTES (\d+)
Value TX_BYTES (\d+)

Start
^\s*${NIC}\s+Link\s+encap:${LINK_ENCAP}(?:\s+HWaddr\s+${HARDWARE_ADDRESS})?\s*$$
^\s*inet\s+addr:${IP_ADDRESS}(?:\s+Bcast:${BCAST})?\s+Mask:${MASK}\s*$$
^\s*link-local6:\s+${LINK_LOCAL6}\s+prefixlen\s+${LINK_LOCAL6_PREFIXLEN}\s*$$
^\s*${MULTICAST}\s+MTU:${MTU}\s+Metric:${METRIC}\s*$$
^\s*RX\s+packets:${RX_PACKETS}\s+errors:${RX_ERRORS}\s+dropped:${RX_DROPPED}\s+overruns:${RX_OVERRUNS}\s+frame:${RX_FRAME}\s*$$
^\s*TX\s+packets:${TX_PACKETS}\s+errors:${TX_ERRORS}\s+dropped:${TX_DROPPED}\s+overruns:${TX_OVERRUNS}\s+carrier:${TX_CARRIER}\s*$$
^\s*collisions:${COLLISIONS}\s+txqueuelen:${TX_QUEUE_LEN}\s*$$
^\s*RX\s+bytes:${RX_BYTES}\s+\(.*\)\s+TX\s+bytes:${TX_BYTES}\s+\(.*\)\s*$$ -> Record
^\s*$$
^. -> Error
1 change: 1 addition & 0 deletions ntc_templates/templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
84 changes: 84 additions & 0 deletions tests/fortinet/fnsysctl_ifconfig/fortinet_fnsysctl_ifconfig.raw
Original file line number Diff line number Diff line change
@@ -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)
Loading
Loading