哪些Tomcat Mbean可用于访问Web应用程序信息

发布于 2024-10-10 01:11:08 字数 658 浏览 0 评论 0原文

我正在尝试编写一个客户端工具来监视 Tomcat 5.5 中运行的应用程序。我知道已经有很多可用的,但其中大多数是基于网络的,并且没有为自动化监控过程提供很多支持。

我现在写的工具非常简单。它是一个远程连接到 Tomcat 实例的客户端 java 进程。我已经成功连接到它,但现在我对如何使用 Tomcat 中已有的 MBean 感到困惑。

我的问题实际上是我要查询 Tomcat 中的哪些 Mbean 以找出以下信息

  • 在特定上下文下运行的特定应用程序是否正在运行
  • 一般环境的健康状况(tomcat、操作系统等)
  • JNDI 数据源是否可用以及是否可能有多少个活动数据库连接以及有多少个空闲连接。

是否有任何 MBean 提供此信息?如果是这样我该如何访问它?

查看 Tomcat 中可用的所有 mbean 的完整列表以及如何访问它们将非常有用。我看过这个列表 http://tomcat.apache。 org/tomcat-5.5-doc/catalina/funcspecs/mbean-names.html 但它很混乱。

谢谢

I am trying to write a client tool which monitors an application running in Tomcat 5.5. I know there are quite a few already available but the majority of them are web based and dont provide a lot of support for automating the monitoring process.

The tool i am writing now is very simple. Its a client java process that connects to the Tomcat instance remotely. I have managed to connect to it but now i am stuck as to how to use the MBeans that are already available in Tomcat.

My question really is which Mbeans within Tomcat do i query to find out the following information

  • Whether a specific application running under a specific context is running
  • The health of the environment in general (tomcat, OS etc)
  • Whether a JNDI datasource is available and if possible how many active database connections there are and how many free.

Are there any MBeans that provide this info? if so how do i access it?

it would be very usefull to see a full list of all mbeans available in Tomcat and how to access them. I have seen this list http://tomcat.apache.org/tomcat-5.5-doc/catalina/funcspecs/mbean-names.html but it is quite confusing.

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

┾廆蒐ゝ 2024-10-17 01:11:08

您可以使用 Java 的 jConsole 实用程序来查看远程 Tomcat 服务器中可用的 MBean。它将使用 jmx 端口连接到远程服务器。所有可用的 MBean 都列在 MBean 选项卡中。这可以帮助您找到所需的 MBean 以及 MBean 属性的确切名称。

谢谢。

You can use jConsole utility of Java to see the MBeans available in remote Tomcat server. It will connect to remote server with jmx port. All the MBeans available are listed in MBean tab. This can help you finding the MBeans you wants and exact name of the MBean attribute.

Thanks.

树深时见影 2024-10-17 01:11:08

您可以使用 check_jmx4perl 配置和预定义的 Tomcat 检查作为起点。它引用了相当多的 MBean 的名称,这些 MBean 可以在标准 Tomcat 安装中找到。

即,以下指标是预先定义的:

  • Nr。某个 Servlet 的 Servlet 请求数
  • 处理 Web 模块的 CPU 时间
  • 检查 Web 模块是否处于活动状态
  • 活动
  • 会话数活动会话数
  • 被拒绝的会话数
  • 会话的平均生命
  • 周期 最大。最长会话的生命周期 连接器
  • 的数据接收速率 连接器的
  • 数据发送速率 连接器的
  • 处理时间
  • 活动数据源连接数

您可以在此处找到此示例 tomcat.cfg 配置:https://github.com/rhuss/jmx4perl/blob/master/config/tomcat.cfg< /a>

You could use the check_jmx4perl configuration with pre-defined Tomcat checks as a starting point. It references the names of quite some MBeans which can be found on a standard Tomcat installation.

I.e. the following metrics are pre-defined:

  • Nr. of servlet requests for a certain servlet
  • Processing CPU time for a webmodule
  • Check whether a webmodule is active
  • Active sessions
  • Max. number of active sessions
  • Number of rejected sessions
  • Average lifetime of a session
  • Max. lifetime of the longest session
  • Data received rate for a connector
  • Data sent rate for a connector
  • Processing time for a connector
  • Number of active datasource connections

You can find this sample tomcat.cfg configuration here: https://github.com/rhuss/jmx4perl/blob/master/config/tomcat.cfg

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文