From b1bee9e29ed8f6464e14b577d79a23b5c128ac8a Mon Sep 17 00:00:00 2001 From: bbabich Date: Sat, 4 Nov 2023 22:23:17 +1100 Subject: op-mode: T5658: add VRF support for "monitor traceroute" (cherry picked from commit 07ecc0c33fb32878cac25ec84f2f3a977588f0dd) --- op-mode-definitions/monitor-traceroute.xml.in | 30 +++++++++++++++++++++++++++ op-mode-definitions/mtr.xml.in | 23 ++++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 op-mode-definitions/monitor-traceroute.xml.in create mode 100644 op-mode-definitions/mtr.xml.in (limited to 'op-mode-definitions') diff --git a/op-mode-definitions/monitor-traceroute.xml.in b/op-mode-definitions/monitor-traceroute.xml.in new file mode 100644 index 000000000..e6263b076 --- /dev/null +++ b/op-mode-definitions/monitor-traceroute.xml.in @@ -0,0 +1,30 @@ + + + + + Monitor route with mtr + + + + + Traceroute route with mtr + + <hostname> <x.x.x.x> <h:h:h:h:h:h:h:h> + + + ${vyos_op_scripts_dir}/mtr.py ${@:2} + + + + mtr options + + + + + ${vyos_op_scripts_dir}/mtr.py ${@:2} + + + + + + diff --git a/op-mode-definitions/mtr.xml.in b/op-mode-definitions/mtr.xml.in new file mode 100644 index 000000000..acc4ee29d --- /dev/null +++ b/op-mode-definitions/mtr.xml.in @@ -0,0 +1,23 @@ + + + + + Trace network path to node with mtr + + <hostname> <x.x.x.x> <h:h:h:h:h:h:h:h> + + + ${vyos_op_scripts_dir}/mtr.py ${@:2} + + + + Traceroute options + + + + + ${vyos_op_scripts_dir}/mtr.py ${@:2} + + + + -- cgit v1.2.3 From 822a80e98744a92f2f15bc552f611e7327d11c9f Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Thu, 9 Nov 2023 22:17:59 +0100 Subject: op-mode: T5658: adjust "monitor traceroute" CLI argument index (cherry picked from commit 709c578e123bcf258eba1d15842b63eb63413523) --- op-mode-definitions/monitor-traceroute.xml.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'op-mode-definitions') diff --git a/op-mode-definitions/monitor-traceroute.xml.in b/op-mode-definitions/monitor-traceroute.xml.in index e6263b076..7697228b3 100644 --- a/op-mode-definitions/monitor-traceroute.xml.in +++ b/op-mode-definitions/monitor-traceroute.xml.in @@ -12,7 +12,7 @@ <hostname> <x.x.x.x> <h:h:h:h:h:h:h:h> - ${vyos_op_scripts_dir}/mtr.py ${@:2} + ${vyos_op_scripts_dir}/mtr.py ${@:3} @@ -21,7 +21,7 @@ - ${vyos_op_scripts_dir}/mtr.py ${@:2} + ${vyos_op_scripts_dir}/mtr.py ${@:3} -- cgit v1.2.3 From 21e4fddeebe541856e25a398018854fb0cf6fbd9 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Sun, 12 Nov 2023 10:10:01 +0100 Subject: op-mode: T5658: fix "monitor traceroute" completion helper (cherry picked from commit c0de93d37354ec89f44dde7f1b5a4c8af550a019) --- op-mode-definitions/monitor-traceroute.xml.in | 30 --------------------------- op-mode-definitions/mtr.xml.in | 26 ++++++++++++++++++++++- src/op_mode/mtr.py | 7 +++++-- 3 files changed, 30 insertions(+), 33 deletions(-) delete mode 100644 op-mode-definitions/monitor-traceroute.xml.in (limited to 'op-mode-definitions') diff --git a/op-mode-definitions/monitor-traceroute.xml.in b/op-mode-definitions/monitor-traceroute.xml.in deleted file mode 100644 index 7697228b3..000000000 --- a/op-mode-definitions/monitor-traceroute.xml.in +++ /dev/null @@ -1,30 +0,0 @@ - - - - - Monitor route with mtr - - - - - Traceroute route with mtr - - <hostname> <x.x.x.x> <h:h:h:h:h:h:h:h> - - - ${vyos_op_scripts_dir}/mtr.py ${@:3} - - - - mtr options - - - - - ${vyos_op_scripts_dir}/mtr.py ${@:3} - - - - - - diff --git a/op-mode-definitions/mtr.xml.in b/op-mode-definitions/mtr.xml.in index acc4ee29d..8239aec4c 100644 --- a/op-mode-definitions/mtr.xml.in +++ b/op-mode-definitions/mtr.xml.in @@ -1,8 +1,32 @@ + + + + + Monitor Traceroute and ping path to target + + <hostname> <x.x.x.x> <h:h:h:h:h:h:h:h> + + + ${vyos_op_scripts_dir}/mtr.py ${@:3} + + + + mtr options + + + + + ${vyos_op_scripts_dir}/mtr.py ${@:3} + + + + + - Trace network path to node with mtr + Monitor Traceroute and ping path to target <hostname> <x.x.x.x> <h:h:h:h:h:h:h:h> diff --git a/src/op_mode/mtr.py b/src/op_mode/mtr.py index efb627e51..de139f2fa 100644 --- a/src/op_mode/mtr.py +++ b/src/op_mode/mtr.py @@ -242,8 +242,11 @@ if __name__ == '__main__': if not host: sys.exit("mtr: Missing host") - if host == '--get-options': - args.first() # pop ping + + if host == '--get-options' or host == '--get-options-nested': + if host == '--get-options-nested': + args.first() # pop monitor + args.first() # pop mtr | traceroute args.first() # pop IP usedoptionslist = [] while args: -- cgit v1.2.3