Ticket #223 (closed 需求: 已处理)

Opened 12 years ago

Last modified 12 years ago

bbs应用监控插件

Reported by: dingjianyong Owned by: liubixiao
Priority: 最高级(1) Milestone:
Component: 核心模块 Version:
Keywords: Cc:
Due Date: 31/12/2013

Description


Attachments

pcwebmonitor.xml Download (5.3 KB) - added by liubixiao 12 years ago.
组件配置

Change History

comment:1 Changed 12 years ago by liubixiao

各网论坛后台监控链接:域名+/51946e4ab7f9a703b08771fc88889c2d/detect
【获取监控加密链接方式】
MD5源密码字符串:pc_bbs_!@#$%
可访问各网后台:域名+/util/md5.jsp?code=pc_bbs_!@#$% 得到md5密码

【更换密码需要配置的注意事项】
如需更换密码串时,需同时更新web.xml中的两处;
以及pcwebmonitor.xml中的一处。

【源码位置】
主干上的src/main/monitorSrc下

【监控工作原理】
1)基于ASM实现类的静态增强,可以无缝的部署于J2EE系统,对系统的开销几乎可以忽略;
2)采用plugin插件式的功能管理,在plugin目录下存放各种功能性插件,plugin包含多个component,由component构建plugin的实际功能,plugin内部component之间内聚,实际运行时,以component为单位进行管理,plugin更像是一个集成包,这样对于plugin的划分粒度较粗,使用起来更为便利和傻瓜化;
3)采用betwixt——JavaBean和XML之间的转换技术,实现component参数的初始化,如需增加新组件及参数,可在改路劲下写对应的betwixt配置org.jwebap.cfg.model;
4)监控工具的组件以及参数的实例化方式:通过监听器的启动,调用StartUp类读取pcwebmonitor.xml配置并初始化所有组件,存放在内存中的RuntimeContext实例中;
5)在项目中注册的DetectFilter过滤所有用户请求,激活轨迹管理器TraceLiftcycleManager,并开始监听数据库操作以及MC使用情况,联动其他组件实现全方位的系统监控方式;
6)监控记录日志输出类MonitorLogger,将内存中满200条监控记录时将输出到文件上,每十五分钟切换到相应目录中【输出路径在pcwebmonitor.xml中配置】。

【论坛监控插件的配置】
首先配置项目的web.xml文件,值得注意的是JwebapListener监听器需要配置在其他监听之前,否则无法启动监控模块。

        <context-param>
		<param-name>jwebap-config</param-name>
		<param-value>/WEB-INF/pcwebmonitor.xml</param-value>
	</context-param>
	<listener>	
		<listener-class>org.jwebap.startup.JwebapListener</listener-class>	
	</listener>
	<filter>
		<filter-name>PageDetectFilter</filter-name>
		<filter-class>org.jwebap.plugin.tracer.http.DetectFilter</filter-class>
		<init-param>
			<param-name>excludeUrls</param-name>
			<param-value>/[MD5密码]/detect;/[MD5密码]/detect/*;*.js;*.jpg;*.htm;*.html;*.gif;*.png;*.css;*.swf;*.ico</param-value>
		</init-param>
	</filter>
	<filter-mapping>
		<filter-name>PageDetectFilter</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>
	<servlet>
		<servlet-name>detect</servlet-name>
		<servlet-class>org.jwebap.ui.controler.JwebapServlet</servlet-class>	
	</servlet>
	<servlet-mapping>
		<servlet-name>detect</servlet-name>
		<url-pattern>/[MD5密码]/detect/*</url-pattern>
	</servlet-mapping>

其次是配置pcwebmonitor.xml中的相应参数,如下:
1、MethodComponent组件配置项中的<name>detect-clazzs</name>,设置为需要监控的java类包路劲即可,其他参数可默认;
2、JdbcComponent组件配置项中的<name>driver-clazzs</name>,设置为项目中使用的数据源管理类,其他参数可默认;
3、设置monitor-path,path0、path15为日志输出路径,rootPath为监控后台配置的根路径,可默认。

【其他注意事项】

目前监控日志输出开关是默认关闭的,且开关参数存放在内存中,另外plugin的component在监控启动时加载,对于群集应用,bbsmonitor一个应用一个实例,暂未实现群集轨迹容器,因此在集群环境下打开日志输出开关时,需要使用ip来每台机器轮流打开,且如果重启resin后则需要重新手动开启。

Version 12, edited 12 years ago by liubixiao (previous) (next) (diff)

Changed 12 years ago by liubixiao

组件配置

comment:2 Changed 12 years ago by dingjianyong

  • Status changed from new to closed
  • Resolution set to 已处理
  • Summary changed from bbs应用监测插件 to bbs应用监控插件
Note: See TracTickets for help on using tickets.