summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDeepti Kulkarni <deepti@vyatta.com>2010-06-24 02:08:02 +0000
committerDeepti Kulkarni <deepti@vyatta.com>2010-06-24 02:08:02 +0000
commit03291945fd1c7bf5dcfcc61415b9ae749ffe962f (patch)
tree67be80602e5fcc627a22c853c88dc62087d39663
parenta2aea11799a4ec4fec15211c96518cdab0641fbb (diff)
downloadvyatta-op-03291945fd1c7bf5dcfcc61415b9ae749ffe962f.tar.gz
vyatta-op-03291945fd1c7bf5dcfcc61415b9ae749ffe962f.zip
Blocked user operator from using show tech-support.
Added new show commands.
-rwxr-xr-xfunctions/tech-support44
-rw-r--r--templates/show/tech-support/brief/node.def7
-rw-r--r--templates/show/tech-support/brief/save-uncompressed/node.def7
-rw-r--r--templates/show/tech-support/brief/save-uncompressed/node.tag/node.def10
-rw-r--r--templates/show/tech-support/brief/save/node.def7
-rw-r--r--templates/show/tech-support/brief/save/node.tag/node.def10
-rw-r--r--templates/show/tech-support/node.def7
-rw-r--r--templates/show/tech-support/save-uncompressed/node.def7
-rw-r--r--templates/show/tech-support/save-uncompressed/node.tag/node.def9
-rw-r--r--templates/show/tech-support/save/node.def7
-rw-r--r--templates/show/tech-support/save/node.tag/node.def9
11 files changed, 94 insertions, 30 deletions
diff --git a/functions/tech-support b/functions/tech-support
index 667747f..1d10a9f 100755
--- a/functions/tech-support
+++ b/functions/tech-support
@@ -319,6 +319,9 @@ dmesg
header PCI Info
sudo lspci -vvx
+header PCI Vendor and Device Codes
+sudo lspci -nn
+
header System Info
${vyatta_bindir}/vyatta-show-dmi
@@ -400,17 +403,16 @@ else
echo "DHCP server is not configured"
fi
-header DHCP Client
-header DHCP Client Leases
-is_dhcp=`show dhcp client leases | wc -l`
-if [ -z is_dhcp ]; then
+header DHCP Client
+is_dhcp=`show dhcp client leases | wc -l`
+if [ "$is_dhcp" == "1" ]; then
echo "DHCP client is not configured"
-else
+else
+header DHCP Client Leases
show dhcp client leases
fi
-
-header DHCPV6
+header DHCPV6 Server
perl /opt/vyatta/bin/node-exists.pl dhcpv6-server service
ret_val=$?
if [ $ret_val -eq 0 ]; then
@@ -418,14 +420,28 @@ header DHCPV6 Server Status
show dhcpv6 server status
header DHCPV6 Server Leases
show dhcpv6 server leases
-header DHCPV6 Relay-Agent
-show dhcpv6 relay-agent
-header DHCPV6 Client Leases
-show dhcpv6 client leases
else
echo "DHCPV6 Server is not configured"
fi
+header DHCPV6 Relay
+perl /opt/vyatta/bin/node-exists.pl dhcpv6-relay service
+ret_val=$?
+if [ $ret_val -eq 0 ]; then
+header DHCPV6 Relay Status
+show dhcpv6 relay-agent status
+else
+echo "DHCPV6 Relay is not configured"
+fi
+
+header DHCPV6 Client
+is_dhcp=`show dhcpv6 client leases | wc -l`
+if [ "$is_dhcp" == "1" ]; then
+echo "DHCPV6 client is not configured"
+else
+header DHCPV6 Client Leases
+show dhcpv6 client leases
+fi
header DNS
perl /opt/vyatta/bin/node-exists.pl dns service
@@ -569,14 +585,14 @@ else
echo "Policy is not configured"
fi
-header QoS
+header Traffic Policy
perl /opt/vyatta/bin/node-exists.pl traffic-policy
ret_val=$?
if [ $ret_val -eq 0 ]; then
header Current Traffic Policies
show queueing
else
-echo "QoS is not configured"
+echo "Traffic-Policy is not configured"
fi
header RIP
@@ -588,7 +604,7 @@ show ip rip
header RIP Status
show ip rip status
header RIP Debugging Information
-show debugging RIP
+show debugging rip
else
echo "RIP is not configured"
fi
diff --git a/templates/show/tech-support/brief/node.def b/templates/show/tech-support/brief/node.def
index 800574c..23f588e 100644
--- a/templates/show/tech-support/brief/node.def
+++ b/templates/show/tech-support/brief/node.def
@@ -1,2 +1,7 @@
help: Show brief tech-support report
-run: source ${vyatta_datadir}/vyatta-op/functions/tech-support-brief
+run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ];
+ then
+ source ${vyatta_datadir}/vyatta-op/functions/tech-support-brief
+ else
+ echo Must be an admin user to run this command
+ fi
diff --git a/templates/show/tech-support/brief/save-uncompressed/node.def b/templates/show/tech-support/brief/save-uncompressed/node.def
index cc271de..7d36614 100644
--- a/templates/show/tech-support/brief/save-uncompressed/node.def
+++ b/templates/show/tech-support/brief/save-uncompressed/node.def
@@ -1,2 +1,7 @@
help: Save uncompressed brief tech-support report
-run: source ${vyatta_datadir}/vyatta-op/functions/tech-support-brief save-uncompressed
+run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ];
+ then
+ source ${vyatta_datadir}/vyatta-op/functions/tech-support-brief save-uncompressed
+ else
+ echo Must be an admin user to run this command
+ fi
diff --git a/templates/show/tech-support/brief/save-uncompressed/node.tag/node.def b/templates/show/tech-support/brief/save-uncompressed/node.tag/node.def
index 523a340..f90ecd4 100644
--- a/templates/show/tech-support/brief/save-uncompressed/node.tag/node.def
+++ b/templates/show/tech-support/brief/save-uncompressed/node.tag/node.def
@@ -1,4 +1,8 @@
help: Save uncompressed brief tech-support report to specified file/path
-allowed: echo -n 'file scp://<user>:<passwd>@<host>/<file> ftp://<user>:<passwd>@<host>/<file>'
-run: source ${vyatta_datadir}/vyatta-op/functions/tech-support-brief save-uncompressed $5
-
+allowed: echo -n '<file> <scp://<user>:<passwd>@<host>/<file>> <ftp://<user>:<passwd>@<host>/<file>>'
+run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ];
+ then
+ source ${vyatta_datadir}/vyatta-op/functions/tech-support-brief save-uncompressed $5
+ else
+ echo Must be an admin user to run this command
+ fi
diff --git a/templates/show/tech-support/brief/save/node.def b/templates/show/tech-support/brief/save/node.def
index c738a0a..966a984 100644
--- a/templates/show/tech-support/brief/save/node.def
+++ b/templates/show/tech-support/brief/save/node.def
@@ -1,2 +1,7 @@
help: Save brief tech-support report
-run: source ${vyatta_datadir}/vyatta-op/functions/tech-support-brief save
+run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ];
+ then
+ source ${vyatta_datadir}/vyatta-op/functions/tech-support-brief save
+ else
+ echo Must be an admin user to run this command
+ fi
diff --git a/templates/show/tech-support/brief/save/node.tag/node.def b/templates/show/tech-support/brief/save/node.tag/node.def
index 95aaa87..97ebdf6 100644
--- a/templates/show/tech-support/brief/save/node.tag/node.def
+++ b/templates/show/tech-support/brief/save/node.tag/node.def
@@ -1,4 +1,8 @@
help: Save compressed brief tech-support report to specified file/path
-allowed: echo -n 'file scp://<user>:<passwd>@<host>/<file> ftp://<user>:<passwd>@<host>/<file>'
-run: source ${vyatta_datadir}/vyatta-op/functions/tech-support-brief save $5
-
+allowed: echo -n '<file> <scp://<user>:<passwd>@<host>/<file>> <ftp://<user>:<passwd>@<host>/<file>>'
+run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ];
+ then
+ source ${vyatta_datadir}/vyatta-op/functions/tech-support-brief save $5
+ else
+ echo Must be an admin user to run this command
+ fi
diff --git a/templates/show/tech-support/node.def b/templates/show/tech-support/node.def
index e47842b..34d8e22 100644
--- a/templates/show/tech-support/node.def
+++ b/templates/show/tech-support/node.def
@@ -1,2 +1,7 @@
help: Show consolidated tech-support report
-run: source ${vyatta_datadir}/vyatta-op/functions/tech-support
+run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ];
+ then
+ source ${vyatta_datadir}/vyatta-op/functions/tech-support
+ else
+ echo Must be an admin user to run this command
+ fi
diff --git a/templates/show/tech-support/save-uncompressed/node.def b/templates/show/tech-support/save-uncompressed/node.def
index 71c774a..4036eaf 100644
--- a/templates/show/tech-support/save-uncompressed/node.def
+++ b/templates/show/tech-support/save-uncompressed/node.def
@@ -1,2 +1,7 @@
help: Save consolidated tech-support report uncompressed
-run: source ${vyatta_datadir}/vyatta-op/functions/tech-support save-uncompressed
+run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ];
+ then
+ source ${vyatta_datadir}/vyatta-op/functions/tech-support save-uncompressed
+ else
+ echo Must be an admin user to run this command.
+ fi
diff --git a/templates/show/tech-support/save-uncompressed/node.tag/node.def b/templates/show/tech-support/save-uncompressed/node.tag/node.def
index adf21ee..41efd2f 100644
--- a/templates/show/tech-support/save-uncompressed/node.tag/node.def
+++ b/templates/show/tech-support/save-uncompressed/node.tag/node.def
@@ -1,3 +1,8 @@
help: Save uncompressed tech-support report to specified file/path
-allowed: echo -n 'file scp://<user>:<passwd>@<host>/<file> ftp://<user>:<passwd>@<host>/<file>'
-run: source ${vyatta_datadir}/vyatta-op/functions/tech-support save-uncompressed $4
+allowed: echo -n '<file> <scp://<user>:<passwd>@<host>/<file>> <ftp://<user>:<passwd>@<host>/<file>>'
+run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ];
+ then
+ source ${vyatta_datadir}/vyatta-op/functions/tech-support save-uncompressed $4
+ else
+ echo Must be an admin user to run this command
+ fi
diff --git a/templates/show/tech-support/save/node.def b/templates/show/tech-support/save/node.def
index 874339b..54635d6 100644
--- a/templates/show/tech-support/save/node.def
+++ b/templates/show/tech-support/save/node.def
@@ -1,2 +1,7 @@
help: Save consolidated tech-support report
-run: source ${vyatta_datadir}/vyatta-op/functions/tech-support save
+run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ];
+ then
+ source ${vyatta_datadir}/vyatta-op/functions/tech-support save
+ else
+ echo Must be an admin user to run this command
+ fi
diff --git a/templates/show/tech-support/save/node.tag/node.def b/templates/show/tech-support/save/node.tag/node.def
index 5722c19..ac8f56f 100644
--- a/templates/show/tech-support/save/node.tag/node.def
+++ b/templates/show/tech-support/save/node.tag/node.def
@@ -1,3 +1,8 @@
help: Save compressed tech-support report to the specified file/path
-allowed: echo -n 'file scp://<user>:<passwd>@<host>/<file> ftp://<user>:<passwd>@<host>/<file>'
-run: source ${vyatta_datadir}/vyatta-op/functions/tech-support save $4
+allowed: echo -n '<file> <scp://<user>:<passwd>@<host>/<file>> <ftp://<user>:<passwd>@<host>/<file>>'
+run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ];
+ then
+ source ${vyatta_datadir}/vyatta-op/functions/tech-support save $4
+ else
+ echo Must be an admin user to run this command
+ fi