diff options
33 files changed, 122 insertions, 8 deletions
diff --git a/gen-monitor-vif-interface-templates.sh b/gen-monitor-vif-interface-templates.sh new file mode 100644 index 0000000..b8149f1 --- /dev/null +++ b/gen-monitor-vif-interface-templates.sh @@ -0,0 +1,70 @@ +#!/bin/bash +#monitor interfaces [type] [name] traffic +#monitor interfaces [type] [name] traffic save [filename] +#monitor interfaces [type] [name] traffic detail +#monitor interfaces [type] [name] traffic detail filter +#monitor interfaces [type] [name] traffic detail unlimited +#monitor interfaces [type] [name] traffic detail unlimited filter +#monitor interfaces [type] [name] traffic filter +#monitor interfaces [type] [name] traffic unlimited +#monitor interfaces [type] [name] traffic unlimited filter + +declare -a types=( + "ethernet" \ + "bonding" \ +) + +for type in "${types[@]}"; do + mkdir -p $type/node.tag/vif/node.tag/traffic/save/node.tag + mkdir -p $type/node.tag/vif/node.tag/traffic/detail/filter/node.tag + mkdir -p $type/node.tag/vif/node.tag/traffic/detail/unlimited/filter/node.tag + mkdir -p $type/node.tag/vif/node.tag/traffic/filter/node.tag + mkdir -p $type/node.tag/vif/node.tag/traffic/unlimited/filter/node.tag + + #node.tag + echo "help: Monitor specified $type interface" > $type/node.tag/vif/node.tag/node.def + echo "allowed: \${vyatta_sbindir}/vyatta-interfaces.pl --show $type --vif \${COMP_WORDS[COMP_CWORD-2]}" >> $type/node.tag/vif/node.tag/node.def + echo "run: \${vyatta_bindir}/vyatta-show-interfaces.pl --intf=\"$4.$6\"" >> $type/node.tag/vif/node.tag/node.def + + # standard + echo "help: Montior captured traffic on specified $type interface" > $type/node.tag/vif/node.tag/traffic/node.def + echo 'run: ${vyatta_bindir}/vyatta-tshark.pl --intf $4.$6' >> $type/node.tag/vif/node.tag/traffic/node.def + + # save + echo 'help: Save monitored traffic to a file' > $type/node.tag/vif/node.tag/traffic/save/node.def + echo -e 'help: Save monitored traffic to a file\nrun: ${vyatta_bindir}/vyatta-tshark.pl --intf $4.$6 --save "${@:9}"' > $type/node.tag/vif/node.tag/traffic/save/node.tag/node.def + + # detail + echo -e "help: Monitor detailed traffic for the specified $type interface"> $type/node.tag/vif/node.tag/traffic/detail/node.def + + echo -e 'run: ${vyatta_bindir}/vyatta-tshark.pl --intf $4.$6 --detail' >> $type/node.tag/vif/node.tag/traffic/detail/node.def + + # detail filter + echo "help: Monitor detailed filtered traffic for the specified $type interface" > $type/node.tag/vif/node.tag/traffic/detail/filter/node.def + echo -e "help: Monitor detailed filtered traffic for the specified $type interface" > $type/node.tag/vif/node.tag/traffic/detail/filter/node.tag/node.def + echo 'run: ${vyatta_bindir}/vyatta-tshark.pl --intf $4.$6 --detail --filter "${@:10}"' >> $type/node.tag/vif/node.tag/traffic/detail/filter/node.tag/node.def + + # detail unlimited + echo -e "help: Monitor detailed traffic for the specified $type interface" > $type/node.tag/vif/node.tag/traffic/detail/unlimited/node.def + echo 'run: ${vyatta_bindir}/vyatta-tshark.pl --intf $4.$6 --detail --unlimited' >> $type/node.tag/vif/node.tag/traffic/detail/unlimited/node.def + + # detail unlimited filter + echo "help: Monitor detailed filtered traffic for the specified $type interface" > $type/node.tag/vif/node.tag/traffic/detail/unlimited/filter/node.def + echo "help: Monitor detailed filtered traffic for the specified $type interface" > $type/node.tag/vif/node.tag/traffic/detail/unlimited/filter/node.tag/node.def + echo 'run: ${vyatta_bindir}/vyatta-tshark.pl --intf $4.$6 --detail --unlimited --filter "${@:11}"' >> $type/node.tag/vif/node.tag/traffic/detail/unlimited/filter/node.tag/node.def + + #filter + echo "help: Monitor filtered traffic for the specified $type interface" > $type/node.tag/vif/node.tag/traffic/filter/node.def + echo "help: Monitor filtered traffic for the specified $type interface" > $type/node.tag/vif/node.tag/traffic/filter/node.tag/node.def + echo 'run: ${vyatta_bindir}/vyatta-tshark.pl --intf $4.$6 --filter "${@:9}"' >> $type/node.tag/vif/node.tag/traffic/filter/node.tag/node.def + + # unlimited + echo "help: Monitor traffic for the specified $type interface" > $type/node.tag/vif/node.tag/traffic/unlimited/node.def + echo 'run: ${vyatta_bindir}/vyatta-tshark.pl --intf $4.$6 --unlimited' >> $type/node.tag/vif/node.tag/traffic/unlimited/node.def + + # unlimited filter + echo "help: Monitor filtered traffic for the specified $type interface" > $type/node.tag/vif/node.tag/traffic/unlimited/filter/node.def + echo "help: Monitor filtered traffic for the specified $type interface" > $type/node.tag/vif/node.tag/traffic/unlimited/filter/node.tag/node.def + echo 'run: ${vyatta_bindir}/vyatta-tshark.pl --intf $4.$6 --unlimited --filter "${@:10}"' >> $type/node.tag/vif/node.tag/traffic/unlimited/filter/node.tag/node.def + +done diff --git a/templates/monitor/interfaces/bonding/node.tag/node.def b/templates/monitor/interfaces/bonding/node.tag/node.def index f1ea258..1144059 100644 --- a/templates/monitor/interfaces/bonding/node.tag/node.def +++ b/templates/monitor/interfaces/bonding/node.tag/node.def @@ -1,3 +1,2 @@ help: Monitor specified bonding interface allowed: ${vyatta_sbindir}/vyatta-interfaces.pl --show bonding -run: ${vyatta_bindir}/vyatta-show-interfaces.pl --intf="" diff --git a/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/node.def b/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/node.def index 04350fb..7ea18ad 100644 --- a/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/node.def +++ b/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/node.def @@ -1 +1,3 @@ -help: Monitor a specified vif +help: Monitor specified bonding interface +allowed: ${vyatta_sbindir}/vyatta-interfaces.pl --show bonding --vif ${COMP_WORDS[COMP_CWORD-2]} +run: ${vyatta_bindir}/vyatta-show-interfaces.pl --intf="." diff --git a/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/traffic/detail/filter/node.def b/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/traffic/detail/filter/node.def new file mode 100644 index 0000000..79d2994 --- /dev/null +++ b/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/traffic/detail/filter/node.def @@ -0,0 +1 @@ +help: Monitor detailed filtered traffic for the specified bonding interface diff --git a/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/traffic/detail/filter/node.tag/node.def b/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/traffic/detail/filter/node.tag/node.def new file mode 100644 index 0000000..092e885 --- /dev/null +++ b/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/traffic/detail/filter/node.tag/node.def @@ -0,0 +1,2 @@ +help: Monitor detailed filtered traffic for the specified bonding interface +run: ${vyatta_bindir}/vyatta-tshark.pl --intf $4.$6 --detail --filter "${@:10}" diff --git a/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/traffic/detail/node.def b/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/traffic/detail/node.def new file mode 100644 index 0000000..1830e6a --- /dev/null +++ b/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/traffic/detail/node.def @@ -0,0 +1,2 @@ +help: Monitor detailed traffic for the specified bonding interface +run: ${vyatta_bindir}/vyatta-tshark.pl --intf $4.$6 --detail diff --git a/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/traffic/detail/unlimited/filter/node.def b/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/traffic/detail/unlimited/filter/node.def new file mode 100644 index 0000000..79d2994 --- /dev/null +++ b/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/traffic/detail/unlimited/filter/node.def @@ -0,0 +1 @@ +help: Monitor detailed filtered traffic for the specified bonding interface diff --git a/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/traffic/detail/unlimited/filter/node.tag/node.def b/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/traffic/detail/unlimited/filter/node.tag/node.def new file mode 100644 index 0000000..5327bcd --- /dev/null +++ b/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/traffic/detail/unlimited/filter/node.tag/node.def @@ -0,0 +1,2 @@ +help: Monitor detailed filtered traffic for the specified bonding interface +run: ${vyatta_bindir}/vyatta-tshark.pl --intf $4.$6 --detail --unlimited --filter "${@:11}" diff --git a/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/traffic/detail/unlimited/node.def b/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/traffic/detail/unlimited/node.def new file mode 100644 index 0000000..4b0a795 --- /dev/null +++ b/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/traffic/detail/unlimited/node.def @@ -0,0 +1,2 @@ +help: Monitor detailed traffic for the specified bonding interface +run: ${vyatta_bindir}/vyatta-tshark.pl --intf $4.$6 --detail --unlimited diff --git a/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/traffic/filter/node.def b/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/traffic/filter/node.def new file mode 100644 index 0000000..8b77d3a --- /dev/null +++ b/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/traffic/filter/node.def @@ -0,0 +1 @@ +help: Monitor filtered traffic for the specified bonding interface diff --git a/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/traffic/filter/node.tag/node.def b/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/traffic/filter/node.tag/node.def new file mode 100644 index 0000000..31d1ce6 --- /dev/null +++ b/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/traffic/filter/node.tag/node.def @@ -0,0 +1,2 @@ +help: Monitor filtered traffic for the specified bonding interface +run: ${vyatta_bindir}/vyatta-tshark.pl --intf $4.$6 --filter "${@:9}" diff --git a/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/traffic/node.def b/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/traffic/node.def index 1237372..a4c952a 100644 --- a/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/traffic/node.def +++ b/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/traffic/node.def @@ -1,2 +1,2 @@ -help: Monitor captured traffic on specified bonding virtual interface -run: /opt/vyatta/bin/vyatta-tshark-interface-port.pl "$4.$6" +help: Montior captured traffic on specified bonding interface +run: ${vyatta_bindir}/vyatta-tshark.pl --intf $4.$6 diff --git a/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/traffic/save/node.def b/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/traffic/save/node.def new file mode 100644 index 0000000..402f47c --- /dev/null +++ b/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/traffic/save/node.def @@ -0,0 +1 @@ +help: Save monitored traffic to a file diff --git a/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/traffic/save/node.tag/node.def b/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/traffic/save/node.tag/node.def new file mode 100644 index 0000000..e822a9b --- /dev/null +++ b/templates/monitor/interfaces/bonding/node.tag/vif/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.$6 --save "${@:9}" diff --git a/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/traffic/unlimited/filter/node.def b/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/traffic/unlimited/filter/node.def new file mode 100644 index 0000000..8b77d3a --- /dev/null +++ b/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/traffic/unlimited/filter/node.def @@ -0,0 +1 @@ +help: Monitor filtered traffic for the specified bonding interface diff --git a/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/traffic/unlimited/filter/node.tag/node.def b/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/traffic/unlimited/filter/node.tag/node.def new file mode 100644 index 0000000..b8e22f7 --- /dev/null +++ b/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/traffic/unlimited/filter/node.tag/node.def @@ -0,0 +1,2 @@ +help: Monitor filtered traffic for the specified bonding interface +run: ${vyatta_bindir}/vyatta-tshark.pl --intf $4.$6 --unlimited --filter "${@:10}" diff --git a/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/traffic/unlimited/node.def b/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/traffic/unlimited/node.def new file mode 100644 index 0000000..7ca46e4 --- /dev/null +++ b/templates/monitor/interfaces/bonding/node.tag/vif/node.tag/traffic/unlimited/node.def @@ -0,0 +1,2 @@ +help: Monitor traffic for the specified bonding interface +run: ${vyatta_bindir}/vyatta-tshark.pl --intf $4.$6 --unlimited diff --git a/templates/monitor/interfaces/ethernet/node.tag/node.def b/templates/monitor/interfaces/ethernet/node.tag/node.def index e76b5ab..78761fd 100644 --- a/templates/monitor/interfaces/ethernet/node.tag/node.def +++ b/templates/monitor/interfaces/ethernet/node.tag/node.def @@ -1,3 +1,2 @@ help: Monitor specified ethernet interface allowed: ${vyatta_sbindir}/vyatta-interfaces.pl --show ethernet -run: ${vyatta_bindir}/vyatta-show-interfaces.pl --intf="" diff --git a/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/node.def b/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/node.def index 9169460..6e13231 100644 --- a/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/node.def +++ b/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/node.def @@ -1 +1,3 @@ -help: Monitor the specified vif +help: Monitor specified ethernet interface +allowed: ${vyatta_sbindir}/vyatta-interfaces.pl --show ethernet --vif ${COMP_WORDS[COMP_CWORD-2]} +run: ${vyatta_bindir}/vyatta-show-interfaces.pl --intf="." diff --git a/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/traffic/detail/filter/node.def b/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/traffic/detail/filter/node.def new file mode 100644 index 0000000..b8da469 --- /dev/null +++ b/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/traffic/detail/filter/node.def @@ -0,0 +1 @@ +help: Monitor detailed filtered traffic for the specified ethernet interface diff --git a/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/traffic/detail/filter/node.tag/node.def b/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/traffic/detail/filter/node.tag/node.def new file mode 100644 index 0000000..9f9dbe1 --- /dev/null +++ b/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/traffic/detail/filter/node.tag/node.def @@ -0,0 +1,2 @@ +help: Monitor detailed filtered traffic for the specified ethernet interface +run: ${vyatta_bindir}/vyatta-tshark.pl --intf $4.$6 --detail --filter "${@:10}" diff --git a/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/traffic/detail/node.def b/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/traffic/detail/node.def new file mode 100644 index 0000000..36622fe --- /dev/null +++ b/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/traffic/detail/node.def @@ -0,0 +1,2 @@ +help: Monitor detailed traffic for the specified ethernet interface +run: ${vyatta_bindir}/vyatta-tshark.pl --intf $4.$6 --detail diff --git a/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/traffic/detail/unlimited/filter/node.def b/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/traffic/detail/unlimited/filter/node.def new file mode 100644 index 0000000..b8da469 --- /dev/null +++ b/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/traffic/detail/unlimited/filter/node.def @@ -0,0 +1 @@ +help: Monitor detailed filtered traffic for the specified ethernet interface diff --git a/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/traffic/detail/unlimited/filter/node.tag/node.def b/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/traffic/detail/unlimited/filter/node.tag/node.def new file mode 100644 index 0000000..51ecec7 --- /dev/null +++ b/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/traffic/detail/unlimited/filter/node.tag/node.def @@ -0,0 +1,2 @@ +help: Monitor detailed filtered traffic for the specified ethernet interface +run: ${vyatta_bindir}/vyatta-tshark.pl --intf $4.$6 --detail --unlimited --filter "${@:11}" diff --git a/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/traffic/detail/unlimited/node.def b/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/traffic/detail/unlimited/node.def new file mode 100644 index 0000000..aafe57a --- /dev/null +++ b/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/traffic/detail/unlimited/node.def @@ -0,0 +1,2 @@ +help: Monitor detailed traffic for the specified ethernet interface +run: ${vyatta_bindir}/vyatta-tshark.pl --intf $4.$6 --detail --unlimited diff --git a/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/traffic/filter/node.def b/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/traffic/filter/node.def new file mode 100644 index 0000000..8a12510 --- /dev/null +++ b/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/traffic/filter/node.def @@ -0,0 +1 @@ +help: Monitor filtered traffic for the specified ethernet interface diff --git a/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/traffic/filter/node.tag/node.def b/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/traffic/filter/node.tag/node.def new file mode 100644 index 0000000..9cd78ca --- /dev/null +++ b/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/traffic/filter/node.tag/node.def @@ -0,0 +1,2 @@ +help: Monitor filtered traffic for the specified ethernet interface +run: ${vyatta_bindir}/vyatta-tshark.pl --intf $4.$6 --filter "${@:9}" diff --git a/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/traffic/node.def b/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/traffic/node.def index 51182b2..919a2b2 100644 --- a/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/traffic/node.def +++ b/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/traffic/node.def @@ -1,2 +1,2 @@ -help: Monitor captured traffic on specified ethernet virtual interface -run: /opt/vyatta/bin/vyatta-tshark-interface-port.pl "$4.$6" +help: Montior captured traffic on specified ethernet interface +run: ${vyatta_bindir}/vyatta-tshark.pl --intf $4.$6 diff --git a/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/traffic/save/node.def b/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/traffic/save/node.def new file mode 100644 index 0000000..402f47c --- /dev/null +++ b/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/traffic/save/node.def @@ -0,0 +1 @@ +help: Save monitored traffic to a file diff --git a/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/traffic/save/node.tag/node.def b/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/traffic/save/node.tag/node.def new file mode 100644 index 0000000..e822a9b --- /dev/null +++ b/templates/monitor/interfaces/ethernet/node.tag/vif/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.$6 --save "${@:9}" diff --git a/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/traffic/unlimited/filter/node.def b/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/traffic/unlimited/filter/node.def new file mode 100644 index 0000000..8a12510 --- /dev/null +++ b/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/traffic/unlimited/filter/node.def @@ -0,0 +1 @@ +help: Monitor filtered traffic for the specified ethernet interface diff --git a/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/traffic/unlimited/filter/node.tag/node.def b/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/traffic/unlimited/filter/node.tag/node.def new file mode 100644 index 0000000..d6f26d3 --- /dev/null +++ b/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/traffic/unlimited/filter/node.tag/node.def @@ -0,0 +1,2 @@ +help: Monitor filtered traffic for the specified ethernet interface +run: ${vyatta_bindir}/vyatta-tshark.pl --intf $4.$6 --unlimited --filter "${@:10}" diff --git a/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/traffic/unlimited/node.def b/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/traffic/unlimited/node.def new file mode 100644 index 0000000..2a4f5bc --- /dev/null +++ b/templates/monitor/interfaces/ethernet/node.tag/vif/node.tag/traffic/unlimited/node.def @@ -0,0 +1,2 @@ +help: Monitor traffic for the specified ethernet interface +run: ${vyatta_bindir}/vyatta-tshark.pl --intf $4.$6 --unlimited |