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


相关推荐

  • mysql中字符串转数字「建议收藏」

    mysql中字符串转数字「建议收藏」mysql中字符串在进行计算或排序的时候转数字比如以字符串111为例,方法一:SELECTCAST(‘111’ASSIGNED);方法二:SELECTCONVERT(‘111’,SIGNED);或者SELECTCONVERT(‘111’,decimal(10,5));方法三:SELECT‘111’+0;…

    2022年5月30日
    43
  • pycharm突然打不开到底什么情况_pycharm运行没反应

    pycharm突然打不开到底什么情况_pycharm运行没反应当无法打开pycharm终端,出现以下情况1、打开pycharm设置2、打开一下界面3、在shell路径中选择windows下的cmd.exe,这样就可以将cmd命令路径连接到pycharm中,无法打开windows终端即可方便下载安装包4、重新启动pycharm…

    2022年8月26日
    5
  • 剑指offer答案_一年级聪明格题目

    剑指offer答案_一年级聪明格题目本文为《剑指Offer》刷题笔记的总结篇,花了两个多月的时间,将牛客网上《剑指Offer》的66道题刷了一遍,以博客的形式整理了一遍,这66道题属于相对基础的算法题目,对于刷题练手是很好的实践,接下来

    2022年8月4日
    3
  • ubuntu安装pycharm后找不到在哪_ubuntu安装类型

    ubuntu安装pycharm后找不到在哪_ubuntu安装类型1、下载PycharmLINUX版本2、复制到虚拟机,并解压在当前文件夹,右键安装包,点击“ExtractHere”3、打开终端,进入pycharm-2020.1.1/bin;4、执行pycharm.sh命令文件,开始安装;sh./pycharm.sh5.激活6.创建快捷方式6.1在/usr/share/applications创建一个文件:pycharm.desktop(touch,gedit,nano指令等)cd/usr/share/applicationssudoge

    2022年9月27日
    0
  • GET和POST两种基本请求方法的区别「建议收藏」

    GET和POST两种基本请求方法的区别「建议收藏」GET和POST是HTTP请求的两种基本方法,要说它们的区别,接触过WEB开发的人都能说出一二。最直观的区别就是GET把参数包含在URL中,POST通过request body传递参数。你可能自己写过无数个GET和POST请求,或者已经看过很多权威网站总结出的他们的区别,你非常清楚知道什么时候该用什么。当你在面试中被问到这个问题,你的内心充满了自信和喜悦。 你轻轻松松的给出…

    2022年6月13日
    37
  • php小区物业管理系统_代挂网源码最新版

    php小区物业管理系统_代挂网源码最新版萌驰物管家目前采用的是:域名授权(不限制IP,域名只授权一个,但您可以解析多个域名到同一站点,授权的域名必须保证可以访问到站点)萌驰物管家老客户首次更换授权域名是免费的,之后收费标准:800/次关于支付微信支付官方通道可以走服务商自己的,非法人结算对私结算可以走悟能科技对接好的(汇付天下,随行付,乐刷,等)。独立部署只有后台跟公众号及小程序APP需要单独购买2万一个端。悟能科技官网:www.wun…

    2022年10月18日
    3

发表回复

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

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