You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by kk...@apache.org on 2014/11/27 09:59:06 UTC
svn commit: r1642046 - /tomcat/tc6.0.x/trunk/webapps/docs/manager-howto.xml
Author: kkolinko
Date: Thu Nov 27 08:59:05 2014
New Revision: 1642046
URL: http://svn.apache.org/r1642046
Log:
CTR: docs
Improving manager documentation.
Swap "Using JMXProxy" and "Ant" sections. No change in the text of the sections themselves.
Backport of r1642043 from Tomcat 7.
Modified:
tomcat/tc6.0.x/trunk/webapps/docs/manager-howto.xml
Modified: tomcat/tc6.0.x/trunk/webapps/docs/manager-howto.xml
URL: http://svn.apache.org/viewvc/tomcat/tc6.0.x/trunk/webapps/docs/manager-howto.xml?rev=1642046&r1=1642045&r2=1642046&view=diff
==============================================================================
--- tomcat/tc6.0.x/trunk/webapps/docs/manager-howto.xml (original)
+++ tomcat/tc6.0.x/trunk/webapps/docs/manager-howto.xml Thu Nov 27 08:59:05 2014
@@ -1022,6 +1022,91 @@ The same information is available for bo
</section>
+<section name="Using the JMX Proxy Servlet">
+
+ <subsection name="What is JMX Proxy Servlet">
+ The JMX Proxy Servlet is a lightweight proxy to get and set the
+ tomcat internals. (Or any class that has been exposed via an MBean)
+ Its usage is not very user friendly but the UI is
+ extremely help for integrating command line scripts for monitoring
+ and changing the internals of tomcat. You can do two things with the proxy:
+ get information and set information. For you to really understand the
+ JMX Proxy Servlet, you should have a general understanding of JMX.
+ If you don't know what JMX is, then prepare to be confused.
+ </subsection>
+
+ <subsection name="JMX Query command">
+ This takes the form:
+<source>
+http://webserver/manager/jmxproxy/?qry=STUFF
+</source>
+ Where <code>STUFF</code> is the JMX query you wish to perform. For example,
+ here are some queries you might wish to run:
+ <ul>
+ <li>
+ <code>qry=*%3Atype%3DRequestProcessor%2C* -->
+ type=RequestProcessor</code> which will locate all
+ workers which can process requests and report
+ their state.
+ </li>
+ <li>
+ <code>qry=*%3Aj2eeType=Servlet%2c* -->
+ j2eeType=Servlet</code> which return all loaded servlets.
+ </li>
+ <li>
+ <code>qry=Catalina%3Atype%3DEnvironment%2Cresourcetype%3DGlobal%2Cname%3DsimpleValue -->
+ Catalina:type=Environment,resourcetype=Global,name=simpleValue</code>
+ which look for a specific MBean by the given name.
+ </li>
+ </ul>
+ You'll need to experiment with this to really understand its capabilites.
+ If you provide no <code>qry</code> parameter, then all of the MBeans will
+ be displayed. We really recommend looking at the tomcat source code and
+ understand the JMX spec to get a better understanding of all the queries
+ you may run.
+ </subsection>
+
+ <subsection name="JMX Set command">
+ Now that you can query an MBean, its time to muck with Tomcat's internals!
+ The general form of the set command is :
+<source>
+http://webserver/manager/jmxproxy/?set=BEANNAME&att=MYATTRIBUTE&val=NEWVALUE
+</source>
+ So you need to provide 3 request parameters:
+ <ol>
+ <li><code>set</code>: The full bean name</li>
+ <li><code>att</code>: The attribute you wish to alter</li>
+ <li><code>val</code>: The new value </li>
+ </ol>
+ If all goes ok, then it will say OK, otherwise an error message will be
+ shown. For example, lets say we wish to turn up debugging on the fly for the
+ <code>ErrorReportValve</code>. The following will set debugging to 10.
+<source>
+http://localhost:8080/manager/jmxproxy/
+ ?set=Catalina%3Atype%3DValve%2Cname%3DErrorReportValve%2Chost%3Dlocalhost
+ &att=debug&val=10
+</source>
+ and my result is (YMMV):
+<source>
+Result: ok
+</source>
+
+ Here is what I see if I pass in a bad value. Here is the URL I used,
+ I try set debugging equal to 'cow':
+<source>
+http://localhost:8080/manager/jmxproxy/
+ ?set=Catalina%3Atype%3DValve%2Cname%3DErrorReportValve%2Chost%3Dlocalhost
+ &att=debug&val=cow
+</source>
+ When I try that, my result is
+<source>
+Error: java.lang.NumberFormatException: For input string: "cow"
+</source>
+ </subsection>
+
+
+</section>
+
<section name="Executing Manager Commands With Ant">
<p>In addition to the ability to execute Manager commands via HTTP requests,
@@ -1316,91 +1401,6 @@ see the output of each task call appende
</section>
-<section name="Using the JMX Proxy Servlet">
-
- <subsection name="What is JMX Proxy Servlet">
- The JMX Proxy Servlet is a lightweight proxy to get and set the
- tomcat internals. (Or any class that has been exposed via an MBean)
- Its usage is not very user friendly but the UI is
- extremely help for integrating command line scripts for monitoring
- and changing the internals of tomcat. You can do two things with the proxy:
- get information and set information. For you to really understand the
- JMX Proxy Servlet, you should have a general understanding of JMX.
- If you don't know what JMX is, then prepare to be confused.
- </subsection>
-
- <subsection name="JMX Query command">
- This takes the form:
-<source>
-http://webserver/manager/jmxproxy/?qry=STUFF
-</source>
- Where <code>STUFF</code> is the JMX query you wish to perform. For example,
- here are some queries you might wish to run:
- <ul>
- <li>
- <code>qry=*%3Atype%3DRequestProcessor%2C* -->
- type=RequestProcessor</code> which will locate all
- workers which can process requests and report
- their state.
- </li>
- <li>
- <code>qry=*%3Aj2eeType=Servlet%2c* -->
- j2eeType=Servlet</code> which return all loaded servlets.
- </li>
- <li>
- <code>qry=Catalina%3Atype%3DEnvironment%2Cresourcetype%3DGlobal%2Cname%3DsimpleValue -->
- Catalina:type=Environment,resourcetype=Global,name=simpleValue</code>
- which look for a specific MBean by the given name.
- </li>
- </ul>
- You'll need to experiment with this to really understand its capabilites.
- If you provide no <code>qry</code> parameter, then all of the MBeans will
- be displayed. We really recommend looking at the tomcat source code and
- understand the JMX spec to get a better understanding of all the queries
- you may run.
- </subsection>
-
- <subsection name="JMX Set command">
- Now that you can query an MBean, its time to muck with Tomcat's internals!
- The general form of the set command is :
-<source>
-http://webserver/manager/jmxproxy/?set=BEANNAME&att=MYATTRIBUTE&val=NEWVALUE
-</source>
- So you need to provide 3 request parameters:
- <ol>
- <li><code>set</code>: The full bean name</li>
- <li><code>att</code>: The attribute you wish to alter</li>
- <li><code>val</code>: The new value </li>
- </ol>
- If all goes ok, then it will say OK, otherwise an error message will be
- shown. For example, lets say we wish to turn up debugging on the fly for the
- <code>ErrorReportValve</code>. The following will set debugging to 10.
-<source>
-http://localhost:8080/manager/jmxproxy/
- ?set=Catalina%3Atype%3DValve%2Cname%3DErrorReportValve%2Chost%3Dlocalhost
- &att=debug&val=10
-</source>
- and my result is (YMMV):
-<source>
-Result: ok
-</source>
-
- Here is what I see if I pass in a bad value. Here is the URL I used,
- I try set debugging equal to 'cow':
-<source>
-http://localhost:8080/manager/jmxproxy/
- ?set=Catalina%3Atype%3DValve%2Cname%3DErrorReportValve%2Chost%3Dlocalhost
- &att=debug&val=cow
-</source>
- When I try that, my result is
-<source>
-Error: java.lang.NumberFormatException: For input string: "cow"
-</source>
- </subsection>
-
-
-</section>
-
</body>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org