Skip to content

Commit

Permalink
MikroTik RouterOS '/interface print terse without-paging' fix (#1588)
Browse files Browse the repository at this point in the history
* Template + test

* Mark 'mtu' value as unnecessary

* Add missing field 'fast-path' for Mikrotik's command '/interface print terse without-paging'

---------

Co-authored-by: pskliarenko <“[email protected]”>
Co-authored-by: Maxim Shpak <[email protected]>
  • Loading branch information
3 people authored Feb 8, 2024
1 parent a6c582b commit a9deb07
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ 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 FAST_PATH (\S+)
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*${ID}\s+(?:${DYNAMIC})?(?:${STATUS}|\s)?(?:${SLAVE})?\s+(comment=${COMMENT}\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*$$ -> Record
^\s*${ID}\s+(?:${DYNAMIC})?(?:${STATUS}|\s)?(?:${SLAVE})?\s+(comment=${COMMENT}\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+fast-path=${FAST_PATH})?(\s+last-link-down-time=${LAST_LINK_DOWN_TIME})?(\s+last-link-up-time=${LAST_LINK_UP_TIME})?(\s+link-downs=${LINK_DOWNS})?\s*$$ -> Record
^\s*$$
^. -> Error
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@
7 RS name=eth4_vlan3 type=vlan mtu=1500 actual-mtu=1500 l2mtu=1594 mac-address=12:34:56:78:90:BB link-downs=0
8 D S name=eth4_vlan4 type=vlan mtu=1500 actual-mtu=1500 l2mtu=1594 mac-address=12:34:56:78:90:BC link-downs=0
9 DXS name=eth5_vlan5 type=vlan mtu=1500 actual-mtu=1500 l2mtu=1594 mac-address=12:34:56:78:90:BD last-link-up-time=aug/16/1970 13:05:43 link-downs=0
10 R name=eth6_vlan6 type=vlan mtu=1500 actual-mtu=1500 l2mtu=1598 mac-address=12:34:56:78:90:BE fast-path=yes last-link-down-time=sep/08/2023 01:07:00 last-link-up-time=sep/08/2023 01:07:09 link-downs=7
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ parsed_sample:
l2mtu: "1598"
max_l2mtu: "2028"
mac_address: "12:34:56:78:90:AA"
fast_path: ""
last_link_down_time: ""
last_link_up_time: "aug/16/1970 13:05:43"
link_downs: "0"
Expand All @@ -29,6 +30,7 @@ parsed_sample:
l2mtu: "1598"
max_l2mtu: "2028"
mac_address: "12:34:56:78:90:AB"
fast_path: ""
last_link_down_time: "aug/17/1970 13:33:01"
last_link_up_time: "aug/17/1970 13:23:11"
link_downs: "3"
Expand All @@ -45,6 +47,7 @@ parsed_sample:
l2mtu: "1598"
max_l2mtu: "2028"
mac_address: "12:34:56:78:90:AC"
fast_path: ""
last_link_down_time: ""
last_link_up_time: ""
link_downs: "0"
Expand All @@ -61,6 +64,7 @@ parsed_sample:
l2mtu: "1594"
max_l2mtu: ""
mac_address: "12:34:56:78:90:AD"
fast_path: ""
last_link_down_time: ""
last_link_up_time: "aug/16/1970 13:05:35"
link_downs: "0"
Expand All @@ -77,6 +81,7 @@ parsed_sample:
l2mtu: ""
max_l2mtu: ""
mac_address: "12:34:56:78:90:AE"
fast_path: ""
last_link_down_time: ""
last_link_up_time: ""
link_downs: "0"
Expand All @@ -93,6 +98,7 @@ parsed_sample:
l2mtu: "1594"
max_l2mtu: ""
mac_address: "12:34:56:78:90:AF"
fast_path: ""
last_link_down_time: "aug/17/1970 13:33:01"
last_link_up_time: "aug/17/1970 13:23:11"
link_downs: "3"
Expand All @@ -109,6 +115,7 @@ parsed_sample:
l2mtu: "1594"
max_l2mtu: ""
mac_address: "12:34:56:78:90:BA"
fast_path: ""
last_link_down_time: ""
last_link_up_time: ""
link_downs: "0"
Expand All @@ -125,6 +132,7 @@ parsed_sample:
l2mtu: "1594"
max_l2mtu: ""
mac_address: "12:34:56:78:90:BB"
fast_path: ""
last_link_down_time: ""
last_link_up_time: ""
link_downs: "0"
Expand All @@ -141,6 +149,7 @@ parsed_sample:
l2mtu: "1594"
max_l2mtu: ""
mac_address: "12:34:56:78:90:BC"
fast_path: ""
last_link_down_time: ""
last_link_up_time: ""
link_downs: "0"
Expand All @@ -157,6 +166,24 @@ parsed_sample:
l2mtu: "1594"
max_l2mtu: ""
mac_address: "12:34:56:78:90:BD"
fast_path: ""
last_link_down_time: ""
last_link_up_time: "aug/16/1970 13:05:43"
link_downs: "0"
- id: "10"
dynamic: ""
status: "R"
slave: ""
comment: ""
name: "eth6_vlan6"
default_name: ""
type: "vlan"
mtu: "1500"
actual_mtu: "1500"
l2mtu: "1598"
max_l2mtu: ""
mac_address: "12:34:56:78:90:BE"
fast_path: "yes"
last_link_down_time: "sep/08/2023 01:07:00"
last_link_up_time: "sep/08/2023 01:07:09"
link_downs: "7"

0 comments on commit a9deb07

Please sign in to comment.