Skip to content

Commit

Permalink
Template + test (#1512)
Browse files Browse the repository at this point in the history
  • Loading branch information
PavloSkliarenko authored Dec 26, 2023
1 parent 0c83b26 commit e6be40d
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 0 deletions.
1 change: 1 addition & 0 deletions ntc_templates/templates/index
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,7 @@ mikrotik_routeros_snmp_community_print_without-paging.textfsm, .*, mikrotik_rout
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_ip_arp_print_without-paging.textfsm, .*, mikrotik_routeros, [[/]]ip arp print without-paging
mikrotik_routeros_interface_ethernet_print.textfsm, .*, mikrotik_routeros, [[/]]in[[terface]] et[[hernet]] pr[[int]]
mikrotik_routeros_system_routerboard_print.textfsm, .*, mikrotik_routeros, [[/]]system routerboard print
mikrotik_routeros_ip_route_print_terse.textfsm, .*, mikrotik_routeros, [[/]]ip(v6)? route print terse
mikrotik_routeros_system_clock_print.textfsm, .*, mikrotik_routeros, [[/]]sy[[stem]] cl[[ock]] p[[rint]]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
Value ID (\d+)
Value STATUS (X|R)
Value SLAVE (S)
Value NAME (\S+)
Value MTU (\d+)
Value MAC_ADDRESS ([a-zA-Z0-9]{2}(:[a-zA-Z0-9]{2}){5})
Value ARP (\S+)
Value SWITCH (\S+)

Start
^\s*Flags:\s+X\s+-\s+disabled,\s+R\s+-\s+running,\s+S\s+-\s+slave\s*$$
^\s*#\s+NAME\s+MTU\s+MAC-ADDRESS\s+ARP\s+SWITCH\s*$$ -> IfacesTable

IfacesTable
^\s*${ID}\s+(?:${STATUS})?(?:${SLAVE})?\s+${NAME}\s+${MTU}\s+${MAC_ADDRESS}\s+${ARP}\s+${SWITCH}\s*$$ -> Record
^\s*$$
^. -> Error
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Flags: X - disabled, R - running, S - slave
# NAME MTU MAC-ADDRESS ARP SWITCH
0 ether1 1500 12:34:56:78:90:AA enabled switch1
1 R ether2 1500 12:34:56:78:90:AB enabled switch1
2 XS ether3 1500 12:34:56:78:90:AC enabled switch1
3 S ether4 1500 12:34:56:78:90:AD enabled switch1
4 R ether5 1500 12:34:56:78:90:AE enabled switch1
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
parsed_sample:
- id: "0"
status: ""
slave: ""
name: "ether1"
mtu: "1500"
mac_address: "12:34:56:78:90:AA"
arp: "enabled"
switch: "switch1"
- id: "1"
status: "R"
slave: ""
name: "ether2"
mtu: "1500"
mac_address: "12:34:56:78:90:AB"
arp: "enabled"
switch: "switch1"
- id: "2"
status: "X"
slave: "S"
name: "ether3"
mtu: "1500"
mac_address: "12:34:56:78:90:AC"
arp: "enabled"
switch: "switch1"
- id: "3"
status: ""
slave: "S"
name: "ether4"
mtu: "1500"
mac_address: "12:34:56:78:90:AD"
arp: "enabled"
switch: "switch1"
- id: "4"
status: "R"
slave: ""
name: "ether5"
mtu: "1500"
mac_address: "12:34:56:78:90:AE"
arp: "enabled"
switch: "switch1"

0 comments on commit e6be40d

Please sign in to comment.