diff options
author | Saurabh Mohan <saurabh.mohan@vyatta.com> | 2012-08-09 13:14:49 -0700 |
---|---|---|
committer | Saurabh Mohan <saurabh.mohan@vyatta.com> | 2012-08-09 13:14:49 -0700 |
commit | 6aaca3a4bdc77c804e21ad0a3c1ab5ce4d7d8686 (patch) | |
tree | 0fdbf6cb955c1d3231c90fe093a130b18350973c | |
parent | c60e40528702f0a3b358925c00d52d5879a9948a (diff) | |
download | vyatta-op-6aaca3a4bdc77c804e21ad0a3c1ab5ce4d7d8686.tar.gz vyatta-op-6aaca3a4bdc77c804e21ad0a3c1ab5ce4d7d8686.zip |
Bugfix 8217: VTI: add clear and monitor interfaces commands.
Add support for interface vti for operational commands clear and monitor.
21 files changed, 46 insertions, 2 deletions
diff --git a/gen-monitor-interface-templates.sh b/gen-monitor-interface-templates.sh index d1d4463..a4f75b4 100644 --- a/gen-monitor-interface-templates.sh +++ b/gen-monitor-interface-templates.sh @@ -16,6 +16,7 @@ declare -a types=( "bonding" \ "tunnel" \ "loopback" \ + "vti" ) for type in "${types[@]}"; do @@ -24,11 +25,12 @@ for type in "${types[@]}"; do mkdir -p $type/node.tag/traffic/detail/unlimited/filter/node.tag mkdir -p $type/node.tag/traffic/filter/node.tag mkdir -p $type/node.tag/traffic/unlimited/filter/node.tag - + #node.tag echo "help: Monitor specified $type interface" > $type/node.tag/node.def echo "allowed: \${vyatta_sbindir}/vyatta-interfaces.pl --show $type" >> $type/node.tag/node.def - echo "run: \${vyatta_bindir}/vyatta-show-interfaces.pl --intf=\"$4\"" >> $type/node.tag/node.def + echo 'run: bmon -p $4' >> $type/node.tag/node.def + echo '' >> $type/node.tag/node.def # standard echo "help: Montior captured traffic on specified $type interface" > $type/node.tag/traffic/node.def diff --git a/templates/clear/interfaces/vti/counters/node.def b/templates/clear/interfaces/vti/counters/node.def new file mode 100644 index 0000000..8b81d1f --- /dev/null +++ b/templates/clear/interfaces/vti/counters/node.def @@ -0,0 +1,2 @@ +help: Clear all vti interface counters +run: sudo ${vyatta_bindir}/sudo-users/vyatta-show-interfaces.pl --action=clear --intf-type="$3" diff --git a/templates/clear/interfaces/vti/node.def b/templates/clear/interfaces/vti/node.def new file mode 100644 index 0000000..1448e18 --- /dev/null +++ b/templates/clear/interfaces/vti/node.def @@ -0,0 +1 @@ +help: Clear vti interface information diff --git a/templates/clear/interfaces/vti/node.tag/counters/node.def b/templates/clear/interfaces/vti/node.tag/counters/node.def new file mode 100644 index 0000000..8832a04 --- /dev/null +++ b/templates/clear/interfaces/vti/node.tag/counters/node.def @@ -0,0 +1,2 @@ +help: Clear interface counters for a given vti interface +run: sudo ${vyatta_bindir}/sudo-users/vyatta-show-interfaces.pl --action=clear --intf="$4" diff --git a/templates/clear/interfaces/vti/node.tag/node.def b/templates/clear/interfaces/vti/node.tag/node.def new file mode 100644 index 0000000..b7cfb64 --- /dev/null +++ b/templates/clear/interfaces/vti/node.tag/node.def @@ -0,0 +1,4 @@ +help: Clear interface information for a given vti interface +allowed: local -a array ; + array=( /sys/class/net/vti* ) ; + echo -n ${array[@]##*/} diff --git a/templates/monitor/interfaces/vti/node.def b/templates/monitor/interfaces/vti/node.def new file mode 100644 index 0000000..b7429bd --- /dev/null +++ b/templates/monitor/interfaces/vti/node.def @@ -0,0 +1,2 @@ +help: Monitor a vti interface +run: bmon -p vti* diff --git a/templates/monitor/interfaces/vti/node.tag/node.def b/templates/monitor/interfaces/vti/node.tag/node.def new file mode 100644 index 0000000..7244589 --- /dev/null +++ b/templates/monitor/interfaces/vti/node.tag/node.def @@ -0,0 +1,4 @@ +help: Monitor specified vti interface +allowed: ${vyatta_sbindir}/vyatta-interfaces.pl --show vti +run: bmon -p $4 + diff --git a/templates/monitor/interfaces/vti/node.tag/traffic/detail/filter/node.def b/templates/monitor/interfaces/vti/node.tag/traffic/detail/filter/node.def new file mode 100644 index 0000000..a6a9444 --- /dev/null +++ b/templates/monitor/interfaces/vti/node.tag/traffic/detail/filter/node.def @@ -0,0 +1 @@ +help: Monitor detailed filtered traffic for the specified vti interface diff --git a/templates/monitor/interfaces/vti/node.tag/traffic/detail/filter/node.tag/node.def b/templates/monitor/interfaces/vti/node.tag/traffic/detail/filter/node.tag/node.def new file mode 100644 index 0000000..63742c3 --- /dev/null +++ b/templates/monitor/interfaces/vti/node.tag/traffic/detail/filter/node.tag/node.def @@ -0,0 +1,3 @@ +help: Monitor detailed filtered traffic for the specified vti interface +allowed: echo -e '<pcap-filter>' +run: ${vyatta_bindir}/vyatta-tshark.pl --intf $4 --detail --filter "${@:8}" diff --git a/templates/monitor/interfaces/vti/node.tag/traffic/detail/node.def b/templates/monitor/interfaces/vti/node.tag/traffic/detail/node.def new file mode 100644 index 0000000..b759e3d --- /dev/null +++ b/templates/monitor/interfaces/vti/node.tag/traffic/detail/node.def @@ -0,0 +1,2 @@ +help: Monitor detailed traffic for the specified vti interface +run: ${vyatta_bindir}/vyatta-tshark.pl --intf $4 --detail diff --git a/templates/monitor/interfaces/vti/node.tag/traffic/detail/unlimited/filter/node.def b/templates/monitor/interfaces/vti/node.tag/traffic/detail/unlimited/filter/node.def new file mode 100644 index 0000000..a6a9444 --- /dev/null +++ b/templates/monitor/interfaces/vti/node.tag/traffic/detail/unlimited/filter/node.def @@ -0,0 +1 @@ +help: Monitor detailed filtered traffic for the specified vti interface diff --git a/templates/monitor/interfaces/vti/node.tag/traffic/detail/unlimited/filter/node.tag/node.def b/templates/monitor/interfaces/vti/node.tag/traffic/detail/unlimited/filter/node.tag/node.def new file mode 100644 index 0000000..f54a40b --- /dev/null +++ b/templates/monitor/interfaces/vti/node.tag/traffic/detail/unlimited/filter/node.tag/node.def @@ -0,0 +1,3 @@ +help: Monitor detailed filtered traffic for the specified vti interface +allowed: echo -e '<pcap-filter>' +run: ${vyatta_bindir}/vyatta-tshark.pl --intf $4 --detail --unlimited --filter "${@:9}" diff --git a/templates/monitor/interfaces/vti/node.tag/traffic/detail/unlimited/node.def b/templates/monitor/interfaces/vti/node.tag/traffic/detail/unlimited/node.def new file mode 100644 index 0000000..1158b46 --- /dev/null +++ b/templates/monitor/interfaces/vti/node.tag/traffic/detail/unlimited/node.def @@ -0,0 +1,2 @@ +help: Monitor detailed traffic for the specified vti interface +run: ${vyatta_bindir}/vyatta-tshark.pl --intf $4 --detail --unlimited diff --git a/templates/monitor/interfaces/vti/node.tag/traffic/filter/node.def b/templates/monitor/interfaces/vti/node.tag/traffic/filter/node.def new file mode 100644 index 0000000..4ee8e39 --- /dev/null +++ b/templates/monitor/interfaces/vti/node.tag/traffic/filter/node.def @@ -0,0 +1 @@ +help: Monitor filtered traffic for the specified vti interface diff --git a/templates/monitor/interfaces/vti/node.tag/traffic/filter/node.tag/node.def b/templates/monitor/interfaces/vti/node.tag/traffic/filter/node.tag/node.def new file mode 100644 index 0000000..c88e0e6 --- /dev/null +++ b/templates/monitor/interfaces/vti/node.tag/traffic/filter/node.tag/node.def @@ -0,0 +1,3 @@ +help: Monitor filtered traffic for the specified vti interface +allowed: echo -e '<pcap-filter>' +run: ${vyatta_bindir}/vyatta-tshark.pl --intf $4 --filter "${@:7}" diff --git a/templates/monitor/interfaces/vti/node.tag/traffic/node.def b/templates/monitor/interfaces/vti/node.tag/traffic/node.def new file mode 100644 index 0000000..e38107c --- /dev/null +++ b/templates/monitor/interfaces/vti/node.tag/traffic/node.def @@ -0,0 +1,2 @@ +help: Montior captured traffic on specified vti interface +run: ${vyatta_bindir}/vyatta-tshark.pl --intf $4 diff --git a/templates/monitor/interfaces/vti/node.tag/traffic/save/node.def b/templates/monitor/interfaces/vti/node.tag/traffic/save/node.def new file mode 100644 index 0000000..402f47c --- /dev/null +++ b/templates/monitor/interfaces/vti/node.tag/traffic/save/node.def @@ -0,0 +1 @@ +help: Save monitored traffic to a file diff --git a/templates/monitor/interfaces/vti/node.tag/traffic/save/node.tag/node.def b/templates/monitor/interfaces/vti/node.tag/traffic/save/node.tag/node.def new file mode 100644 index 0000000..bd747b5 --- /dev/null +++ b/templates/monitor/interfaces/vti/node.tag/traffic/save/node.tag/node.def @@ -0,0 +1,2 @@ +help: Save monitored traffic to a file +run: ${vyatta_bindir}/vyatta-tshark.pl --intf $4 --save "${@:7}" diff --git a/templates/monitor/interfaces/vti/node.tag/traffic/unlimited/filter/node.def b/templates/monitor/interfaces/vti/node.tag/traffic/unlimited/filter/node.def new file mode 100644 index 0000000..4ee8e39 --- /dev/null +++ b/templates/monitor/interfaces/vti/node.tag/traffic/unlimited/filter/node.def @@ -0,0 +1 @@ +help: Monitor filtered traffic for the specified vti interface diff --git a/templates/monitor/interfaces/vti/node.tag/traffic/unlimited/filter/node.tag/node.def b/templates/monitor/interfaces/vti/node.tag/traffic/unlimited/filter/node.tag/node.def new file mode 100644 index 0000000..9346ce2 --- /dev/null +++ b/templates/monitor/interfaces/vti/node.tag/traffic/unlimited/filter/node.tag/node.def @@ -0,0 +1,3 @@ +help: Monitor filtered traffic for the specified vti interface +allowed: echo -e '<pcap-filter>' +run: ${vyatta_bindir}/vyatta-tshark.pl --intf $4 --unlimited --filter "${@:8}" diff --git a/templates/monitor/interfaces/vti/node.tag/traffic/unlimited/node.def b/templates/monitor/interfaces/vti/node.tag/traffic/unlimited/node.def new file mode 100644 index 0000000..c4a9143 --- /dev/null +++ b/templates/monitor/interfaces/vti/node.tag/traffic/unlimited/node.def @@ -0,0 +1,2 @@ +help: Monitor traffic for the specified vti interface +run: ${vyatta_bindir}/vyatta-tshark.pl --intf $4 --unlimited |