《最新实战EMPluginForMySQL监控PPT课件.ppt》由会员分享,可在线阅读,更多相关《最新实战EMPluginForMySQL监控PPT课件.ppt(34页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、实战实战EMPluginForMySQLEMPluginForMySQL监监控控主主题大大纲为什么什么选择开开发EM PluginEM Plugin?EM PluginEM Plugin能做些什么?能做些什么?EM PluginEM Plugin的开的开发流程及代流程及代码示例示例EM PluginEM Plugin的的优点点&缺点缺点基于基于EMEM框架的功能框架的功能 Metric Metric的使用的使用 (Compare)(Compare)基于基于EMEM框架的功能框架的功能 Metric Metric的使用的使用基于基于EMEM框架的功能框架的功能 邮件件报警警EM Plugin E
2、M Plugin 能做些什么?能做些什么?MetricPolicyReport&ChartLink EM PluginEM Plugin的开的开发流程流程定定义Target Type&Metric&PropertiesTarget Type&Metric&Properties根据根据OracleOracle提供的提供的DTDDTD编写写XMLXML文件文件Oracle Enterprise Manager Extensibility GuideOracle Enterprise Manager Extensibility Guide$AGENT_HOME/sysman/admin/dtds/T
3、argetMetadata.dtd$AGENT_HOME/sysman/admin/dtds/TargetMetadata.dtd$AGENT_HOME/sysman/admin/dtds/TargetCollection.dtd$AGENT_HOME/sysman/admin/dtds/TargetCollection.dtd$AGENT_HOME/sysman/admin/metadata/*.xml$AGENT_HOME/sysman/admin/metadata/*.xml$AGENT_HOME/sysman/admin/default_collection/*.xml$AGENT_H
4、OME/sysman/admin/default_collection/*.xmlmetadata.xml metadata.xml 定定义收集哪些收集哪些metricmetric,定定义metricmetric的收集方法的收集方法定定义metricmetric是否在是否在UIUI显示示 collection.xmlcollection.xml定定义metricmetric的收集的收集频率率报警警阀值 MySQL DB .metadata.xmlmetadata.xml架构架构 Response Status Current Status of the Server Response time
5、(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.xmlmetadata.xml架构架构 定定义MetricMetric示例示例 Show Status metadata.xmlmetadata.xml架构架构 定定义Instan
6、cePropertiesInstanceProperties示例示例 collection.xmlcollection.xml架构架构收集收集MetricMetric的方法的方法FetchletsFetchletsOS Command-OS Command-推荐使用推荐使用PerlPerlSQLSQLSNMPSNMPURL TimingURL TimingDynamic Monitoring Service(DMS)Dynamic Monitoring Service(DMS)HTTP DataHTTP DataURLXMLURLXMLWBEMWBEMJDBCJDBCOJMX/SOAPOJMX
7、/SOAPReceiveletsReceiveletsSNMP ReceiveletsSNMP ReceiveletsAdvanced Queue ReceiveletsAdvanced Queue ReceiveletsHTTP ReceiveletsHTTP ReceiveletsChartChart展示展示ReportReport展示展示ReportReport展示展示 ResponseResponse Timing 375 150 south true Response Time(ms)reportTab MySQL Health Status Reports .定定义ChartCha
8、rtBEGINDECLARE -作为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_def的p_parameters参数值 l_param_values MGMT_IP_PARAM_VALUE_LIST;-序列变量 l_curr_or
9、der应该连续增长,从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 Innodb Deadlock Reports;-得到报表所有者 -定义报表 -create a report definition for the report l_repor
10、t_guid:=mgmt_ip.create_report_definition(-加入图 l_param_values:=MGMT_IP_PARAM_VALUE_LIST();commit;END;END;定定义ReportReport打包打包PluginPlugin文件文件(MPA)(MPA)Management Plug-in Archive Management Plug-in Archive检查metadata.xmlmetadata.xml和和collection.xmlcollection.xml文件的正确性文件的正确性emcli check_mp-metadata_file=/
11、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=/export/home/oracle/mysql_plugin/s
12、atine_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/oracle/mysql_plugin/reports/HealthStatusRep
13、orts.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=ECM_UNDEPLOY:/export/home/oracle/mysql_plugin/ecm/mys
14、ql_ecm_undeploy.sql -func_desc=Just for testing导入入MPAMPA1.Setup2.Management Plug-ins3.Import4.List Archive5.OK发布布PluginPlugin到到AgentsAgents1.Deploy2.Add Agents3.Next4.Finish添加添加MysqlMysql对象到象到EMEM1.找到用于监控的Agent2.Add选择对象类型3.Go4.输入正确信息5.OKPluginPlugin性能性能测试使用工具使用工具:EM Management Plug-in Development Ki
15、t(EM PDK)lint and performance tools下下载地址地址:http:/ perf-help 举例:mpcli perf -out_dir=/export/home/oracle/metric_performance -time=600 -targets=mysql_test PluginPlugin性能性能测试 报告告报告告规格:格:Metadata Statistics Target Runtime Statistics Agent Process Statistics Performance Charts 1.System CPU Utilization2.Sy
16、stem Physical Memory Utilization3.Memory Usage4.System Resource UsageEMEM PluginPlugin的的优点点 1.1.集中管理多种集中管理多种 databasesdatabases2.2.监控内容,控内容,监控方式灵活控方式灵活3.3.开开发语言言DBADBA熟悉熟悉 (XML,SQL,PLSQL,Perl)(XML,SQL,PLSQL,Perl)4.4.可可应用用EMEM自身自身强大功能大功能5.5.监控数据的二次利用控数据的二次利用EMEM PluginPlugin的缺点的缺点 1.需要部署需要部署agent,其体积庞大,其体积庞大2.对对mysql管理经验要求高管理经验要求高3.Oracle官方对自开发官方对自开发Plugin提供支持少提供支持少完完毕,谢谢!结束语结束语谢谢大家聆听!谢谢大家聆听!34