Skip to content

Commit

Permalink
New template linux: vzlist (#2000)
Browse files Browse the repository at this point in the history
  • Loading branch information
evilmonkey19 authored Feb 11, 2025
1 parent c5477d9 commit 54c5988
Show file tree
Hide file tree
Showing 4 changed files with 38 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 @@ -752,6 +752,7 @@ linux_ip_link_show.textfsm, .*, linux, ip l[[ink]] [[show]]
linux_ip_vrf_show.textfsm, .*, linux, ip v[[rf]] [[show]]
linux_qm_config_1.textfsm, .*, linux, qm c[[onfig]] \d+
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"

0 comments on commit 54c5988

Please sign in to comment.