打開<Apache Installation>\conf\httpd.conf,進行如下修改:
1、 設置允許查看Apache運行狀態的主機:
LoadModule status_module modules/mod_status.so
ExtendedStatus On
<Location /server-status>
SetHandler server-status
Order allow,deny
Deny from nothing
Allow from all
</Location>
<Location /server-info>
SetHandler server-info
Order allow,deny
Deny from nothing
Allow from all
</Location>
這樣改變以後重新啓動Apache,在瀏覽器中輸入http://servername/server-status就可以看到Apache運行時的信息,
看到這樣的信息就表示修改成功,這樣就可以使用LoadRunner監視Apache了。
二、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並添加計數器,這樣監視就正常了。
Apache CPU Usage (Apache)這個指標還是沒有數據,因爲Windows上沒有這個指標
原文地址:http://igoole.iteye.com/blog/576700