-
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 MikroTik RouterOS interface print detail template (#1494)
Co-authored-by: pskliarenko <“[email protected]”> Co-authored-by: Jacob McGill <[email protected]>
- Loading branch information
1 parent
554f8f2
commit 16467e9
Showing
4 changed files
with
201 additions
and
0 deletions.
There are no files selected for viewing
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
30 changes: 30 additions & 0 deletions
30
ntc_templates/templates/mikrotik_routeros_interface_print_detail.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,30 @@ | ||
Value Required ID (\d+) | ||
Value DYNAMIC (D) | ||
Value STATUS (X|R) | ||
Value SLAVE (S) | ||
Value NAME (\S+) | ||
Value List DESCRIPTION ((?!\s*$).+[^\s]) | ||
Value DEFAULT_NAME (\S+) | ||
Value TYPE (\S+) | ||
Value MTU (\d+|auto) | ||
Value ACTUAL_MTU (\d+) | ||
Value L2MTU (\d+|auto) | ||
Value MAX_L2MTU (\d+) | ||
Value MAC_ADDRESS ([a-zA-Z0-9]{2}(?::[a-zA-Z0-9]{2}){5}) | ||
Value LAST_LINK_DOWN_TIME ([a-z]{3}/\d+/\d+\s\d+\:\d+\:\d+) | ||
Value LAST_LINK_UP_TIME ([a-z]{3}/\d+/\d+\s\d+\:\d+\:\d+) | ||
Value LINK_DOWNS (\d+) | ||
|
||
Start | ||
^\s*Flags:\s+D\s+-\s+dynamic,\s+X\s+-\s+disabled,\s+R\s+-\s+running,\s+S\s+-\s+slave\s*$$ -> Interface | ||
^\s*$$ | ||
^. -> Error | ||
|
||
Interface | ||
^\s*\d+(?:\s+D)?(?:\s*X|R)?(?:\s*S)?\s+ -> Continue.Record | ||
^\s*${ID}(?:\s+${DYNAMIC})?(?:\s*${STATUS})?(?:\s*${SLAVE})?\s+name="${NAME}"(?:\s+default-name="${DEFAULT_NAME}")?\s+type="${TYPE}"(\s+mtu=${MTU})?(?:\s+actual-mtu=${ACTUAL_MTU})?(?:\s+l2mtu=${L2MTU})?(?:\s+max-l2mtu=${MAX_L2MTU})?(?:\s+mac-address=${MAC_ADDRESS})?(?:\s+last-link-down-time=${LAST_LINK_DOWN_TIME})?(?:\s+last-link-up-time=${LAST_LINK_UP_TIME})?(?:\s+link-downs=${LINK_DOWNS})?\s*$$ | ||
^\s*name="${NAME}"(?:\s+default-name="${DEFAULT_NAME}")?\s+type="${TYPE}"(\s+mtu=${MTU})?(?:\s+actual-mtu=${ACTUAL_MTU})?(?:\s+l2mtu=${L2MTU})?(?:\s+max-l2mtu=${MAX_L2MTU})?(?:\s+mac-address=${MAC_ADDRESS})?(?:\s+last-link-down-time=${LAST_LINK_DOWN_TIME})?(?:\s+last-link-up-time=${LAST_LINK_UP_TIME})?(?:\s+link-downs=${LINK_DOWNS})?\s*$$ | ||
^\s*${ID}(?:\s+${DYNAMIC})?(?:\s*${STATUS})?(?:\s*${SLAVE})?\s+;{3}\s+${DESCRIPTION}\s*$$ | ||
^${DESCRIPTION}\s*$$ | ||
^\s*$$ | ||
^. -> Error |
21 changes: 21 additions & 0 deletions
21
tests/mikrotik_routeros/interface_print_detail/mikrotik_routeros_interface_print_detail.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,21 @@ | ||
Flags: D - dynamic, X - disabled, R - running, S - slave | ||
0 name="ether1" default-name="ether1" type="ether" mtu=1500 actual-mtu=1500 l2mtu=1598 max-l2mtu=2028 mac-address=12:34:56:78:90:AA last-link-down-time=jul/09/2023 07:18:33 last-link-up-time=jul/09/2023 07:18:42 link-downs=20 | ||
|
||
1 D name="ether2" default-name="ether2" type="ether" mtu=1500 actual-mtu=1500 l2mtu=1598 max-l2mtu=2028 mac-address=12:34:56:78:90:AB last-link-down-time=jul/09/2023 07:18:34 last-link-up-time=jul/09/2023 07:18:43 link-downs=20 | ||
|
||
2 R name="ether3" default-name="ether3" type="ether" mtu=1500 actual-mtu=1500 l2mtu=1598 max-l2mtu=2028 mac-address=12:34:56:78:90:AC link-downs=0 | ||
|
||
3 S name="ether4" default-name="ether4" type="ether" mtu=1500 actual-mtu=1500 l2mtu=1598 max-l2mtu=2028 mac-address=12:34:56:78:90:AD link-downs=0 | ||
|
||
4 DR name="ether5" default-name="ether5" type="ether" mtu=1500 actual-mtu=1500 l2mtu=1598 max-l2mtu=2028 mac-address=12:34:56:78:90:AE link-downs=0 | ||
|
||
5 RS name="ether6" default-name="ether6" type="ether" mtu=1500 actual-mtu=1500 l2mtu=1598 max-l2mtu=2028 mac-address=12:34:56:78:90:AF link-downs=0 | ||
|
||
6 D S name="lte1" type="lte" mtu=1500 actual-mtu=1500 mac-address=12:34:56:78:90:BA last-link-down-time=jul/21/2023 07:47:40 last-link-up-time=jul/21/2023 07:47:46 link-downs=114 | ||
|
||
7 DRS ;;; very very long | ||
multiline description | ||
name="pptp-out1" type="pptp-out" mtu=1450 actual-mtu=1450 last-link-down-time=jul/21/2023 07:47:03 last-link-up-time=jul/21/2023 07:47:56 link-downs=304 | ||
|
||
8 RS ;;; Free Wi-Fi HTTPS | ||
name="pptp-to-AH1100-HS" type="pptp-out" mtu=1596 actual-mtu=1596 last-link-down-time=nov/03/1970 12:24:10 last-link-up-time=nov/03/1970 12:24:10 link-downs=38 |
149 changes: 149 additions & 0 deletions
149
tests/mikrotik_routeros/interface_print_detail/mikrotik_routeros_interface_print_detail.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,149 @@ | ||
--- | ||
parsed_sample: | ||
- actual_mtu: "1500" | ||
default_name: "ether1" | ||
dynamic: "" | ||
id: "0" | ||
l2mtu: "1598" | ||
last_link_down_time: "jul/09/2023 07:18:33" | ||
last_link_up_time: "jul/09/2023 07:18:42" | ||
link_downs: "20" | ||
mac_address: "12:34:56:78:90:AA" | ||
max_l2mtu: "2028" | ||
mtu: "1500" | ||
name: "ether1" | ||
description: [] | ||
slave: "" | ||
status: "" | ||
type: "ether" | ||
- actual_mtu: "1500" | ||
default_name: "ether2" | ||
dynamic: "D" | ||
id: "1" | ||
l2mtu: "1598" | ||
last_link_down_time: "jul/09/2023 07:18:34" | ||
last_link_up_time: "jul/09/2023 07:18:43" | ||
link_downs: "20" | ||
mac_address: "12:34:56:78:90:AB" | ||
max_l2mtu: "2028" | ||
mtu: "1500" | ||
name: "ether2" | ||
description: [] | ||
slave: "" | ||
status: "" | ||
type: "ether" | ||
- actual_mtu: "1500" | ||
default_name: "ether3" | ||
dynamic: "" | ||
id: "2" | ||
l2mtu: "1598" | ||
last_link_down_time: "" | ||
last_link_up_time: "" | ||
link_downs: "0" | ||
mac_address: "12:34:56:78:90:AC" | ||
max_l2mtu: "2028" | ||
mtu: "1500" | ||
name: "ether3" | ||
description: [] | ||
slave: "" | ||
status: "R" | ||
type: "ether" | ||
- actual_mtu: "1500" | ||
default_name: "ether4" | ||
dynamic: "" | ||
id: "3" | ||
l2mtu: "1598" | ||
last_link_down_time: "" | ||
last_link_up_time: "" | ||
link_downs: "0" | ||
mac_address: "12:34:56:78:90:AD" | ||
max_l2mtu: "2028" | ||
mtu: "1500" | ||
name: "ether4" | ||
description: [] | ||
slave: "S" | ||
status: "" | ||
type: "ether" | ||
- actual_mtu: "1500" | ||
default_name: "ether5" | ||
dynamic: "D" | ||
id: "4" | ||
l2mtu: "1598" | ||
last_link_down_time: "" | ||
last_link_up_time: "" | ||
link_downs: "0" | ||
mac_address: "12:34:56:78:90:AE" | ||
max_l2mtu: "2028" | ||
mtu: "1500" | ||
name: "ether5" | ||
description: [] | ||
slave: "" | ||
status: "R" | ||
type: "ether" | ||
- actual_mtu: "1500" | ||
default_name: "ether6" | ||
dynamic: "" | ||
id: "5" | ||
l2mtu: "1598" | ||
last_link_down_time: "" | ||
last_link_up_time: "" | ||
link_downs: "0" | ||
mac_address: "12:34:56:78:90:AF" | ||
max_l2mtu: "2028" | ||
mtu: "1500" | ||
name: "ether6" | ||
description: [] | ||
slave: "S" | ||
status: "R" | ||
type: "ether" | ||
- actual_mtu: "1500" | ||
default_name: "" | ||
dynamic: "D" | ||
id: "6" | ||
l2mtu: "" | ||
last_link_down_time: "jul/21/2023 07:47:40" | ||
last_link_up_time: "jul/21/2023 07:47:46" | ||
link_downs: "114" | ||
mac_address: "12:34:56:78:90:BA" | ||
max_l2mtu: "" | ||
mtu: "1500" | ||
name: "lte1" | ||
description: [] | ||
slave: "S" | ||
status: "" | ||
type: "lte" | ||
- actual_mtu: "1450" | ||
default_name: "" | ||
dynamic: "D" | ||
id: "7" | ||
l2mtu: "" | ||
last_link_down_time: "jul/21/2023 07:47:03" | ||
last_link_up_time: "jul/21/2023 07:47:56" | ||
link_downs: "304" | ||
mac_address: "" | ||
max_l2mtu: "" | ||
mtu: "1450" | ||
name: "pptp-out1" | ||
description: | ||
- "very very long" | ||
- "multiline description" | ||
slave: "S" | ||
status: "R" | ||
type: "pptp-out" | ||
- actual_mtu: "1596" | ||
default_name: "" | ||
dynamic: "" | ||
id: "8" | ||
l2mtu: "" | ||
last_link_down_time: "nov/03/1970 12:24:10" | ||
last_link_up_time: "nov/03/1970 12:24:10" | ||
link_downs: "38" | ||
mac_address: "" | ||
max_l2mtu: "" | ||
mtu: "1596" | ||
name: "pptp-to-AH1100-HS" | ||
description: | ||
- "Free Wi-Fi HTTPS" | ||
slave: "S" | ||
status: "R" | ||
type: "pptp-out" |