日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

tomcat服务器监控工具之probe

發布時間:2024/1/1 编程问答 42 豆豆
生活随笔 收集整理的這篇文章主要介紹了 tomcat服务器监控工具之probe 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

前言:今天把公司的一臺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 plaincopy
  • 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的權限是最大的,什么都能操作(不推薦配置)。

    六、測試

    啟動tomcat,訪問http://127.0.0.1:8080/probe,輸入前面配置的用戶密碼即可

    點擊相應的鏈接就可以看到各種實時監控信息了


    總結

    以上是生活随笔為你收集整理的tomcat服务器监控工具之probe的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。