安装--->Tomcat监控工具Probe
1.Porbe介绍
psi-probe用于对Tomcat进行监控,比tomcat的manager强大很多。
2.下载
probe-2.3.3.zip 或者 probe.war
3.将下载好的war包,或者zip文件,放在tomcat的webapp目录下
4.配置tomcat-users.xml文件
<tomcat-users></tomcat-users>标签内添加,具体的权限配置,查看下面表格
<role rolename="manager"/> <role rolename="poweruser"/> <role rolename="tomcat"/> <role rolename="poweruserplus"/> <role rolename="probeuser"/> <user username="tomcat"password="tomcat"roles="manager,poweruser,probeuser,poweruserplus" />
注:tomcat-users.xm包含了所有Tomcat服务器的注册用户,其中有role(角色)、user(用户)两种信息
(1)role
Tomcat中保存了一些用户权限,也就是角色,比如admin、Tomcat等。用户还可以自定义,通过""来注册一个角色。它只有rolename一个属性,通过这个属性可以把用户的权限进行分配。
(2)User
这个数据项中包含了诸如用户名、用户密码、用户权限、用户说明等数据属性。
probe有 probeuser、poweruser、poweruserplus、manager(针对不同tomcat版本)等角色,对应可操作的功能如下表:
特别注意一点:表格里面的X表示拥有权限,也就是说,manager的权限是最大的,什么都能操作(不推荐配置)。
Features by Role
probeuser | poweruser | poweruserplus | manager | |
Context: list | X | X | X | X |
Context: status | X | X | X | X |
Context: view servlets | X | X | X | X |
Context: view servlet mappings | X | X | X | X |
Context: view filters | X | X | X | X |
Context: view filter mappings | X | X | X | X |
Context: list attributes | X | X | X | X |
Context: remove attributes | X | X | X | |
Context: start | X | X | X | |
Context: stop | X | X | X | |
Context: view web.xml | X | X | X | |
Context: view context.xml | X | |||
Context: deploy | X | |||
Context: undeploy | X | |||
Session: list | X | X | X | X |
Session: list attributes | X | X | X | X |
Session: search attributes | X | X | X | X |
Session: remove attributes | X | X | X | |
Session: view last-accessed IP | X | X | X | X |
Session: expire single | X | X | X | |
Session: expire multiple | X | X | X | |
JSP: list | X | X | X | |
JSP: view source | X | X | X | |
JSP: view servlet source | X | X | X | |
JSP: compile single | X | X | X | |
JSP: compile multiple | X | X | X | |
JSP: compile all on deployment | X | |||
JSP: discard all compiled | X | |||
Data Source: list | X | X | X | X |
Data Source: group by JDBC URL | X | X | X | X |
Data Source: status | X | X | X | X |
Data Source: reset | X | X | X | |
Data Source: test | X | X | ||
Data Source: view query history | X | X | ||
Data Source: execute SQL | X | X | ||
Log: list | X | X | X | X |
Log: tail in real-time | X | X | X | X |
Log: download | X | X | X | X |
Thread: list | X | X | X | X |
Thread: view execution stack | X | X | X | |
Thread: kill | X | |||
Connector: status | X | X | X | X |
Connector: real-time usage charts | X | X | X | X |
Cluster: status | X | X | X | X |
Cluster: real-time traffic charts | X | X | X | X |
JVM: real-time memory usage charts | X | X | X | X |
JVM: status | X | X | X | X |
JVM: advise GC | X | |||
Java Service Wrapper: status | X | X | X | X |
Java Service Wrapper: restart JVM | X | |||
System: overview | X | X | X | X |
System: properties | X | X | X | X |
System: OS details | X | |||
Quick Check: execute | X |
5.设置环境变量
修改conf/catalina.bat(for win)
set JAVA_OPTS=-Dcom.sun.management.jmxremote
或修改conf/catalina.sh(for linux)
export JAVA_OPTS=$JAVA_OPTS" -Dcom.sun.management.jmxremote"
或设置环境变量。
6.启动tomcat,访问http://localhost:8080/probe/
7.probe使用介绍
Applecations:tomcat上面正在跑的应用,可以看到每个应用的状态、请求数、session数等,点进去可以查看详细信息
Data Sources:tomcat的数据源,我这里没有配置数据源
Deployment:代码部署,选择一个war并部署。我这边没用这个东西来部署过代码,用脚本来实现
Logs:tomcat日志
Threads:tomcat线程,可以查看线程的状态等信息,还可以杀死线程
Cluster:tomcat集群
System Information:系统信息
Connectors:connector信息,可以看到每秒的请求数、响应时间等
Quick check:快速检测tomcat的数据源、内存等
参考:http://blog.csdn.net/fbysss/article/details/6221917,http://blog.csdn.net/chengguoyong/article/details/39048015
posted on 2017-09-02 14:23 Xiaox-xin 阅读(3381) 评论(1) 编辑 收藏 举报