summaryrefslogtreecommitdiff
path: root/op-mode-definitions
diff options
context:
space:
mode:
authorzsdc <taras@vyos.io>2020-06-10 21:03:21 +0300
committerzsdc <taras@vyos.io>2020-06-10 21:03:21 +0300
commita5500a771ee33d02efa566a0f36b574a16145787 (patch)
tree3b243e9a8658f71cc8df085450946994966e702e /op-mode-definitions
parentbc5cec0fbb9f8828b4928eb047ffdee38306269c (diff)
downloadvyos-1x-a5500a771ee33d02efa566a0f36b574a16145787.tar.gz
vyos-1x-a5500a771ee33d02efa566a0f36b574a16145787.zip
BFD: T2573: Fixed show command for BFD peers
As vtysh does not have a vrf option for "show bfd peer" command, the vrf part will be cut before passing a line to the vtysh.
Diffstat (limited to 'op-mode-definitions')
-rw-r--r--op-mode-definitions/show-protocols-bfd.xml4
1 files changed, 2 insertions, 2 deletions
diff --git a/op-mode-definitions/show-protocols-bfd.xml b/op-mode-definitions/show-protocols-bfd.xml
index 2cc8a1297..4483b39bf 100644
--- a/op-mode-definitions/show-protocols-bfd.xml
+++ b/op-mode-definitions/show-protocols-bfd.xml
@@ -30,13 +30,13 @@
<script>/usr/bin/vtysh -c "show bfd peers" | awk '/[:blank:]*peer/ { printf "%s\n", $2 }'</script>
</completionHelp>
</properties>
- <command>/usr/bin/vtysh -c "show bfd peers" | awk -v BFD_PEER=$5 '($0 ~ peer BFD_PEER) { system("/usr/bin/vtysh -c \"show bfd " $0 "\"") }'</command>
+ <command>/usr/bin/vtysh -c "show bfd peers" | awk -v BFD_PEER=$5 'BEGIN { regex = sprintf("(peer %s.*)vrf", BFD_PEER) } { if (match($0, regex, bfd_peer_value)) peer=bfd_peer_value[1] } END { if (peer) system("/usr/bin/vtysh -c \"show bfd " peer "\"") }'</command>
<children>
<leafNode name="counters">
<properties>
<help>Show Bidirectional Forwarding Detection (BFD) peer counters</help>
</properties>
- <command>/usr/bin/vtysh -c "show bfd peers" | awk -v BFD_PEER=$5 '($0 ~ peer BFD_PEER) { system("/usr/bin/vtysh -c \"show bfd " $0 " counters\"") }'</command>
+ <command>/usr/bin/vtysh -c "show bfd peers" | awk -v BFD_PEER=$5 'BEGIN { regex = sprintf("(peer %s.*)vrf", BFD_PEER) } { if (match($0, regex, bfd_peer_value)) peer=bfd_peer_value[1] } END { if (peer) system("/usr/bin/vtysh -c \"show bfd " peer " counters\"") }'</command>
</leafNode>
</children>
</tagNode>