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

New template linux: vzlist #2000

Merged
merged 1 commit into from
Feb 11, 2025
Merged
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 @@ -750,6 +750,7 @@ linux_ip_route_show.textfsm, .*, linux, ip r[[oute]] [[show]]
linux_ip_link_show.textfsm, .*, linux, ip l[[ink]] [[show]]
linux_ip_vrf_show.textfsm, .*, linux, ip v[[rf]] [[show]]
linux_arp_-a.textfsm, .*, linux, arp -a
linux_vzlist.textfsm, .*, linux, vzlist

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]]
mikrotik_routeros_ip_dhcp-server_lease_print_terse_without-paging.textfsm, .*, mikrotik_routeros, [[/]]ip dh[[cp-server]] l[[ease]] pr[[int]] t[[erse]] wi[[thout-paging]]
Expand Down
10 changes: 10 additions & 0 deletions ntc_templates/templates/linux_vzlist.textfsm
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Value CTID (\d+)
Value NPROC (\d+)
Value STATUS (\w+)
Value IP_ADDR (\S+)
Value HOSTNAME (\S+)

Start
^\s*CTID\s+NPROC\s+STATUS\s+IP_ADDR\s+HOSTNAME\s*$$
^\s*${CTID}\s*${NPROC}\s*${STATUS}\s*(-|${IP_ADDR})\s*${HOSTNAME}\s*$$ -> Record
^. -> Error
5 changes: 5 additions & 0 deletions tests/linux/vzlist/linux_vzlist.raw
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CTID NPROC STATUS IP_ADDR HOSTNAME
1110 1 running - something
1111 111 running 192.168.0.1 something-bad
1112 11 running - something-ugly
1113 11 running - something-good
22 changes: 22 additions & 0 deletions tests/linux/vzlist/linux_vzlist.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
parsed_sample:
- ctid: "1110"
hostname: "something"
ip_addr: ""
nproc: "1"
status: "running"
- ctid: "1111"
hostname: "something-bad"
ip_addr: "192.168.0.1"
nproc: "111"
status: "running"
- ctid: "1112"
hostname: "something-ugly"
ip_addr: ""
nproc: "11"
status: "running"
- ctid: "1113"
hostname: "something-good"
ip_addr: ""
nproc: "11"
status: "running"