summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorStig Thormodsrud <stig@vyatta.com>2008-02-08 15:04:40 -0800
committerStig Thormodsrud <stig@vyatta.com>2008-02-08 15:04:40 -0800
commit779df7e2f84b2750f33c073b2f310398d9f8a0fa (patch)
tree5978292710565815ff0e8308947732f61cc71650 /templates
parent4647ef1a3a84880cc7a52d2bf74163d7e470b150 (diff)
downloadvyatta-op-779df7e2f84b2750f33c073b2f310398d9f8a0fa.tar.gz
vyatta-op-779df7e2f84b2750f33c073b2f310398d9f8a0fa.zip
- Fix bug 776: need "clear interface" command to clear counters
- Fix bug 1095: Enhancement Request: "Show interface brief" command - Change default to "brief" if multiple interfaces can be shown - Add "detail" for nodes defaulting to brief - Add "brief" for nodes defaulting to detail - Fix vif completions that wasn't working - Remove ethtool can on vlans since it doesn't work
Diffstat (limited to 'templates')
-rw-r--r--templates/clear/interfaces/bridge/counters/node.def2
-rw-r--r--templates/clear/interfaces/bridge/node.def1
-rw-r--r--templates/clear/interfaces/bridge/node.tag/counters/node.def2
-rw-r--r--templates/clear/interfaces/bridge/node.tag/node.def4
-rw-r--r--templates/clear/interfaces/counters/node.def2
-rw-r--r--templates/clear/interfaces/ethernet/counters/node.def2
-rw-r--r--templates/clear/interfaces/ethernet/node.def1
-rw-r--r--templates/clear/interfaces/ethernet/node.tag/counters/node.def2
-rw-r--r--templates/clear/interfaces/ethernet/node.tag/node.def4
-rw-r--r--templates/clear/interfaces/loopback/counters/node.def2
-rw-r--r--templates/clear/interfaces/loopback/node.def1
-rw-r--r--templates/clear/interfaces/loopback/node.tag/counters/node.def2
-rw-r--r--templates/clear/interfaces/loopback/node.tag/node.def4
-rw-r--r--templates/clear/interfaces/tunnel/counters/node.def2
-rw-r--r--templates/clear/interfaces/tunnel/node.def1
-rw-r--r--templates/clear/interfaces/tunnel/node.tag/counters/node.def2
-rw-r--r--templates/clear/interfaces/tunnel/node.tag/node.def4
-rw-r--r--templates/show/interfaces/bridge/detail/node.def2
-rw-r--r--templates/show/interfaces/bridge/node.def2
-rw-r--r--templates/show/interfaces/bridge/node.tag/brief/node.def2
-rw-r--r--templates/show/interfaces/bridge/node.tag/node.def5
-rw-r--r--templates/show/interfaces/detail/node.def2
-rw-r--r--templates/show/interfaces/ethernet/detail/node.def2
-rw-r--r--templates/show/interfaces/ethernet/node.def2
-rw-r--r--templates/show/interfaces/ethernet/node.tag/brief/node.def2
-rw-r--r--templates/show/interfaces/ethernet/node.tag/node.def12
-rw-r--r--templates/show/interfaces/ethernet/node.tag/physical/node.def2
-rw-r--r--templates/show/interfaces/ethernet/node.tag/vif/node.tag/brief/node.def2
-rw-r--r--templates/show/interfaces/ethernet/node.tag/vif/node.tag/node.def8
-rw-r--r--templates/show/interfaces/ethernet/node.tag/vif/node.tag/physical/node.def2
-rw-r--r--templates/show/interfaces/loopback/detail/node.def2
-rw-r--r--templates/show/interfaces/loopback/node.def3
-rw-r--r--templates/show/interfaces/loopback/node.tag/brief/node.def2
-rw-r--r--templates/show/interfaces/loopback/node.tag/node.def2
-rw-r--r--templates/show/interfaces/node.def2
-rw-r--r--templates/show/interfaces/tunnel/detail/node.def2
-rw-r--r--templates/show/interfaces/tunnel/node.def3
-rw-r--r--templates/show/interfaces/tunnel/node.tag/brief/node.def2
-rw-r--r--templates/show/interfaces/tunnel/node.tag/node.def2
39 files changed, 84 insertions, 19 deletions
diff --git a/templates/clear/interfaces/bridge/counters/node.def b/templates/clear/interfaces/bridge/counters/node.def
new file mode 100644
index 0000000..ad13229
--- /dev/null
+++ b/templates/clear/interfaces/bridge/counters/node.def
@@ -0,0 +1,2 @@
+help: Clear all bridge interface counters
+run: sudo ${vyatta_bindir}/vyatta-show-interfaces.pl --action=clear --intf-type=$3
diff --git a/templates/clear/interfaces/bridge/node.def b/templates/clear/interfaces/bridge/node.def
new file mode 100644
index 0000000..a89b724
--- /dev/null
+++ b/templates/clear/interfaces/bridge/node.def
@@ -0,0 +1 @@
+help: Clear bridge interface information
diff --git a/templates/clear/interfaces/bridge/node.tag/counters/node.def b/templates/clear/interfaces/bridge/node.tag/counters/node.def
new file mode 100644
index 0000000..985e9ab
--- /dev/null
+++ b/templates/clear/interfaces/bridge/node.tag/counters/node.def
@@ -0,0 +1,2 @@
+help: Clear interface counters for a given interface
+run: sudo ${vyatta_bindir}/vyatta-show-interfaces.pl --action=clear --intf=$4
diff --git a/templates/clear/interfaces/bridge/node.tag/node.def b/templates/clear/interfaces/bridge/node.tag/node.def
new file mode 100644
index 0000000..4b6256e
--- /dev/null
+++ b/templates/clear/interfaces/bridge/node.tag/node.def
@@ -0,0 +1,4 @@
+help: Clear interface information for a given interface
+allowed: local -a array ;
+ array=( /sys/class/net/br* ) ;
+ echo -n ${array[@]##*/}
diff --git a/templates/clear/interfaces/counters/node.def b/templates/clear/interfaces/counters/node.def
new file mode 100644
index 0000000..252251a
--- /dev/null
+++ b/templates/clear/interfaces/counters/node.def
@@ -0,0 +1,2 @@
+help: Clear interface counters for all interfaces
+run: sudo ${vyatta_bindir}/vyatta-show-interfaces.pl --action=clear
diff --git a/templates/clear/interfaces/ethernet/counters/node.def b/templates/clear/interfaces/ethernet/counters/node.def
new file mode 100644
index 0000000..e05e218
--- /dev/null
+++ b/templates/clear/interfaces/ethernet/counters/node.def
@@ -0,0 +1,2 @@
+help: Clear all Ethernet interface counters
+run: sudo ${vyatta_bindir}/vyatta-show-interfaces.pl --action=clear --intf-type=$3
diff --git a/templates/clear/interfaces/ethernet/node.def b/templates/clear/interfaces/ethernet/node.def
new file mode 100644
index 0000000..3e6f0dc
--- /dev/null
+++ b/templates/clear/interfaces/ethernet/node.def
@@ -0,0 +1 @@
+help: Clear Ethernet interface information
diff --git a/templates/clear/interfaces/ethernet/node.tag/counters/node.def b/templates/clear/interfaces/ethernet/node.tag/counters/node.def
new file mode 100644
index 0000000..985e9ab
--- /dev/null
+++ b/templates/clear/interfaces/ethernet/node.tag/counters/node.def
@@ -0,0 +1,2 @@
+help: Clear interface counters for a given interface
+run: sudo ${vyatta_bindir}/vyatta-show-interfaces.pl --action=clear --intf=$4
diff --git a/templates/clear/interfaces/ethernet/node.tag/node.def b/templates/clear/interfaces/ethernet/node.tag/node.def
new file mode 100644
index 0000000..4f39ebf
--- /dev/null
+++ b/templates/clear/interfaces/ethernet/node.tag/node.def
@@ -0,0 +1,4 @@
+help: Clear interface information for a given interface
+allowed: local -a array ;
+ array=( /sys/class/net/eth* ) ;
+ echo -n ${array[@]##*/}
diff --git a/templates/clear/interfaces/loopback/counters/node.def b/templates/clear/interfaces/loopback/counters/node.def
new file mode 100644
index 0000000..5ebcd3d
--- /dev/null
+++ b/templates/clear/interfaces/loopback/counters/node.def
@@ -0,0 +1,2 @@
+help: Clear all loopback interface counters
+run: sudo ${vyatta_bindir}/vyatta-show-interfaces.pl --action=clear --intf-type=$3
diff --git a/templates/clear/interfaces/loopback/node.def b/templates/clear/interfaces/loopback/node.def
new file mode 100644
index 0000000..eb3221f
--- /dev/null
+++ b/templates/clear/interfaces/loopback/node.def
@@ -0,0 +1 @@
+help: Clear loopback interface information
diff --git a/templates/clear/interfaces/loopback/node.tag/counters/node.def b/templates/clear/interfaces/loopback/node.tag/counters/node.def
new file mode 100644
index 0000000..985e9ab
--- /dev/null
+++ b/templates/clear/interfaces/loopback/node.tag/counters/node.def
@@ -0,0 +1,2 @@
+help: Clear interface counters for a given interface
+run: sudo ${vyatta_bindir}/vyatta-show-interfaces.pl --action=clear --intf=$4
diff --git a/templates/clear/interfaces/loopback/node.tag/node.def b/templates/clear/interfaces/loopback/node.tag/node.def
new file mode 100644
index 0000000..cfefa98
--- /dev/null
+++ b/templates/clear/interfaces/loopback/node.tag/node.def
@@ -0,0 +1,4 @@
+help: Clear interface counters for a given interface
+allowed: local -a array ;
+ array=( /sys/class/net/lo* ) ;
+ echo -n ${array[@]##*/}
diff --git a/templates/clear/interfaces/tunnel/counters/node.def b/templates/clear/interfaces/tunnel/counters/node.def
new file mode 100644
index 0000000..c856a04
--- /dev/null
+++ b/templates/clear/interfaces/tunnel/counters/node.def
@@ -0,0 +1,2 @@
+help: Clear all tunnel interface counters
+run: sudo ${vyatta_bindir}/vyatta-show-interfaces.pl --action=clear --intf-type=$3
diff --git a/templates/clear/interfaces/tunnel/node.def b/templates/clear/interfaces/tunnel/node.def
new file mode 100644
index 0000000..c704813
--- /dev/null
+++ b/templates/clear/interfaces/tunnel/node.def
@@ -0,0 +1 @@
+help: Clear tunnel interface information
diff --git a/templates/clear/interfaces/tunnel/node.tag/counters/node.def b/templates/clear/interfaces/tunnel/node.tag/counters/node.def
new file mode 100644
index 0000000..985e9ab
--- /dev/null
+++ b/templates/clear/interfaces/tunnel/node.tag/counters/node.def
@@ -0,0 +1,2 @@
+help: Clear interface counters for a given interface
+run: sudo ${vyatta_bindir}/vyatta-show-interfaces.pl --action=clear --intf=$4
diff --git a/templates/clear/interfaces/tunnel/node.tag/node.def b/templates/clear/interfaces/tunnel/node.tag/node.def
new file mode 100644
index 0000000..cf85a2c
--- /dev/null
+++ b/templates/clear/interfaces/tunnel/node.tag/node.def
@@ -0,0 +1,4 @@
+help: Clear interface information for a given interface
+allowed: local -a array ;
+ array=( /sys/class/net/tun* ) ;
+ echo -n ${array[@]##*/}
diff --git a/templates/show/interfaces/bridge/detail/node.def b/templates/show/interfaces/bridge/detail/node.def
new file mode 100644
index 0000000..442317a
--- /dev/null
+++ b/templates/show/interfaces/bridge/detail/node.def
@@ -0,0 +1,2 @@
+help: Show detailed bridge interface information
+run: ${vyatta_bindir}/vyatta-show-interfaces.pl --intf-type=bridge --action=show
diff --git a/templates/show/interfaces/bridge/node.def b/templates/show/interfaces/bridge/node.def
new file mode 100644
index 0000000..006dc64
--- /dev/null
+++ b/templates/show/interfaces/bridge/node.def
@@ -0,0 +1,2 @@
+help: Show bridge interface information
+run: ${vyatta_bindir}/vyatta-show-interfaces.pl --intf-type=bridge --action=show-brief
diff --git a/templates/show/interfaces/bridge/node.tag/brief/node.def b/templates/show/interfaces/bridge/node.tag/brief/node.def
new file mode 100644
index 0000000..b277607
--- /dev/null
+++ b/templates/show/interfaces/bridge/node.tag/brief/node.def
@@ -0,0 +1,2 @@
+help: Show summary of a given bridge interface information
+run: ${vyatta_bindir}/vyatta-show-interfaces.pl --intf=$4 --action=show-brief
diff --git a/templates/show/interfaces/bridge/node.tag/node.def b/templates/show/interfaces/bridge/node.tag/node.def
new file mode 100644
index 0000000..9248741
--- /dev/null
+++ b/templates/show/interfaces/bridge/node.tag/node.def
@@ -0,0 +1,5 @@
+help: Show given bridge interface information
+allowed: local -a array ;
+ array=( /sys/class/net/br* ) ;
+ echo -n ${array[@]##*/}
+run: ${vyatta_bindir}/vyatta-show-interfaces.pl --intf=$4
diff --git a/templates/show/interfaces/detail/node.def b/templates/show/interfaces/detail/node.def
new file mode 100644
index 0000000..f875ce8
--- /dev/null
+++ b/templates/show/interfaces/detail/node.def
@@ -0,0 +1,2 @@
+help: Show detail information of all interfaces
+run: ${vyatta_bindir}/vyatta-show-interfaces.pl --action=show
diff --git a/templates/show/interfaces/ethernet/detail/node.def b/templates/show/interfaces/ethernet/detail/node.def
new file mode 100644
index 0000000..9883539
--- /dev/null
+++ b/templates/show/interfaces/ethernet/detail/node.def
@@ -0,0 +1,2 @@
+help: Show ethernet interface information
+run: ${vyatta_bindir}/vyatta-show-interfaces.pl --intf-type=ethernet --action=show
diff --git a/templates/show/interfaces/ethernet/node.def b/templates/show/interfaces/ethernet/node.def
index 9ece668..5c31928 100644
--- a/templates/show/interfaces/ethernet/node.def
+++ b/templates/show/interfaces/ethernet/node.def
@@ -1,2 +1,2 @@
help: Show ethernet interface information
-run: ${vyatta_bindir}/vyatta-show-interfaces ethernet
+run: ${vyatta_bindir}/vyatta-show-interfaces.pl --intf-type=ethernet --action=show-brief
diff --git a/templates/show/interfaces/ethernet/node.tag/brief/node.def b/templates/show/interfaces/ethernet/node.tag/brief/node.def
new file mode 100644
index 0000000..52b3870
--- /dev/null
+++ b/templates/show/interfaces/ethernet/node.tag/brief/node.def
@@ -0,0 +1,2 @@
+help: Show given ethernet interface information
+run: ${vyatta_bindir}/vyatta-show-interfaces.pl --intf=$4 --action=show-brief
diff --git a/templates/show/interfaces/ethernet/node.tag/node.def b/templates/show/interfaces/ethernet/node.tag/node.def
index cf3e112..3dab472 100644
--- a/templates/show/interfaces/ethernet/node.tag/node.def
+++ b/templates/show/interfaces/ethernet/node.tag/node.def
@@ -1,5 +1,9 @@
help: Show given ethernet interface information
-allowed: local -a array ;
- array=( /sys/class/net/{eth,vmnet}* ) ;
- echo -n ${array[@]##*/}
-run: ${vyatta_bindir}/vyatta-show-interfaces ethernet $4
+allowed: for dev in /sys/class/net/*;
+ do if [[ -L $dev/device ]]
+ then if [[ $(cat $dev/type) -eq 1 ]]
+ then echo -n ${dev##*/} " "
+ fi
+ fi
+ done
+run: ${vyatta_bindir}/vyatta-show-interfaces.pl --intf=$4
diff --git a/templates/show/interfaces/ethernet/node.tag/physical/node.def b/templates/show/interfaces/ethernet/node.tag/physical/node.def
index a9628fd..98f0170 100644
--- a/templates/show/interfaces/ethernet/node.tag/physical/node.def
+++ b/templates/show/interfaces/ethernet/node.tag/physical/node.def
@@ -1,3 +1,3 @@
help: Show physical device information of given ethernet interface
allowed: ""
-run: sudo ${vyatta_bindir}/sudo-users/ethtool $4
+run: sudo ${vyatta_bindir}/sudo-users/ethtool $4; sudo ${vyatta_bindir}/sudo-users/ethtool -i $4
diff --git a/templates/show/interfaces/ethernet/node.tag/vif/node.tag/brief/node.def b/templates/show/interfaces/ethernet/node.tag/vif/node.tag/brief/node.def
new file mode 100644
index 0000000..956be62
--- /dev/null
+++ b/templates/show/interfaces/ethernet/node.tag/vif/node.tag/brief/node.def
@@ -0,0 +1,2 @@
+help: Show given virtual network interface information
+run: ${vyatta_bindir}/vyatta-show-interfaces.pl --intf=$4.$6 --action=show-brief
diff --git a/templates/show/interfaces/ethernet/node.tag/vif/node.tag/node.def b/templates/show/interfaces/ethernet/node.tag/vif/node.tag/node.def
index 68d3b02..813637b 100644
--- a/templates/show/interfaces/ethernet/node.tag/vif/node.tag/node.def
+++ b/templates/show/interfaces/ethernet/node.tag/vif/node.tag/node.def
@@ -1,5 +1,5 @@
help: Show given virtual network interface information
-allowed: for eth in /sys/class/net/eth${4}.* ; do
- echo ${eth/*eth${4}./} ;
- done
-run: ${vyatta_bindir}/vyatta-show-interfaces ethernet $4 vif $6
+allowed: local -a array ;
+ array=( /sys/class/net/${COMP_WORDS[3]}.* ) ;
+ echo -n ${array[@]##*.}
+run: ${vyatta_bindir}/vyatta-show-interfaces.pl --intf=$4.$6
diff --git a/templates/show/interfaces/ethernet/node.tag/vif/node.tag/physical/node.def b/templates/show/interfaces/ethernet/node.tag/vif/node.tag/physical/node.def
deleted file mode 100644
index 9769aaa..0000000
--- a/templates/show/interfaces/ethernet/node.tag/vif/node.tag/physical/node.def
+++ /dev/null
@@ -1,2 +0,0 @@
-help: Show given virtual network interface pseudo-physical information
-run: sudo ${vyatta_bindir}/sudo-users/ethtool $4.$6
diff --git a/templates/show/interfaces/loopback/detail/node.def b/templates/show/interfaces/loopback/detail/node.def
new file mode 100644
index 0000000..759407a
--- /dev/null
+++ b/templates/show/interfaces/loopback/detail/node.def
@@ -0,0 +1,2 @@
+help: Show loopback interface information
+run: ${vyatta_bindir}/vyatta-show-interfaces.pl --intf-type=loopback
diff --git a/templates/show/interfaces/loopback/node.def b/templates/show/interfaces/loopback/node.def
index cbf6238..bee95ea 100644
--- a/templates/show/interfaces/loopback/node.def
+++ b/templates/show/interfaces/loopback/node.def
@@ -1,3 +1,2 @@
help: Show loopback interface information
-run: ${vyatta_bindir}/vyatta-show-interfaces loopback
-
+run: ${vyatta_bindir}/vyatta-show-interfaces.pl --intf-type=loopback --action=show-brief
diff --git a/templates/show/interfaces/loopback/node.tag/brief/node.def b/templates/show/interfaces/loopback/node.tag/brief/node.def
new file mode 100644
index 0000000..ca5cc37
--- /dev/null
+++ b/templates/show/interfaces/loopback/node.tag/brief/node.def
@@ -0,0 +1,2 @@
+help: Show summary of given loopback interface information
+run: ${vyatta_bindir}/vyatta-show-interfaces.pl --intf=$4 --action=show-brief
diff --git a/templates/show/interfaces/loopback/node.tag/node.def b/templates/show/interfaces/loopback/node.tag/node.def
index f1c11ed..ff6eec5 100644
--- a/templates/show/interfaces/loopback/node.tag/node.def
+++ b/templates/show/interfaces/loopback/node.tag/node.def
@@ -2,4 +2,4 @@ help: Show given loopback interface information
allowed: local -a array ;
array=( /sys/class/net/lo* ) ;
echo -n ${array[@]##*/}
-run: ${vyatta_bindir}/vyatta-show-interfaces loopback $4
+run: ${vyatta_bindir}/vyatta-show-interfaces.pl --intf=$4
diff --git a/templates/show/interfaces/node.def b/templates/show/interfaces/node.def
index c898266..aac2ea3 100644
--- a/templates/show/interfaces/node.def
+++ b/templates/show/interfaces/node.def
@@ -1,2 +1,2 @@
help: Show network interface information
-run: ${vyatta_bindir}/vyatta-show-interfaces
+run: ${vyatta_bindir}/vyatta-show-interfaces.pl --action=show-brief
diff --git a/templates/show/interfaces/tunnel/detail/node.def b/templates/show/interfaces/tunnel/detail/node.def
new file mode 100644
index 0000000..d3c8d95
--- /dev/null
+++ b/templates/show/interfaces/tunnel/detail/node.def
@@ -0,0 +1,2 @@
+help: Show tunnel interface information
+run: ${vyatta_bindir}/vyatta-show-interfaces.pl --intf-type=tunnel --action=show \ No newline at end of file
diff --git a/templates/show/interfaces/tunnel/node.def b/templates/show/interfaces/tunnel/node.def
index bfc03ba..568578b 100644
--- a/templates/show/interfaces/tunnel/node.def
+++ b/templates/show/interfaces/tunnel/node.def
@@ -1,3 +1,2 @@
help: Show tunnel interface information
-run: ${vyatta_bindir}/vyatta-show-interfaces tunnel
-
+run: ${vyatta_bindir}/vyatta-show-interfaces.pl --intf-type=tunnel --action=show-brief
diff --git a/templates/show/interfaces/tunnel/node.tag/brief/node.def b/templates/show/interfaces/tunnel/node.tag/brief/node.def
new file mode 100644
index 0000000..cf2b8da
--- /dev/null
+++ b/templates/show/interfaces/tunnel/node.tag/brief/node.def
@@ -0,0 +1,2 @@
+help: Show given tunnel interface information
+run: ${vyatta_bindir}/vyatta-show-interfaces.pl --intf=$4 --action=show-brief
diff --git a/templates/show/interfaces/tunnel/node.tag/node.def b/templates/show/interfaces/tunnel/node.tag/node.def
index c119ab0..12630bd 100644
--- a/templates/show/interfaces/tunnel/node.tag/node.def
+++ b/templates/show/interfaces/tunnel/node.tag/node.def
@@ -2,4 +2,4 @@ help: Show given tunnel interface information
allowed: local -a array ;
array=( /sys/class/net/tun* ) ;
echo -n ${array[@]##*/}
-run: ${vyatta_bindir}/vyatta-show-interfaces tunnel $4
+run: ${vyatta_bindir}/vyatta-show-interfaces.pl --intf=$4