diff --git a/ntc_templates/templates/index b/ntc_templates/templates/index index 819c4f2dd9..880dde377c 100644 --- a/ntc_templates/templates/index +++ b/ntc_templates/templates/index @@ -703,6 +703,7 @@ mikrotik_routeros_ip_firewall_address-list_print_terse.textfsm, .*, mikrotik_rou 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_log_print_detail_without-paging.textfsm, .*, mikrotik_routeros, [[/]]log p[[rint]] d[[etail]] wi[[thout-paging]] +mikrotik_routeros_routing_bgp_peer_print_status.textfsm, .*, mikrotik_routeros, [[/]]r[[outing]] bg[[p]] p[[eer]] p[[rint]] s[[tatus]] mikrotik_routeros_ip_arp_print_without-paging.textfsm, .*, mikrotik_routeros, [[/]]ip arp print without-paging mikrotik_routeros_ip_address_export_verbose.textfsm, .*, mikrotik_routeros, [[/]]ip a[[ddress]] e[[xport]] [[verbose]] mikrotik_routeros_interface_ethernet_print.textfsm, .*, mikrotik_routeros, [[/]]in[[terface]] et[[hernet]] pr[[int]] diff --git a/ntc_templates/templates/mikrotik_routeros_routing_bgp_peer_print_status.textfsm b/ntc_templates/templates/mikrotik_routeros_routing_bgp_peer_print_status.textfsm new file mode 100644 index 0000000000..a157fcedc0 --- /dev/null +++ b/ntc_templates/templates/mikrotik_routeros_routing_bgp_peer_print_status.textfsm @@ -0,0 +1,11 @@ +Value BGP_NEIGHBOR (\S+) +Value NEIGHBOR_AS (\d+) +Value UP_DOWN (\S+) +Value STATE (\S+) + +Start + ^\s*Flags:\s+X\s+-\s+disabled,\s+E\s+-\s+established\s*$$ + ^.*remote-address=${BGP_NEIGHBOR}.*remote-as=${NEIGHBOR_AS}.*(?:uptime=${UP_DOWN})?.*$$ + ^.*state=${STATE}.*$$ -> Record + ^\s*$$ + ^. -> Error diff --git a/tests/mikrotik_routeros/routing_bgp_peer_print_status/mikrotik_routeros_routing_bgp_peer_print_status.raw b/tests/mikrotik_routeros/routing_bgp_peer_print_status/mikrotik_routeros_routing_bgp_peer_print_status.raw new file mode 100644 index 0000000000..f983bf770f --- /dev/null +++ b/tests/mikrotik_routeros/routing_bgp_peer_print_status/mikrotik_routeros_routing_bgp_peer_print_status.raw @@ -0,0 +1,3 @@ +Flags: X - disabled, E - established + 0 name="peer1" instance=default remote-address=192.168.1.134 remote-as=65001 tcp-md5-key="" nexthop-choice=default multihop=no route-reflect=no hold-time=3m + ttl=255 in-filter="" out-filter="" address-families=ip,ipv6 default-originate=never remove-private-as=no as-override=no passive=no use-bfd=no state=opensent diff --git a/tests/mikrotik_routeros/routing_bgp_peer_print_status/mikrotik_routeros_routing_bgp_peer_print_status.yml b/tests/mikrotik_routeros/routing_bgp_peer_print_status/mikrotik_routeros_routing_bgp_peer_print_status.yml new file mode 100644 index 0000000000..815f33953a --- /dev/null +++ b/tests/mikrotik_routeros/routing_bgp_peer_print_status/mikrotik_routeros_routing_bgp_peer_print_status.yml @@ -0,0 +1,6 @@ +--- +parsed_sample: + - bgp_neighbor: "192.168.1.134" + neighbor_as: "65001" + state: "opensent" + up_down: ""