tomcat服务器监控工具之probe「建议收藏」

tomcat服务器监控工具之probe「建议收藏」前言:今天把公司的一台tomcat服务器进行了迁移,为了查看在使用过程中的详细信息,在网上搜索了很多关于web服务器的监控软件,最后拟定使用probe这个开源并且功能也很完善的一款工具接下来介绍一下使用方法与安装技巧一、简介psi-probe是lambdaprobe的一个分支版本,用于对Tomcat进行监控,比tomcat的manager强大很多。psi就是一个形如叉子的符

大家好,又见面了,我是你们的朋友全栈君。

前言:今天把公司的一台tomcat服务器进行了迁移,为了查看在使用过程中的详细信息,在网上搜索了很多关于web服务器的监控软件,最后拟定使用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攻击。详见下面的描述:

[xhtml] 
view plain
copy

  1. 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.   
  2.   
  3. manager-gui – allows access to the HTML GUI and the status pages   
  4. manager-script – allows access to the text interface and the status pages   
  5. manager-jmx – allows access to the JMX proxy and the status pages   
  6. manager-status – allows access to the status pages only   
  7. The HTML interface is protected against CSRF but the text and JMX interfaces are not. To maintain the CSRF protection:   
  8.   
  9. users with the manager-gui role should not be granted either the manager-script or manager-jmx roles.   
  10. 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的权限是最大的,什么都能操作(不推荐配置)。

六、测试

启动tomcat,访问http://127.0.0.1:8080/probe,输入前面配置的用户密码即可

点击相应的链接就可以看到各种实时监控信息了

probe1

probe2

probe3

probe4

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/139705.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • 【ZigBee协议栈简介】

    【ZigBee协议栈简介】1、Zigbee协议栈简介  协议是一系列的通信标准,通信双方需要按照这一标准进行正常的数据发射和接收。协议栈是协议的具体实现形式,通俗讲协议栈就是协议和用户之间的一个接口,开发人员通过使用协议栈来使用这个协议,进而实现无线数据收发。  如图1所示:Zigbee协议分为两部分,IEEE802.15.4定义了PHY(物理层)和MAC(介质访问层)技术规范;Zigbee联盟定义了NWK(网络…

    2022年5月28日
    52
  • Echarts数据可视化全解注释

    Echarts数据可视化全解注释学习了百度Echart官方教程,不得不说官方教程还是非常不错了。这里对Echart所有教程知识进行了总结。自己喜欢边学边总结边写demo,所以写了这篇文章,包含了大部分的Echarts编程知识。让你一个demo掌握Echarts所有编程,如果有问题可以留言。此demo除了必须的链接文件外,主要包括17个文件:index.html和index.js、coordinate-geo.js、coor

    2022年7月18日
    31
  • Sequelize多表联合查询案例

    Sequelize多表联合查询案例一、Table:现在有两个表,A和B,关联关系:MATCH表中的job_history_id与JOB_HISTORY表中的id相关联。二、需求:查询Match表中的user_id,report_comment,以及job_history_id所关联的JOB表中的job_link,在前端显示。三、Code:1.后端首先要建立两个表的关联:MatchScoreReportModel.belongsTo(JobHistoryModel,{foreignKey:’job_history

    2022年5月18日
    48
  • PHP实现大文件分割上传与分片上传

    PHP实现大文件分割上传与分片上传

    2021年11月4日
    57
  • Mac安装ElasticSearch介绍

    Mac安装ElasticSearch介绍原文地址:https://segmentfault.com/a/1190000005792528今日项目需要一个小型的搜索的功能的支持,有很多开源的搜索引擎啦,当然Elasticsearch个人认为上手容易,安装也比较方便。ES安装前需要确认你笔记本上已经安装了java,如果没有安装了,可以oracle官网下载就行了,java弄完后,我们可以在命令后工具中输

    2022年6月21日
    117
  • 【矩阵论】单射、满射与双射

    【矩阵论】单射、满射与双射映射;Mapping映射是两个集合中的一种特殊的对应关系,即如果按照某种对应法则,对于集合A中的任何一个元素,在集合B中都有惟一的元素与它对应,那么这样的对应(包括对应法则)叫做集合A到集合B的映射。其中,A中的元素称为原像,B中的元素称为A中元素的像(imageimage)。单射、满射与双射;Injection,surjectionandbijection单射:在英语中称为injection

    2022年5月2日
    135

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号