-
Notifications
You must be signed in to change notification settings - Fork 737
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Fortinet get hardware nic nic-name'template (#1488)
Co-authored-by: pskliarenko <“[email protected]”>
- Loading branch information
1 parent
0d31dbb
commit 554f8f2
Showing
4 changed files
with
147 additions
and
0 deletions.
There are no files selected for viewing
76 changes: 76 additions & 0 deletions
76
ntc_templates/templates/fortinet_get_hardware_nic_nic-name.textfsm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
Value DESCRIPTION (.+) | ||
Value DRIVER_NAME (.+) | ||
Value BOARD (\w+) | ||
Value LIF_ID (\d+) | ||
Value LIF_OID (\d+) | ||
Value NETDEV_OID (\d+) | ||
Value CURRENT_HWADDR ([a-zA-Z0-9]{2}(:[a-zA-Z0-9]{2}){5}) | ||
Value PERMANENT_HWADDR ([a-zA-Z0-9]{2}(:[a-zA-Z0-9]{2}){5}) | ||
Value ADMIN (\S+) | ||
Value NETDEV_STATUS (\S+) | ||
Value AUTONEGO_SETTING (\d+) | ||
Value LINK_SETTING (\d+) | ||
Value SPEED_SETTING (\d+) | ||
Value DUPLEX_SETTING (\d+) | ||
Value SPEED (\d+) | ||
Value DUPLEX (\S+) | ||
Value LINK_STATUS (\S+) | ||
Value RX_PACKETS (\d+) | ||
Value RX_BYTES (\d+) | ||
Value TX_PACKETS (\d+) | ||
Value TX_BYTES (\d+) | ||
Value HOST_RX_PACKETS (\d+) | ||
Value HOST_RX_BYTES (\d+) | ||
Value HOST_TX_PACKETS (\d+) | ||
Value HOST_TX_BYTES (\d+) | ||
Value HOST_TX_DROPPED (\d+) | ||
Value FRAGTXCREATE (\d+) | ||
Value FRAGTXOK (\d+) | ||
Value FRAGTXDROP (\d+) | ||
Value List MEMBER_PORTS (\[\d+\]:\s+\S+) | ||
|
||
Start | ||
^Description\s*:${DESCRIPTION}\s*$$ | ||
^Driver\s+Name\s*:${DRIVER_NAME}\s*$$ | ||
^Board\s*:${BOARD}\s*$$ | ||
^lif\s+id\s*:${LIF_ID}\s*$$ | ||
^lif\s+oid\s*:${LIF_OID}\s*$$ | ||
^netdev\s+oid\s*:${NETDEV_OID}\s*$$ | ||
^Current_HWaddr\s*${CURRENT_HWADDR}\s*$$ | ||
^Permanent_HWaddr\s*${PERMANENT_HWADDR}\s*$$ | ||
^=+\s+Link\s+Status\s+=+ -> LinkStatus | ||
^=+\s+Counters\s+=+ -> Counters | ||
^\s*$$ | ||
^. -> Error | ||
|
||
LinkStatus | ||
^Admin\s*:${ADMIN}\s*$$ | ||
^netdev\s+status\s*:${NETDEV_STATUS}\s*$$ | ||
^autonego_setting\s*:${AUTONEGO_SETTING}\s*$$ | ||
^link_setting\s*:${LINK_SETTING}\s*$$ | ||
^speed_setting\s*:${SPEED_SETTING}\s*$$ | ||
^duplex_setting\s*:${DUPLEX_SETTING}\s*$$ | ||
^Speed\s*:${SPEED}\s*$$ | ||
^Duplex\s*:${DUPLEX}\s*$$ | ||
^link_status\s*:${LINK_STATUS}\s*$$ -> Start | ||
^\s*$$ | ||
^. -> Error | ||
|
||
Counters | ||
^Rx\s+Pkts\s*:${RX_PACKETS}\s*$$ | ||
^Rx\s+Bytes\s*:${RX_BYTES}\s*$$ | ||
^Tx\s+Pkts\s*:${TX_PACKETS}\s*$$ | ||
^Tx\s+Bytes\s*:${TX_BYTES}\s*$$ | ||
^Host\s+Rx\s+Pkts\s*:${HOST_RX_PACKETS}\s*$$ | ||
^Host\s+Rx\s+Bytes\s*:${HOST_RX_BYTES}\s*$$ | ||
^Host\s+Tx\s+Pkts\s*:${HOST_TX_PACKETS}\s*$$ | ||
^Host\s+Tx\s+Bytes\s*:${HOST_TX_BYTES}\s*$$ | ||
^Host\s+Tx\s+dropped\s*:${HOST_TX_DROPPED}\s*$$ | ||
^FragTxCreate\s*:${FRAGTXCREATE}\s*$$ | ||
^FragTxOk\s*:${FRAGTXOK}\s*$$ | ||
^FragTxDrop\s*:${FRAGTXDROP}\s*$$ | ||
# No 'Member Ports' parsing | ||
^Member\s+Ports\s*\:\s*$$ | ||
^\s*${MEMBER_PORTS}\s*$$ | ||
^\s*$$ | ||
^. -> Error |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
tests/fortinet/get_hardware_nic_nic-name/fortinet_get_hardware_nic_nic-name.raw
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
Description :FortiASIC NP6XLITE Adapter | ||
Driver Name :FortiASIC NP6XLITE Driver | ||
Board :40F | ||
lif id :7 | ||
lif oid :71 | ||
netdev oid :71 | ||
Current_HWaddr 12:34:56:78:90:ab | ||
Permanent_HWaddr 12:34:56:78:90:ab | ||
========== Link Status ========== | ||
Admin :up | ||
netdev status :N/A | ||
autonego_setting:1 | ||
link_setting :0 | ||
speed_setting :1000 | ||
duplex_setting :1 | ||
Speed :100 | ||
Duplex :Full | ||
link_status :Up | ||
============ Counters =========== | ||
Rx Pkts :645878 | ||
Rx Bytes :62442497 | ||
Tx Pkts :1025883 | ||
Tx Bytes :76984876 | ||
Host Rx Pkts :1395584 | ||
Host Rx Bytes :87501251 | ||
Host Tx Pkts :933331 | ||
Host Tx Bytes :69433499 | ||
Host Tx dropped :0 | ||
FragTxCreate :0 | ||
FragTxOk :0 | ||
FragTxDrop :0 | ||
Member Ports : | ||
[00]: a | ||
[01]: lan1 | ||
[02]: lan2 |
35 changes: 35 additions & 0 deletions
35
tests/fortinet/get_hardware_nic_nic-name/fortinet_get_hardware_nic_nic-name.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
parsed_sample: | ||
- admin: "up" | ||
autonego_setting: "1" | ||
board: "40F" | ||
current_hwaddr: "12:34:56:78:90:ab" | ||
description: "FortiASIC NP6XLITE Adapter" | ||
driver_name: "FortiASIC NP6XLITE Driver" | ||
duplex: "Full" | ||
duplex_setting: "1" | ||
fragtxcreate: "0" | ||
fragtxdrop: "0" | ||
fragtxok: "0" | ||
host_rx_bytes: "87501251" | ||
host_rx_packets: "1395584" | ||
host_tx_bytes: "69433499" | ||
host_tx_dropped: "0" | ||
host_tx_packets: "933331" | ||
lif_id: "7" | ||
lif_oid: "71" | ||
link_setting: "0" | ||
link_status: "Up" | ||
member_ports: | ||
- "[00]: a" | ||
- "[01]: lan1" | ||
- "[02]: lan2" | ||
netdev_oid: "71" | ||
netdev_status: "N/A" | ||
permanent_hwaddr: "12:34:56:78:90:ab" | ||
rx_bytes: "62442497" | ||
rx_packets: "645878" | ||
speed: "100" | ||
speed_setting: "1000" | ||
tx_bytes: "76984876" | ||
tx_packets: "1025883" |