-
Notifications
You must be signed in to change notification settings - Fork 735
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Mikrotik ip dhcp-server lease print template (#1495)
Co-authored-by: pskliarenko <“[email protected]”>
- Loading branch information
1 parent
9c58c94
commit 8765b63
Showing
4 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
ntc_templates/templates/mikrotik_routeros_ip_dhcp-server_lease_print.textfsm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Value NUMBER (\d+) | ||
Value FLAGS ([XRDB]+) | ||
Value ADDRESS (\S+) | ||
Value MAC_ADDRESS ((?:[0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}) | ||
Value HOST_NAME (\S+) | ||
Value SERVER (\S+) | ||
Value RATE_LIMIT (\S+) | ||
Value STATUS (\S+) | ||
Value LAST_SEEN (\S+) | ||
|
||
Start | ||
^\s*#\s+ADDRESS\s+MAC-ADDRESS\s+HOST-NAME\s+SERVER\s+RATE-LIMIT\s+STATUS\s+LAST-SEEN\s*$$ -> EntriesTable | ||
|
||
EntriesTable | ||
# Impossible to separate HOST-NAME and SERVER? Have the same regex, can be empty, | ||
# are next to each other -> use '...print terse...' version of the command | ||
^\s*${NUMBER}(?:\s+${FLAGS})?\s+${ADDRESS}(?:\s+${MAC_ADDRESS})?(?:\s+${HOST_NAME})?\s+${SERVER}(?:\s+${RATE_LIMIT})?\s+${STATUS}\s+${LAST_SEEN}\s*$$ -> Record | ||
^\s*$$ | ||
^. -> Error |
6 changes: 6 additions & 0 deletions
6
...otik_routeros/ip_dhcp-server_lease_print/mikrotik_routeros_ip_dhcp-server_lease_print.raw
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Flags: X - disabled, R - radius, D - dynamic, B - blocked | ||
# ADDRESS MAC-ADDRESS HOST-NAME SERVER RATE-LIMIT STATUS LAST-SEEN | ||
0 192.168.60.254 *1 bound 35w13h13m15s | ||
1 X 192.168.61.254 MikroTik DHCPv4_Server waiting never | ||
1 192.168.62.254 12:34:56:78:90:AA DHCPv4_Server waiting never | ||
2 D 192.168.88.254 12:34:56:78:90:AB MikroTik DHCPv4_Server waiting never |
38 changes: 38 additions & 0 deletions
38
...otik_routeros/ip_dhcp-server_lease_print/mikrotik_routeros_ip_dhcp-server_lease_print.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
--- | ||
parsed_sample: | ||
- address: "192.168.60.254" | ||
flags: "" | ||
host_name: "" | ||
last_seen: "35w13h13m15s" | ||
mac_address: "" | ||
number: "0" | ||
rate_limit: "" | ||
server: "*1" | ||
status: "bound" | ||
- address: "192.168.61.254" | ||
flags: "X" | ||
host_name: "MikroTik" | ||
last_seen: "never" | ||
mac_address: "" | ||
number: "1" | ||
rate_limit: "" | ||
server: "DHCPv4_Server" | ||
status: "waiting" | ||
- address: "192.168.62.254" | ||
flags: "" | ||
host_name: "" | ||
last_seen: "never" | ||
mac_address: "12:34:56:78:90:AA" | ||
number: "1" | ||
rate_limit: "" | ||
server: "DHCPv4_Server" | ||
status: "waiting" | ||
- address: "192.168.88.254" | ||
flags: "D" | ||
host_name: "MikroTik" | ||
last_seen: "never" | ||
mac_address: "12:34:56:78:90:AB" | ||
number: "2" | ||
rate_limit: "" | ||
server: "DHCPv4_Server" | ||
status: "waiting" |