📄 resin-admin.xtp
字号:
<i>Choose Resin's JVM from the "Local" list.</i></example><example title="Start Resin and allow remote JMX administration"><resin xmlns="http://caucho.com/ns/resin"><cluster id=""> <server-default> <jvm-arg>-Dcom.sun.management.jmxremote.port=9999</jvm-arg> </server-default> ...</cluster></resin></example><p>Without some configuration effort, the previous command will not work.Password configuration and SSL configuration is required by the JDKimplementation of remote JMX. Detailed instructions are included in the JDKdocumentation.</p><p>The following is useful for testing, but should be done with caution as theport is not protected by password or by SSL, and if not protected by a firewallis accessible by anyone who can guess the port number.</p><example title="Start Resin and remote JMX - disable password checking and SSL"><resin xmlns="http://caucho.com/ns/resin"><cluster id=""> <server-default> <jvm-arg>-Dcom.sun.management.jmxremote.port=9999</jvm-arg> <jvm-arg>-Dcom.sun.management.jmxremote.ssl=false</jvm-arg> <jvm-arg>-Dcom.sun.management.jmxremote.authenticate=false</jvm-arg> </server-default> ...</cluster></resin></example><example title="Start jconsole">win> jconsole.exeunix> jconsole<i>Enter the host name and port number (9999) on the "Remote" tab</i></example><example title="Setting a password for remote JMX access">$ cd $JAVA_HOME/jre/lib/management$ cp jmxremote.password.template jmxremote.password$ chmod u=rw jmxremote.password$ vi jmxremote.password<i>Set a password for "monitorRole" and "controlRole":</i>monitorRole 12monitorcontrolRole 55control</example><example title="Start Resin and remote JMX - disable SSL"><resin xmlns="http://caucho.com/ns/resin"><cluster id=""> <server-default> <jvm-arg>-Dcom.sun.management.jmxremote.port=9999</jvm-arg> <jvm-arg>-Dcom.sun.management.jmxremote.ssl=false</jvm-arg> </server-default> ...</cluster></resin></example><example title="Start jconsole">win> jconsole.exeunix> jconsole</example><p><i>Enter the host name and port number (9999) on the "Remote" tab</i><i>Enter the username and password on the "Remote" tab</i></p></s1><s1 title="stat-service"><p>Resin 3.1.6 adds a new <stat-service> to the <management tag.The <stat-service periodically checks the status of Resin and the JVMand can act if certain thresholds are exceeded. The default check rateis every 60s.</p><p>The primary statistic that <stat-service> observes is the CPU loadof the server. You can set thresholds so Resin will log a thread dumpif the CPU gets high, e.g. to find and debug a runaway thread. If necessary,you can also have Resin restart if the CPU load gets too high.The configuration is documented in<a href="resin-tags.xtp#management"><management></a> in the resin-tagssection.</p><example title="Example: CPU thresholds"><resin xmlns="http://caucho.com/ns/resin"> <management> <stat-service> <cpu-load-exit-threshold>10.0</cpu-load-exit-threshold> <cpu-load-log-info-threshold>1.0</cpu-load-log-info-threshold> <cpu-load-log-warning-threshold>2.0</cpu-load-log-warning-threshold> <cpu-load-thread-dump-threshold>2.0</cpu-load-thread-dump-threshold> <sample-period>15s</sample-period> <thread-dump-interval>10m</thread-dump-interval> </stat-service> </management></resin></example></s1><s1 title="SNMP"><p>Since 3.1.5, Resin has built-in support for SNMP (Simple NetworkManagement Protocol). This allows Resin to be managed just like anynetwork device (e.g. routers) from an SNMP manager application.</p><s2 title="Enabling SNMP support in Resin"><p>To enable Resin's SNMP service, you'll need to add an SNMP protocol tagto your resin.xml under the <server> tag:<example title="resin.xml"><resin xmlns="http://caucho.com/ns/resin"> <cluster id=""> <server-default> <protocol class="com.caucho.server.snmp.SnmpProtocol" port="161"/> <server-default/> ... <cluster/><resin/></example>This opens up a port that listens for SNMP requests and responds tothem with an SNMP response. Currently, Resin can only respond toTCP SNMP get-pdu requests.</p><p>By default, the SNMP community string is "public". It can be changed with:<example><protocol class="com.caucho.server.snmp.SnmpProtocol" port="161"> <init community="<i>insert_password_here</i>"/><protocol/></example></p></s2><s2 title="MIB Variables"><p>Internally, Resin stores a mapping from SNMP MIB variables toMBean attributes. Requests for a specific MIB variable are simplyretrievals for the corresponding MBean attribute. The available MIBmappings are hard-coded in Resin and they are:</p><deftable title="SNMP to MBean mappings"><tr> <th>SNMP Object ID</th> <th>SNMP type</th> <th>MBean</th> <th>MBean attribute</th></tr><tr> <td>1.3.6.1.2.1.1.1</td> <td>Octet String</td> <td>resin:type=Resin</td> <td>Version</td></tr><tr> <td>1.3.6.1.2.1.1.3</td> <td>Time Ticks</td> <td>java.lang:type=Runtime</td> <td>UpTime</td></tr><tr> <td>1.3.6.1.2.1.1.5</td> <td>Octet String</td> <td>resin:type=Host,name=default</td> <td>URL</td></tr><tr> <td>1.3.6.1.4.1.30350.1.1</td> <td>Gauge</td> <td>resin:type=Server</td> <td>KeepaliveCountTotal</td></tr><tr> <td>1.3.6.1.4.1.30350.1.2</td> <td>Gauge</td> <td>resin:type=Server</td> <td>RequestCountTotal</td></tr><tr> <td>1.3.6.1.4.1.30350.1.3</td> <td>Gauge</td> <td>resin:type=Server</td> <td>RuntimeMemory</td></tr><tr> <td>1.3.6.1.4.1.30350.1.4</td> <td>Gauge</td> <td>resin:type=Server</td> <td>RuntimeMemoryFree</td></tr><tr> <td>1.3.6.1.4.1.30350.1.5</td> <td>Gauge</td> <td>resin:type=Server</td> <td>ThreadActiveCount</td></tr><tr> <td>1.3.6.1.4.1.30350.1.6</td> <td>Gauge</td> <td>resin:type=Server</td> <td>ThreadKeepaliveCount</td></tr><tr> <td>1.3.6.1.4.1.30350.2.1</td> <td>Gauge</td> <td>resin:type=ThreadPool</td> <td>ThreadActiveCount</td></tr><tr> <td>1.3.6.1.4.1.30350.2.2</td> <td>Gauge</td> <td>resin:type=ThreadPool</td> <td>ThreadCount</td></tr><tr> <td>1.3.6.1.4.1.30350.2.3</td> <td>Gauge</td> <td>resin:type=ThreadPool</td> <td>ThreadIdleCount</td></tr><tr> <td>1.3.6.1.4.1.30350.2.4</td> <td>Gauge</td> <td>resin:type=ThreadPool</td> <td>ThreadIdleMax</td></tr><tr> <td>1.3.6.1.4.1.30350.2.5</td> <td>Gauge</td> <td>resin:type=ThreadPool</td> <td>ThreadIdleMin</td></tr><tr> <td>1.3.6.1.4.1.30350.2.6</td> <td>Gauge</td> <td>resin:type=ThreadPool</td> <td>ThreadMax</td></tr><tr> <td>1.3.6.1.4.1.30350.3.1</td> <td>Gauge</td> <td>resin:type=ProxyCache</td> <td>HitCountTotal</td></tr><tr> <td>1.3.6.1.4.1.30350.3.2</td> <td>Gauge</td> <td>resin:type=ProxyCache</td> <td>MissCountTotal</td></tr></deftable></s2><s2 title="Defining your own SNMP to MBean mappings"><p>To define your own MIB variables, you'll need to extend the<var>com.caucho.server.snmp.SnmpProtocol</var> class and then use thatclass name in the <protocol> tag:<example title="resin.xml"><resin xmlns="http://caucho.com/ns/resin"> <cluster id=""> <server-default> <protocol class="example.MySnmpProtocol" port="161"/> <server-default/> ... <cluster/><resin/></example><example title="example.MySnmpProtocol">package example;import com.caucho.server.snmp.*;import com.caucho.server.snmp.types.*;public class MySnmpProtocol extends SnmpProtocol{ public MySnmpProtocol() { super(); addOid(new Oid("1.2.3.4.5", "<i>my_mbean_object_name</i>", "<i>my_mbean_attribute</i>", SnmpValue.OCTET_STRING)); }}</example><var>"1.2.3.4.5"</var> is the SNMP ID you choose to give to your mapping.It should be in dot notation. <var>SnmpValue.OCTET_STRING</var> is thetype Resin should return for that attribute. An abbreviated list ofthe available types are:</p><deftable><tr> <th>SNMP types</th> <th>Description</th></tr><tr> <td>SnmpValue.OCTET_STRING</td> <td>8-bit String</td></tr><tr> <td>SnmpValue.INTEGER</td> <td>signed 32-bit integer</td></tr><tr> <td>SnmpValue.COUNTER</td> <td>unsigned 32-bit integer that only increases, wraps around when overflows</td></tr><tr> <td>SnmpValue.GAUGE</td> <td>unsigned 32-bit integer that may increase and decrease</td></tr><tr> <td>SnmpValue.TIME_TICKS</td> <td>unsigned 32-bit integer representing time measured in hundredths of a second</td></tr><tr> <td>SnmpValue.IP_ADDRESS</td> <td>IP address</td></tr></deftable><p>For a more complete list, see <a href="http://caucho.com/resin-javadoc/com/caucho/server/snmp/package-summary.html">com.caucho.server.snmp JavaDoc</a>.</p></s2></s1> </body></document>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -