王丹敬-(实战)em+plugin+for+mysql+监控

上传人:j7****6 文档编号:61853380 上传时间:2018-12-13 格式:PPT 页数:33 大小:1.69MB
返回 下载 相关 举报
王丹敬-(实战)em+plugin+for+mysql+监控_第1页
第1页 / 共33页
王丹敬-(实战)em+plugin+for+mysql+监控_第2页
第2页 / 共33页
王丹敬-(实战)em+plugin+for+mysql+监控_第3页
第3页 / 共33页
王丹敬-(实战)em+plugin+for+mysql+监控_第4页
第4页 / 共33页
王丹敬-(实战)em+plugin+for+mysql+监控_第5页
第5页 / 共33页
点击查看更多>>
资源描述

《王丹敬-(实战)em+plugin+for+mysql+监控》由会员分享,可在线阅读,更多相关《王丹敬-(实战)em+plugin+for+mysql+监控(33页珍藏版)》请在金锄头文库上搜索。

1、(实战)EM Plugin For MySQL 监控 搜狐DBA 王丹敬,主题大纲,为什么选择开发EM Plugin? EM Plugin能做些什么? EM Plugin的开发流程及代码示例 EM Plugin的优点 & 缺点,为什么选择开发 EM Plugin?,EM Plugin 能做些什么?,基于EM框架的功能 - Information Publishers Reports,基于EM框架的功能 Configuration Management,基于EM框架的功能 Configuration Management,基于EM框架的功能 Metric的使用 (History),基于EM框架的

2、功能 Metric的使用 (Compare),基于EM框架的功能 Metric的使用,基于EM框架的功能 邮件报警,EM Plugin 能做些什么?,Metric Policy Report & Chart Link ,EM Plugin的开发流程,定义Target Type & Metric & Properties,根据Oracle提供的DTD编写XML文件 Oracle Enterprise Manager Extensibility Guide $AGENT_HOME/sysman/admin/dtds/TargetMetadata.dtd $AGENT_HOME/sysman/adm

3、in/dtds/TargetCollection.dtd $AGENT_HOME/sysman/admin/metadata/*.xml $AGENT_HOME/sysman/admin/default_collection/*.xml metadata.xml 定义收集哪些metric, 定义metric的收集方法 定义metric是否在UI显示 collection.xml 定义metric的收集频率 报警阀值 , MySQL DB . . ,metadata.xml架构, Response Status Current Status of the Server Response time

4、(ms) emdRoot scriptsDir perlBin host port uname pass mysqlhome mydelimiter “%perlBin%/perl“ “%scriptsDir%/emx/%TYPE%/response.pl“ “%mysqlhome%“ “%mydelimiter%“ “%host%“ “%port%“ “%uname%“ “%pass%“ %mydelimiter% em_result= em_error= 120 ,metadata.xml架构 定义Metric示例, Show Status ,metadata.xml架构 定义Instan

5、ceProperties示例, ,collection.xml架构,收集Metric的方法,Fetchlets OS Command - 推荐使用Perl SQL SNMP URL Timing Dynamic Monitoring Service (DMS) HTTP Data URLXML WBEM JDBC OJMX/SOAP Receivelets SNMP Receivelets Advanced Queue Receivelets HTTP Receivelets,Chart展示,Report展示,Report展示, Response Timing 375 150 south tr

6、ue Response Time (ms) reportTab MySQL Health Status Reports . . ,定义Chart,BEGIN DECLARE -作为create_report_definition的p_late_binding_target_types参数值 l_target_types MGMT_IP_TARGET_TYPES; -定义报表的guid l_report_guid RAW(16); -定义元素的guid l_element_guid RAW(16); -create_report_definition和add_element_to_report_

7、def的p_parameters参数值 l_param_values MGMT_IP_PARAM_VALUE_LIST; - 序列变量 l_curr_order应该连续增长,从1到报表中的元素总数 BEGIN - INITIALIZE REPORT ORDER FOR PLUGIN INTERFACE l_report_order := 0; - 目标类型 l_target_type = target type - specify the target type associated with this report - 报表名称 l_report_title_nlsid := MySQL I

8、nnodb Deadlock Reports; -得到报表所有者 - 定义报表 - create a report definition for the report l_report_guid := mgmt_ip.create_report_definition ( -加入图 l_param_values := MGMT_IP_PARAM_VALUE_LIST(); commit; END; END;,定义Report,打包Plugin文件(MPA) Management Plug-in Archive,检查metadata.xml和collection.xml文件的正确性 emcli c

9、heck_mp -metadata_file=/export/home/oracle/mysql_plugin/satine_meta.xml -collection_file=/export/home/oracle/mysql_plugin/satine_coll.xml -err_level=info 打包文件 emcli add_mp_to_mpa -mpa=“/export/home/oracle/mysql_plugin/mpa/1.5.20090601/MYSQL_TEST_INTEGRATION.jar“ -mp_version=“1.5.20090601“ -ttd=“/exp

10、ort/home/oracle/mysql_plugin/satine_meta.xml“ -dc=“/export/home/oracle/mysql_plugin/satine_coll.xml“ -file=“HOMEPAGE_DEFINITION:/export/home/oracle/mysql_plugin/homepage_charts.xml“ -file=“REPORT_DEFINITION:/export/home/oracle/mysql_plugin/reports/SlowLog.sql“ -file=“REPORT_DEFINITION:/export/home/o

11、racle/mysql_plugin/reports/HealthStatusReports.sql“ -file=“MONITORING_SCRIPT:/export/home/oracle/mysql_plugin/scripts/response.pl“ -file=“MONITORING_SCRIPT:/export/home/oracle/mysql_plugin/scripts/MysqlIsAlive.pl“ -file=“ECM_DEPLOY:/export/home/oracle/mysql_plugin/ecm/mysql_ecm_deploy.sql“ -file=“EC

12、M_UNDEPLOY:/export/home/oracle/mysql_plugin/ecm/mysql_ecm_undeploy.sql“ -func_desc=“Just for testing“,导入MPA,Setup Management Plug-ins Import List Archive OK,发布Plugin到Agents,Deploy Add Agents Next Finish,添加Mysql对象到EM,找到用于监控的Agent Add选择对象类型 Go 输入正确信息 OK,Plugin性能测试,使用工具: EM Management Plug-in Developme

13、nt Kit (EM PDK) lint and performance tools 下载地址: http:/ 使用方法: mptool/bin/mpcli perf -help 举例: mpcli perf -out_dir=/export/home/oracle/metric_performance -time=600 -targets=“mysql_test“ ,Plugin性能测试 报告,报告规格: Metadata Statistics Target Runtime Statistics Agent Process Statistics Performance Charts System CPU Utilization System Physical Memory Utilization Memory Usage System Resource Usage,EM Plugin的优点,集中管理多种 databases 监控内容,监控方式灵活 开发语言DBA熟悉 (XML, SQL, PLSQL, Perl) 可应用EM自身强大功能 监控数据的二次利用,EM Plugin的缺点,需要部署agent,其体积庞大 对mysql管理经验要求高 Oracle官方对自开发Plugin提供支持少,完毕,谢谢!,

展开阅读全文
相关资源
正为您匹配相似的精品文档
相关搜索

最新文档


当前位置:首页 > 生活休闲 > 社会民生

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号