Skip to content

Commit e436770

Browse files
authored
Add Mikrotik RouterOS interface wireguard peers print terse without-paging (#2257)
* New template for Mikrotik RouterOS: `interface wireguard peers print terse without-paging` * fixing rx_bytes and tx_bytes
1 parent 67fdd38 commit e436770

File tree

4 files changed

+57
-0
lines changed

4 files changed

+57
-0
lines changed

ntc_templates/templates/index

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,7 @@ linux_arp_-a.textfsm, .*, linux, arp -a
846846
linux_vzlist.textfsm, .*, linux, vzlist
847847
linux_top.textfsm, .*, linux, top
848848

849+
mikrotik_routeros_interface_wireguard_peers_print_terse_without-paging.textfsm, .*, mikrotik_routeros, [[/]]in[[terface]] wi[[reguard]] p[[eers]] p[[rint]] t[[erse]] wi[[thout-paging]]
849850
mikrotik_routeros_interface_bridge_host_print_terse_without-paging.textfsm, .*, mikrotik_routeros, [[/]]in[[terface]] b[[ridge]] h[[ost]] p[[rint]] t[[erse]] wi[[thout-paging]]
850851
mikrotik_routeros_ip_hotspot_ip-binding_print_terse_without-paging.textfsm, .*, mikrotik_routeros, [[/]]ip h[[otspot]] ip-b[[inding]] p[[rint]] t[[erse]] wi[[thout-paging]]
851852
mikrotik_routeros_routing_ospf_neighbor_print_terse_without-paging.textfsm, .*, mikrotik_routeros, [[/]]r[[outing]] o[[spf]] nei[[ghbor]] p[[rint]] t[[erse]] wi[[thout-paging]]
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
Value INDEX (\d+)
2+
Value INTERFACE (\S.+\S|\S+)
3+
Value NAME (\S.+\S|\S+)
4+
Value PUBLIC_KEY (\S+)
5+
Value PRIVATE_KEY (\S+)
6+
Value ENDPOINT_ADDRESS (\S+)
7+
Value ENDPOINT_PORT (\d+)
8+
Value CURRENT_ENDPOINT_ADDRESS (\S+)
9+
Value CURRENT_ENDPOINT_PORT (\d+)
10+
Value ALLOWED_ADDRESS (\S+)
11+
Value PRESHARED_KEY (\S+)
12+
Value CLIENT_ADDRESS (\S+)
13+
Value CLIENT_ENDPOINT (\S+)
14+
Value RX_BYTES (\S+)
15+
Value TX_BYTES (\S+)
16+
Value LAST_HANDSHAKE (\S+)
17+
18+
Start
19+
^\s*${INDEX}\s+interface=${INTERFACE}\s+name=${NAME}\s+public-key=${PUBLIC_KEY}?\s+private-key=${PRIVATE_KEY}?\s+endpoint-address=${ENDPOINT_ADDRESS}?\s+endpoint-port=${ENDPOINT_PORT}?\s+current-endpoint-address=${CURRENT_ENDPOINT_ADDRESS}?\s+current-endpoint-port=${CURRENT_ENDPOINT_PORT}?\s+allowed-address=${ALLOWED_ADDRESS}?\s+preshared-key=${PRESHARED_KEY}?\s+client-address=${CLIENT_ADDRESS}?\s+client-endpoint=${CLIENT_ENDPOINT}?\s+rx=${RX_BYTES}?\s+tx=${TX_BYTES}?\s+last-handshake=${LAST_HANDSHAKE}?\s*$$ -> Record
20+
^. -> Error
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
0 interface=wg1 name=peer2 public-key=dcKiJ0TpLjtSWZh3G0ILJ9cL56fTIfHBAsZsXdDIlFM= private-key= endpoint-address= endpoint-port=0 current-endpoint-address=192.168.93.254 current-endpoint-port=50610 allowed-address=192.168.100.0/24 preshared-key= client-address=192.168.100.2/32 client-endpoint= rx=180 tx=92 last-handshake=20s
2+
1 interface=wg1 name=peer2 public-key=dcKiJ0TpLjtSWZh3G0ILJ9cL56fTIfHBAsZsXdDIlFM= private-key= endpoint-address= endpoint-port=0 current-endpoint-address=192.168.93.254 current-endpoint-port=50610 allowed-address=192.168.100.0/24 preshared-key= client-address=192.168.100.2/32 client-endpoint= rx=5.3KiB tx=1472 last-handshake=1m45s
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
parsed_sample:
3+
- allowed_address: "192.168.100.0/24"
4+
client_address: "192.168.100.2/32"
5+
client_endpoint: ""
6+
current_endpoint_address: "192.168.93.254"
7+
current_endpoint_port: "50610"
8+
endpoint_address: ""
9+
endpoint_port: "0"
10+
index: "0"
11+
interface: "wg1"
12+
last_handshake: "20s"
13+
name: "peer2"
14+
preshared_key: ""
15+
private_key: ""
16+
public_key: "dcKiJ0TpLjtSWZh3G0ILJ9cL56fTIfHBAsZsXdDIlFM="
17+
rx_bytes: "180"
18+
tx_bytes: "92"
19+
- allowed_address: "192.168.100.0/24"
20+
client_address: "192.168.100.2/32"
21+
client_endpoint: ""
22+
current_endpoint_address: "192.168.93.254"
23+
current_endpoint_port: "50610"
24+
endpoint_address: ""
25+
endpoint_port: "0"
26+
index: "1"
27+
interface: "wg1"
28+
last_handshake: "1m45s"
29+
name: "peer2"
30+
preshared_key: ""
31+
private_key: ""
32+
public_key: "dcKiJ0TpLjtSWZh3G0ILJ9cL56fTIfHBAsZsXdDIlFM="
33+
rx_bytes: "5.3KiB"
34+
tx_bytes: "1472"

0 commit comments

Comments
 (0)