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

Add: mikrotik_routeros_routing_ospf_interface_print_terse #1910

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions ntc_templates/templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -737,6 +737,7 @@ mikrotik_routeros_ip_firewall_address-list_print_terse.textfsm, .*, mikrotik_rou
mikrotik_routeros_ip_route_print_terse_without-paging.textfsm, .*, mikrotik_routeros, [[/]]ip r[[oute]] p[[rint]] t[[erse]] wi[[thout-paging]]
mikrotik_routeros_snmp_community_print_without-paging.textfsm, .*, mikrotik_routeros, [[/]]snmp community print without-paging
mikrotik_routeros_ipv6_neighbor_print_without-paging.textfsm, .*, mikrotik_routeros, [[/]]ipv6 neighbor print without-paging
mikrotik_routeros_routing_ospf_interface_print_terse.textfsm, .*, mikrotik_routeros, [[/]]r[[outing]] o[[spf]] in[[terface]] p[[rint]] t[[erse]]
mikrotik_routeros_ip_arp_print_terse_without-paging.textfsm, .*, mikrotik_routeros, [[/]]ip a[[rp]] p[[rint]] t[[erse]] wi[[thout-paging]]
mikrotik_routeros_log_print_detail_without-paging.textfsm, .*, mikrotik_routeros, [[/]]log p[[rint]] d[[etail]] wi[[thout-paging]]
mikrotik_routeros_interface_bonding_print_detail.textfsm, .*, mikrotik_routeros, [[/]]in[[terface]] bo[[nding]] p[[rint]] d[[etail]]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Value INTERFACE (\S+)
Value DYNAMIC (D)
Value PASSIVE (P|passive)
Value COST (\d+)

Start
^\s*\d+\s*(${DYNAMIC}\s*)?(${PASSIVE}\s*)?(comment=.+?)?interface=${INTERFACE}\s*cost=${COST}\s*priority=\d+\s*authentication=\S+\s*authentication-key=(?:")?\S+(?:")?\s*authentication-key-id=\d+\s*network-type=\S+\s*instance-id=\d+\s*retransmit-interval=\d+s\s*transmit-delay=\d+s\s*hello-interval=\d+s\s*dead-interval=\d+s\s*use-bfd=\S+$$ -> Record
^\s*\d+\s*(D\s*)?address=\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}%${INTERFACE}\s*area=\S+\s*state=(${PASSIVE}|\S+)\s*network-type=\S+\s*cost=${COST}\s*(priority=\d+\s*)?use-bfd=\S+\s*retransmit-interval=\d+s\s*transmit-delay=\d+s\s*hello-interval=\d+s\s*dead-interval=\d+s\s*$$ -> Record

This comment was marked as outdated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In RouterOS 7, all interfaces in the 'routing ospf interface print terse' output are marked with 'D' even though the interfaces are not actually dynamically added into OSPF (unlike RouterOS 6), hence why it's ignored.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @kwood92 for the details.
I don't work with RouterOS much these days so I wasn't aware. 🫣

^\s*$$
^. -> Error
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
0 P interface=all cost=10 priority=1 authentication=none authentication-key=foo authentication-key-id=1 network-type=broadcast instance-id=0 retransmit-interval=5s transmit-delay=1s hello-interval=10s dead-interval=40s use-bfd=no
1 comment=ospf comment interface=vlan906@bond1 cost=10 priority=1 authentication=none authentication-key="bar" authentication-key-id=1 network-type=broadcast instance-id=0 retransmit-interval=5s transmit-delay=1s hello-interval=10s dead-interval=40s use-bfd=no
2 DP interface=lo0 cost=10 priority=1 authentication=none authentication-key="" authentication-key-id=1 network-type=broadcast instance-id=0 retransmit-interval=5s transmit-delay=1s hello-interval=10s dead-interval=40s use-bfd=no
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
parsed_sample:
- cost: "10"
dynamic: ""
interface: "all"
passive: "P"
- cost: "10"
dynamic: ""
interface: "vlan906@bond1"
passive: ""
- cost: "10"
dynamic: "D"
interface: "lo0"
passive: "P"
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
0 D address=1.1.1.1%vlan11@vlan975@sfp-sfpplus1 area=INET-v2 state=ptp network-type=ptp cost=1400 use-bfd=no retransmit-interval=5s transmit-delay=1s hello-interval=1s dead-interval=4s
1 D address=1.1.1.1%vlan10@vlan975@sfp-sfpplus1 area=MGMT-v2 state=ptp network-type=ptp cost=10 use-bfd=no retransmit-interval=5s transmit-delay=1s hello-interval=10s dead-interval=40s
2 D address=1.1.1.1%Lo0 area=MGMT-v2 state=passive network-type=broadcast cost=1 priority=128 use-bfd=no retransmit-interval=5s transmit-delay=1s hello-interval=10s dead-interval=40s
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
parsed_sample:
- cost: "1400"
dynamic: ""
interface: "vlan11@vlan975@sfp-sfpplus1"
passive: ""
- cost: "10"
dynamic: ""
interface: "vlan10@vlan975@sfp-sfpplus1"
passive: ""
- cost: "1"
dynamic: ""
Comment on lines +4 to +12

This comment was marked as outdated.

interface: "Lo0"
passive: "passive"