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


相关推荐

  • CentOS7 安装 kafka「建议收藏」

    CentOS7 安装 kafka「建议收藏」文章目录一、安装JDK二、安装zookeeper三、安装kafka一、安装JDKrpm-qa|grepjavarpm-qa|grepjdkrpm-qa|grepgcjrpm-qa|grepjava|xargsrpm-e–nodeps #卸载老版本yumlistjava-1.8*yuminstalljava-1.8.0-openjdk*-yjava-version二、安装zookeeper官方地址:https://ar

    2022年6月6日
  • 史上MySQL安装配置教程最细,一步一图解

    史上MySQL安装配置教程最细,一步一图解一、下载MySQLMysql官网下载地址:https://downloads.mysql.com/archives/installer/1.选择要安装的版本,本篇文章选择的是5.7.31版本,点击Download下载二、安装MySQL1.选择设置类型双击运行mysql-installer-community-5.7.31.0.msi这里选择是自定义安装,所以直接选择“Custom”,点击“Next”“DeveloperDefault”是开发者默认 “Server

    2022年5月28日
  • goland软件官方软件激活破解方法

    goland软件官方软件激活破解方法,https://javaforall.net/100143.html。详细ieda激活码不妨到全栈程序员必看教程网一起来了解一下吧!

    2022年3月15日
  • 纠结应该先学Python还是Java?看完就有数了

    纠结应该先学Python还是Java?看完就有数了准备学习编程前,你一定会打开电脑搜索一下“先学Python还是先学Java?”扑面而来的是海量回答。如果你问一名Java程序员,肯定会建议你先学Java,因为他们认为Python像个乳臭未干的黄毛小子。但如果你问Python程序员,可能会得到一个完全相反的答案,他们认为Java是刻板啰嗦的老大爷,而人生苦短,我用Python。但别担心,今天我们将会从语言特色学习曲线职业方向市场需求…

    2022年7月8日
  • 所阅读的ASP.NET 2.0文章

    所阅读的ASP.NET 2.0文章

    2021年7月22日
  • webpack(5)webpack处理css文件[通俗易懂]

    webpack(5)webpack处理css文件[通俗易懂]css文件处理-准备工作(以下项目配置都是基于上一篇webpack(4)的基础上)在项目开发中,我们必然需要添加很多的样式,而样式我们往往写到一个单独的文件中。这里我们就在src目录中创建一个n

    2022年7月29日

发表回复

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

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