标题: LR监控apache [打印本页] 作者: zhuyuancan 时间: 2008-3-11 16:10 标题: LR监控apache 按照论坛中信息修改相关设置:
打开<Apache Installation>\conf\httpd.conf,进行如下修改:
1、 设置允许查看Apache运行状态的主机
#
# Allow server status reports, with the URL of http://servername/server-status
# Change the ".your-domain.com" to match your domain to enable.
#
#取消一下代码前面的注释符号“#”,并且设置Order(顺序)为允许优先
<Location /server-status>
SetHandler server-status
Order allow,deny
Deny from nothing
Allow from all
</Location>
这样改变以后重新启动Apache在浏览器中输入http://servername/server-status就可以看到Apache运行时的信息!!!
[ 本帖最后由 zhuyuancan 于 2008-3-11 16:13 编辑 ]作者: 54111 时间: 2008-3-11 16:19
二、LoadRunner上的设置
经过以上第一项设置以后就可以使用LoadRunner监控Apache的运行情况了,在LoadRunner可用的监视器中双击Web Server Resource Graphs下的Apache节点,然后在右边对应的窗口中添加Apache所在主机的IP地址,并且加入计数器后单击OK,这样就可以在 LoadRunner中实时显示Apache的运行状态信息了。
注意:您可能收到如下消息【Monitor name :Apache. Parsing error, cannot find token: BusyServers. Measurement: BusyServers|192.168.0.186. Hints: 1) Such a measurement does not exist, or the html page may be different from the supported one. 2) Try to replace the Apache.cfg with appropriate Apache_<version>.cfg file in <Installation>\dat\monitors and rerun the application (entry point: CApacheMeasurement::NewData). [MsgId: MMSG-47479]】,这是由于要监视Apache的版本提供的计数器与LoadRunner默认的计数器不一致导致的。此时建议先关闭 Controller,打开<Installation>\dat\monitors下的apache.cfg文件(其它文件名类似 Apache_<version>.cfg的是Apache监视配置的备份,只有apache.cfg是生效的):
1、 修改Counter0=IdleServers为Counter0=IdleWorkers,同时修改注释信息Label0=#Idle Servers (Apache)为Label0=#Idle Workers (Apache),描述信息也建议修改;
2、 修改Counter4=BusyServers为Counter4=BusyWorkers,同时修改注释信息Label4=#Busy Servers (Apache)为Label4=#Busy Workers (Apache) ,描述信息也建议修改。
然后保存并关闭该文件,重新打开Controller并添加计数器,这样监视就正常了。作者: zhuyuancan 时间: 2008-3-11 16:31
谢谢54111的回答,,我先前在LR上也按照上面的设置设置完了!!!但是
lr还是提示
Monitor name :Apache. Parsing error, cannot find token: BusyServers. Measurement: BusyServers|192.168.0.186. Hints: 1) Such a measurement does not exist, or the html page may be different from the supported one. 2) Try to replace the Apache.cfg with appropriate Apache_<version>.cfg file in <Installation>\dat\monitors and rerun the application (entry point: CApacheMeasurement::NewData). [MsgId: MMSG-47479作者: zhuyuancan 时间: 2008-3-11 16:38
主要是:“重新启动Apache在浏览器中输入http://servername/server-status就可以看到Apache运行时的信息!!!”这句话的内容都没有实现,,是不是Apache某些配置的原因!!!作者: 54111 时间: 2008-3-11 16:46 标题: apache.cfg上面需要的东西,我复制一份给你希望有用 [Apache]
Counters=5
Counter0=IdleWorkers
Label0=Idle Workers (Apache)
Description0=Number of servers in the Idle state.
[ProxySettings]
; By default, if this flag set to 1 monitor will try to obtain proxy information from
; setting of IE
useProxy=1
proxyUsername=
proxyPassword=
proxyDomain=
; Format: [<protocol>=][<scheme>://]<proxy>[:<port>][ [<protocol>=][<scheme>://]<proxy>[:<port>]]
; E.g., httpProxy=http=http://my_http_proxy:8080 https=https://my_https_proxy:9000
httpProxy=作者: zhuyuancan 时间: 2008-3-11 17:41
偶的好象是2.0.0.59,记不得了,反正是2.x的
[Apache]
Counters=5
Counter0=IdleWorkers
Label0=#Idle Workers (Apache)
Description0=Number of server children in the Idle state.
[ProxySettings]
; By default, if this flag set to 1 monitor will try to obtain proxy information from
; setting of IE
useProxy=1
proxyUsername=
proxyPassword=
proxyDomain=