PSI Probe 安装手记

一、简介

 

psi-probe是lambdaprobe的一个分支版本,用于对Tomcat进行监控,比tomcat的manager强大很多。

 

psi就是一个形如叉子的符号Ψ,希腊字母的第23个字母,用来代表fork。

 

为啥需要分支呢,因为lambdaprobe已经多年没有更新(大致在2006年就停止发布新版本了)。

 

二、下载地址

 

http://code.google.com/p/psi-probe/downloads/list

 

三、安装

 

1.解压,将probe.war放进webapps目录。

 

2.修改CATALINA_HOME/conf/tomcat-users.xml

 

(权限配置参考如下,由于首先保证可运行,权限没有特别细分,仅供参考)

 

<tomcat-users>
<!--
  NOTE:  By default, no user is included in the "manager-gui" role required
  to operate the "/manager/html" web application.  If you wish to use this app,
  you must define such a user - the username and password are arbitrary.
-->
<!--
  NOTE:  The sample user and role entries below are wrapped in a comment
  and thus are ignored when reading this file. Do not forget to remove
  <!.. ..> that surrounds them.
-->
  <role rolename="tomcat"/>
  <role rolename="role1"/>
  <role rolename="manager-gui"/>
  <role rolename="manager-script"/>
  <role rolename="manager-jmx"/>
  <role rolename="manager-status"/>
  <role rolename="poweruser"/>
  <role rolename="probeuser"/>
  <user username="tomcat" password="tomcat" roles="tomcat"/>
  <user username="both" password="tomcat" roles="tomcat,role1"/>
  <user username="role1" password="tomcat" roles="role1"/>

 

  <user username="sss" password="sss" roles="manager-gui"/>
  <user username="fbysss" password="sss" roles="manager-script,manager-jmx,manager-status,poweruser,probeuser"/>
</tomcat-users>

 

四、注意事项

 

1.不要忘记文件中的<!---->,默认是注释的,需要去掉

 

2.tomcat6.0.30以上,角色manager一分为四,manager仍保留但不建议使用,因为那样容易遭到CSRF攻击。详见下面的描述:

 

Note that for Tomcat 6.0.30 onwards, the roles required to use the manager application were changed from the single manager role to add the following four roles. (The manager role is still available but should not be used as it avoids the CSRF protection). You will need to assign the role(s) required for the functionality you wish to access. manager-gui - allows access to the HTML GUI and the status pages manager-script - allows access to the text interface and the status pages manager-jmx - allows access to the JMX proxy and the status pages manager-status - allows access to the status pages only The HTML interface is protected against CSRF but the text and JMX interfaces are not. To maintain the CSRF protection: users with the manager-gui role should not be granted either the manager-script or manager-jmx roles. if the text or jmx interfaces are accessed through a browser (e.g. for testing since these interfaces are intended for tools not humans) then the browser must be closed afterwards to terminate the session.

 

如果配置不对,就会出现403的错误,连tomcat的manager都进不了,更不用说probe了。

 

3.lambdaprobe是不支持tomcat6.0.30的。所以最好使用psi-probe。

 

4.在配置tomcat-users.xml时,还需要加入poweruser等角色,才可以正常使用,不然也是403Forbidden。

 

5.如果要查看System Information,需要在catalina.sh中加入如下语句:

 

JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote"

 

windows版本:catalina.bat中加入SET JAVA_OPTS=%JAVA_OPTS% -Dcom.sun.management.jmxremote

 

五、权限控制

 

probe有 probeuser、poweruser、poweruserplus、manager(针对不同tomcat版本)等角色,对应可操作的功能如下表:

 

特别注意一点:表格里面的X表示拥有权限,也就是说,manager的权限是最大的,什么都能操作(不推荐配置)。

 

Features by Role

 

 

 probeuserpoweruserpoweruserplusmanager
Context: listXXXX
Context: statusXXXX
Context: view servletsXXXX
Context: view servlet mappingsXXXX
Context: view filtersXXXX
Context: view filter mappingsXXXX
Context: list attributesXXXX
Context: remove attributes XXX
Context: start XXX
Context: stop XXX
Context: view web.xml XXX
Context: view context.xml   X
Context: deploy   X
Context: undeploy   X
Session: listXXXX
Session: list attributesXXXX
Session: search attributesXXXX
Session: remove attributes XXX
Session: view last-accessed IPXXXX
Session: expire single XXX
Session: expire multiple XXX
JSP: list XXX
JSP: view source XXX
JSP: view servlet source XXX
JSP: compile single XXX
JSP: compile multiple XXX
JSP: compile all on deployment   X
JSP: discard all compiled   X
Data Source: listXXXX
Data Source: group by JDBC URLXXXX
Data Source: statusXXXX
Data Source: reset XXX
Data Source: test  XX
Data Source: view query history  XX
Data Source: execute SQL  XX
Log: listXXXX
Log: tail in real-timeXXXX
Log: downloadXXXX
Thread: listXXXX
Thread: view execution stack XXX
Thread: kill   X
Connector: statusXXXX
Connector: real-time usage chartsXXXX
Cluster: statusXXXX
Cluster: real-time traffic chartsXXXX
JVM: real-time memory usage chartsXXXX
JVM: statusXXXX
JVM: advise GC   X
Java Service Wrapper: statusXXXX
Java Service Wrapper: restart JVM   X
System: overviewXXXX
System: propertiesXXXX
System: OS details   X
Quick Check: execute   X

 

六、效果图

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值