From faf87e1a036da715dabba36d119c0ce3a93c7a9e Mon Sep 17 00:00:00 2001 From: Mohit Mehta Date: Mon, 23 Jun 2008 09:38:45 +0000 Subject: Fix Bug 1059 Feature Request: integrate 'tcpdump' and 'tethereal' into Vyatta CLI add op-mode command for tsharking tunnel interfaces --- templates/show/interfaces/tunnel/node.tag/capture/node.def | 2 ++ templates/show/interfaces/tunnel/node.tag/capture/not/node.def | 1 + templates/show/interfaces/tunnel/node.tag/capture/not/port/node.def | 1 + .../show/interfaces/tunnel/node.tag/capture/not/port/node.tag/node.def | 3 +++ templates/show/interfaces/tunnel/node.tag/capture/port/node.def | 1 + .../show/interfaces/tunnel/node.tag/capture/port/node.tag/node.def | 3 +++ 6 files changed, 11 insertions(+) create mode 100644 templates/show/interfaces/tunnel/node.tag/capture/node.def create mode 100644 templates/show/interfaces/tunnel/node.tag/capture/not/node.def create mode 100644 templates/show/interfaces/tunnel/node.tag/capture/not/port/node.def create mode 100644 templates/show/interfaces/tunnel/node.tag/capture/not/port/node.tag/node.def create mode 100644 templates/show/interfaces/tunnel/node.tag/capture/port/node.def create mode 100644 templates/show/interfaces/tunnel/node.tag/capture/port/node.tag/node.def diff --git a/templates/show/interfaces/tunnel/node.tag/capture/node.def b/templates/show/interfaces/tunnel/node.tag/capture/node.def new file mode 100644 index 0000000..b196a35 --- /dev/null +++ b/templates/show/interfaces/tunnel/node.tag/capture/node.def @@ -0,0 +1,2 @@ +help: Show captured traffic on specified tunnel interface +run: /opt/vyatta/bin/vyatta-tshark-interface-port.pl "$4" diff --git a/templates/show/interfaces/tunnel/node.tag/capture/not/node.def b/templates/show/interfaces/tunnel/node.tag/capture/not/node.def new file mode 100644 index 0000000..c957f71 --- /dev/null +++ b/templates/show/interfaces/tunnel/node.tag/capture/not/node.def @@ -0,0 +1 @@ +help: Show captured traffic excluding the specified tunnel interface port diff --git a/templates/show/interfaces/tunnel/node.tag/capture/not/port/node.def b/templates/show/interfaces/tunnel/node.tag/capture/not/port/node.def new file mode 100644 index 0000000..c957f71 --- /dev/null +++ b/templates/show/interfaces/tunnel/node.tag/capture/not/port/node.def @@ -0,0 +1 @@ +help: Show captured traffic excluding the specified tunnel interface port diff --git a/templates/show/interfaces/tunnel/node.tag/capture/not/port/node.tag/node.def b/templates/show/interfaces/tunnel/node.tag/capture/not/port/node.tag/node.def new file mode 100644 index 0000000..b5c87c9 --- /dev/null +++ b/templates/show/interfaces/tunnel/node.tag/capture/not/port/node.tag/node.def @@ -0,0 +1,3 @@ +help: Show captured traffic excluding the specified tunnel interface port +run: /opt/vyatta/bin/vyatta-tshark-interface-port.pl "$4" "$8" 1 +allowed: echo -n '<1-65535>' diff --git a/templates/show/interfaces/tunnel/node.tag/capture/port/node.def b/templates/show/interfaces/tunnel/node.tag/capture/port/node.def new file mode 100644 index 0000000..ed3b544 --- /dev/null +++ b/templates/show/interfaces/tunnel/node.tag/capture/port/node.def @@ -0,0 +1 @@ +help: Show captured traffic on specified tunnel interface port diff --git a/templates/show/interfaces/tunnel/node.tag/capture/port/node.tag/node.def b/templates/show/interfaces/tunnel/node.tag/capture/port/node.tag/node.def new file mode 100644 index 0000000..d1f01df --- /dev/null +++ b/templates/show/interfaces/tunnel/node.tag/capture/port/node.tag/node.def @@ -0,0 +1,3 @@ +help: Show captured traffic on specified tunnel interface port +run: /opt/vyatta/bin/vyatta-tshark-interface-port.pl "$4" "$7" 0 +allowed: echo -n '<1-65535>' -- cgit v1.2.3 From 7a93bacf5b49f599ffedd11c10d8d156e2c85111 Mon Sep 17 00:00:00 2001 From: An-Cheng Huang Date: Tue, 1 Jul 2008 16:25:48 -0700 Subject: fix for bug 3414: make op mode functions available in config mode. --- etc/bash_completion.d/10vyatta-op | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/etc/bash_completion.d/10vyatta-op b/etc/bash_completion.d/10vyatta-op index fe3163c..4735462 100644 --- a/etc/bash_completion.d/10vyatta-op +++ b/etc/bash_completion.d/10vyatta-op @@ -434,11 +434,6 @@ fi alias vtysh=$_vyatta_vtysh -# don't initialize if we are in configure mode -if [ "$_OFR_CONFIGURE" == "ok" ]; then - return 0 -fi - nullglob_save=$( shopt -p nullglob ) shopt -s nullglob for f in ${vyatta_datadir}/vyatta-op/functions/allowed/* ; do @@ -447,6 +442,11 @@ done eval $nullglob_save unset nullglob_save +# don't initialize if we are in configure mode +if [ "$_OFR_CONFIGURE" == "ok" ]; then + return 0 +fi + _vyatta_op_init $@ ### Local Variables: -- cgit v1.2.3 From 4a9dadf356a83ee0270d3848c506d1ca969d2565 Mon Sep 17 00:00:00 2001 From: Mohit Mehta Date: Mon, 23 Jun 2008 17:56:44 +0000 Subject: Fix Bug 2871 Internal errors reported with traceroute use host command to resolve only if input is not a valid IP address also, if name server not configured, prompt user and ask to only enter valid IPv4 address --- templates/traceroute/node.tag/node.def | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/templates/traceroute/node.tag/node.def b/templates/traceroute/node.tag/node.def index 55acbb7..83a3f31 100644 --- a/templates/traceroute/node.tag/node.def +++ b/templates/traceroute/node.tag/node.def @@ -6,9 +6,21 @@ help: Track network path to specified allowed: vyatta-allowed-hosts -run: if /usr/bin/host $2 &>/dev/null - then - /usr/bin/traceroute $2 - else - echo Cannot identify $2 +run: + if /opt/vyatta/sbin/vyatta-validate-type.pl -q ipv4 $2 + then + /usr/bin/traceroute $2 + echo + else + if cat /etc/resolv.conf | grep -q nameserver + then + if /usr/bin/host $2 &> /dev/null + then + /usr/bin/traceroute $2 + else + echo "Invalid IP address or host name '$2'" + fi + else + echo "Either enter a valid IPv4 address or configure Domain Name Server to resolve host names" + fi fi -- cgit v1.2.3 From 60e7b273126249b96f6dd4644e430ffd76bb82ee Mon Sep 17 00:00:00 2001 From: Mohit Mehta Date: Tue, 24 Jun 2008 09:43:14 +0000 Subject: prevents showing backend error to user on traceroute when name-server not set --- templates/traceroute/node.tag/node.def | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/traceroute/node.tag/node.def b/templates/traceroute/node.tag/node.def index 83a3f31..cf60ec4 100644 --- a/templates/traceroute/node.tag/node.def +++ b/templates/traceroute/node.tag/node.def @@ -12,7 +12,7 @@ run: /usr/bin/traceroute $2 echo else - if cat /etc/resolv.conf | grep -q nameserver + if cat /etc/resolv.conf 2> /dev/null | grep -q nameserver then if /usr/bin/host $2 &> /dev/null then -- cgit v1.2.3 From 77caec4a1e442aa3bfc393c7347281364ce13dc9 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 7 Jul 2008 14:53:30 -0700 Subject: Show files completion Show files allows any pathname as argument therefore just give a generic completion message Bugfix: 3302 --- templates/show/files/node.tag/node.def | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/show/files/node.tag/node.def b/templates/show/files/node.tag/node.def index 1734b2b..0448ad4 100644 --- a/templates/show/files/node.tag/node.def +++ b/templates/show/files/node.tag/node.def @@ -1,3 +1,3 @@ help: Show files in the specified directory -allowed: echo -n * +allowed: echo -n '' run: ls -lh "$3" -- cgit v1.2.3 From f6b09f98f44c8a2ac0bec819557b30216bb1a2c5 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 7 Jul 2008 15:35:37 -0700 Subject: Turn on paging of tail when showing count lines Bugfix 3017 --- templates/show/log/tail/node.tag/node.def | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/show/log/tail/node.tag/node.def b/templates/show/log/tail/node.tag/node.def index 00de686..b07bb9e 100644 --- a/templates/show/log/tail/node.tag/node.def +++ b/templates/show/log/tail/node.tag/node.def @@ -1,3 +1,3 @@ help: Show last changes to messages allowed: echo -n '' -run: tail -n "$4" /var/log/messages +run: tail -n "$4" /var/log/messages | ${VYATTA_PAGER:-cat} -- cgit v1.2.3