lr监控mysql_LoadRunner中监控MySQL方法介绍

在LoadRunner中没有提供直接监控MySQL的方法,但是在实际工作中需要我们对mysql数据库服务器进行监控,我们可以利用sitescope监控然后在lr中显示SiteScope监控的结果,达到间接监控mysql的目的。

备注:Mercyry SiteScope 介绍:它是一款无代理监测解决方案,可确保分布式IT基础架构——如服务器、操作系统、网络设备、网络服务、应用和应用组件的可用性和性能。这款主动的、基于Web界面的基础架构监测解决方案是非常简洁的,而且完全根据客户度身定制,无需在您的上线系统中增加额外的代理。

SiteScope为上线系统提供24×7的监控服务,为维护工程师及时发现问题提供帮助,确保系统架构内一切组建的正常运作。SiteScope在大量增加检测周期的同时也降低了维护人员的工作成本 。

SiteScope能够监控UNIX服务器资源、windows服务器资源、weblogic应用服务器、IIS应用服务器、Oracle数据库、SQLServer数据库、F5、URL地址、Ping、内存、CPU、磁盘空间、服务等等系统架构内各种组建的运行状况;监控器按照指定频率对目标进行检测,一旦发现异常会及时向管理员发送意外事件的报警,警报可以通过声音提醒、email、短信等方式发送;另外,SiteScope还可以生成监测活动的汇总报告,该对象从日志文件中读取历史信息,接着总结、筛选信息,并生成图表格式的报告。

SiteScope利用Database Query monitor监控指定的数据库,通过SiteScope监控器的SHOW STATUS 命令,获得相应数据,命令如下:

show status where variable_name like ’innodb_buffer_pool_pages_total’

为了确保监控请确认LoadRunner and SiteScope之间的端口, SiteScope和MySQL必须打开TCP 8888 和TCP 3306 . 还有SiteScope要监控必须要确保有JDBC的安装。

以下为监控前需要注意的地方:

1. SiteScope to be deployed.

2. Sufficient license points for Database Query monitor.

3. TCP 8888 (default) opened two-way for LoadRunner to SiteScope.

4. TCP 3306 (default) opened two-way for SiteScope to MySQL.

5. Monitoring privileges for SiteScope to monitor MySQL.

6. JDBC driver to be installed on SiteScope.

7. Have knowledge of the counter you want to monitor.

转自SiteScope帮助:

Monitoring mySQL Databases

Monitoring a MySQL database requires the use of a JDBC driver. To enable SiteScope to monitor a MySQL database:

Download the JDBC driver from http://www.mysql.com/downloads/api-jdbc.html

Uncompress the distribution file

Among all the other files, you should find a file with a .jar extension.

Copy the .jar file into the /SiteScope/java/lib/ext directory

Stop and restart SiteScope

Now, use your browser to add a Database Query Monitor within SiteScope.

The Database Connection URL format for the MySQL JDBC driver is:

jdbc:mysql://[:]/

For example to connect to the MySQL database "aBigDatabase" on a machine using the standard MySQL port number 3306 you would use:

jdbc:mysql://206.168.191.19/aBigDatabase

If you are using a different port to connect to the database then you should include that port number as part of the IP address.

The specification for the MySQL JDBC driver is: org.gjt.mm.mysql.Driver

Enter this string into the Database Driver text box under the Advanced Options section of the Add Database Query Monitor form.

服务器端的准备工作:

1、登陆服务器,验证snmp服务能不能监控到mysql和http进程信息:

snmpwalk -Os -c public -v 1 172.16.100.28|grep mysql

snmpwalk -Os -c public -v 1 172.16.100.28|grep http

有数据即可。

如果没有数据,那么需要手工配置下文件。进入步骤 2

2、[root@cherry root]# cd /etc/snmp/

[root@cherry snmp]# vi snmpd.conf

扩大监控范围: 将 view   systemview    included   ****    后面的数据改成更大的范围

3、运行下面命令

[root@cherry snmp]# /etc/init.d/portmap start

[root@cherry snmp]# /etc/init.d/snmpd start

4、再次验证

验证snmp服务能不能监控到mysql和http进程信息:

snmpwalk -Os -c public -v 1 172.16.100.28|grep mysql

snmpwalk -Os -c public -v 1 172.16.100.28|grep http

LunnerRunner中添加监控参数

1、控制场景-RUN-添加SNMP到监控窗口

2、在SNMP到监控窗口点击右键,添加服务器和 mysql、appache的 PID

添加PID的路径:mgmt--mib-2--host—hrswrunperf--runperftable-- hrswrunperfEnter -- hrswrunperfcpu(如果是要监控内存那么应该是***Mem)查找需要的PID

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值