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)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • strm().filter().collect()和stream().map().collect()的作用

    strm().filter().collect()和stream().map().collect()的作用在看代码的时候看到了一下

    2025年6月19日
    3
  • java 字符 几个字节_java中字符串占几个字节「建议收藏」

    java 字符 几个字节_java中字符串占几个字节「建议收藏」首先,char为Java的基本类型,基本类型所占的字节数是固定的,如int占4字节,double占8字节,这可以使得Java在不同的平台上所占类型固定,很好地保证了Java的可移植性。因此,Java中char类型固定占2个字节。(注:char类型也可以存储一个汉字)。其次,String采用一种更灵活的方式进行存储。在String中,一个英文字符占1个字节,而中文字符根据编码的不同所占字节数也不同。…

    2022年6月26日
    59
  • Android 调用微信小程序支付badparam_微信定时发消息

    Android 调用微信小程序支付badparam_微信定时发消息最近一项目需要添加微信的分享:朋友、朋友圈。原本以为挺简单的一事,无非就是去官网下个Demo,集成到自己项目中,可以分分钟搞定,结果这帮写文档的坑爹玩意,愣是浪费了我N多时间,好了吐槽完毕,接下来分享下此次调用微信中遇到的问题和解决方法:首先第一个问题:死活调不出微信客户端原因:是没有按照所谓的官方说明来操作,解决方法:1)对要加微信的项目进行打包签名,此时就有了自己的

    2022年9月1日
    4
  • threadlocal底层实现_hashset底层实现原理

    threadlocal底层实现_hashset底层实现原理ThreadLocal作用:提供线程内的局部变量,不同的线程之间不会相互干扰,这种变量在线程的生命周期内起作用,减少同一个线程内多个函数或组件之间一些公共变量传递的复杂性。package com.mupack;public class App{ private String content; public void setContent(String content) { this.content = content; } public Stri

    2022年8月8日
    4
  • python hexdump_细说Linux中怎么用hexdump命令

    python hexdump_细说Linux中怎么用hexdump命令摘要:hexdump描述:hexdump命令一般用来查看”二进制”文件的十六进制编码,从手册上查看,其查看的内容还要很多,诸如:ascii,decimal,hexadecimal,octal参数:hexdump[-bcCdovx][-eformat_string][-fformat_file][-nlength][-sskip]file示例:新增一个文本文件,在test…

    2025年12月10日
    3
  • sublime3 激活码【中文破解版】

    (sublime3 激活码)最近有小伙伴私信我,问我这边有没有免费的intellijIdea的激活码,然后我将全栈君台教程分享给他了。激活成功之后他一直表示感谢,哈哈~https://javaforall.net/100143.htmlIntelliJ2021最新激活注册码,破解教程可免费永久激活,亲测有效,上面是详细链接哦~S32P…

    2022年3月25日
    48

发表回复

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

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