51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 2400|回复: 1
打印 上一主题 下一主题

[原创] LR 8.1对IBM HTTP SERVER服务的监控环境

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2010-7-23 08:42:05 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
(1)配置HTTP.CONF文件
在IBM HTTP SERVER(IHS)安装目录下的/conf目录下找到http.conf文件,备份该文件。然后打开之后找到以下部分:
#LoadModule status_module modules/mod_status.so
<IfModule mod_status.c>
ExtendedStatus On
</IfModule>
去掉“#”号,打开该开关。以通过LR来监控IHS。

同时,新加入以下部分,以通过浏览器以图形界面方式查看IHS的服务状态。
LoadModule status_module modules/mod_status.so
<Location /server-status>
SetHandler server-status
</Location>



(2)测试对HTTP.CONF文件的配置效果
然后重新启动IHS,在浏览器中,可以使用“http://192.168.0.66/server-status?refresh=auto”访问,以查看IHS服务的汇总信息。或使用“http://192.168.0.66/server-status?refresh=10”访问(每10秒钟刷新一次),以查看IHS服务的详细信息。以下分别是两种访问方式得到的样例:

http://192.168.0.66/server-status?refresh=auto

Total Accesses: 224
Total kBytes: 489
CPULoad: .291667
Uptime: 216
ReqPerSec: 1.03704
BytesPerSec: 2318.22
BytesPerReq: 2235.43
BusyWorkers: 1
IdleWorkers: 49
Scoreboard: ____________________________________W_____________..............................................................................................................................................................................................


http://192.168.0.66/server-status?refresh=10

Apache Server Status for 192.168.0.66
Server Version: IBM_HTTP_Server
Server Built: Dec 4 2008 20:35:45

--------------------------------------------------------------------------------

Current Time: Thursday, 22-Jul-2010 13:55:59 CST
Restart Time: Thursday, 22-Jul-2010 13:52:04 CST
Parent Server Generation: 0
Server uptime: 3 minutes 55 seconds
Total accesses: 256 - Total Traffic: 507 kB
CPU Usage: u.6 s.15 cu0 cs0 - .319% CPU load
1.09 requests/sec - 2209 B/second - 2028 B/request
1 requests currently being processed, 49 idle workers
___________________________W______________________..............
................................................................
................................................................
................................................................

Scoreboard Key:
"_" Waiting for Connection, "S" Starting up, "R" Reading Request,
"W" Sending Reply, "K" Keepalive (read), "D" DNS Lookup,
"C" Closing connection, "L" Logging, "G" Gracefully finishing,
"I" Idle cleanup of worker, "." Open slot with no current process

Srv PID Acc M CPU  SS Req Conn Child Slot Client VHost Request
1-0 4942 0/6/6 _  0.41 4 0 0.0 0.01 0.01  192.168.0.95 testserver3 GET /server-status?refresh=auto HTTP/1.1
1-0 4942 0/5/5 W  0.33 0 0 0.0 0.00 0.00  192.168.0.95 testserver3 GET /server-status?refresh=10 HTTP/1.1
1-0 4942 0/5/5 _  0.33 55 0 0.0 0.00 0.00  192.168.0.95 testserver3 GET /server-status?refresh=auto HTTP/1.1
1-0 4942 0/5/5 _  0.33 49 1 0.0 0.02 0.02  192.168.0.95 testserver3 GET /server-status?refresh=auto HTTP/1.1
1-0 4942 0/5/5 _  0.33 46 0 0.0 0.02 0.02  192.168.0.95 testserver3 GET /server-status?refresh=auto HTTP/1.1
1-0 4942 0/5/5 _  0.33 40 0 0.0 0.00 0.00  192.168.0.95 testserver3 GET /server-status?refresh=auto HTTP/1.1
1-0 4942 0/5/5 _  0.33 37 0 0.0 0.00 0.00  192.168.0.95 testserver3 GET /server-status?refresh=auto HTTP/1.1
1-0 4942 0/5/5 _  0.34 31 0 0.0 0.02 0.02  192.168.0.95 testserver3 GET /server-status?refresh=auto HTTP/1.1
1-0 4942 0/5/5 _  0.34 28 0 0.0 0.02 0.02  192.168.0.95 testserver3 GET /server-status?refresh=auto HTTP/1.1
1-0 4942 0/5/5 _  0.34 22 0 0.0 0.02 0.02  192.168.0.95 testserver3 GET /server-status?refresh=auto HTTP/1.1
1-0 4942 0/5/5 _  0.35 19 1 0.0 0.02 0.02  192.168.0.95 testserver3 GET /server-status?refresh=auto HTTP/1.1
1-0 4942 0/5/5 _  0.36 9 96 0.0 0.02 0.02  192.168.0.104 testserver3 GET /console/allSchoolSpecialList.do?versionId=1397&isAuditing=
1-0 4942 0/5/5 _  0.35 13 0 0.0 0.00 0.00  192.168.0.95 testserver3 GET /server-status?refresh=auto HTTP/1.1
1-0 4942 0/5/5 _  0.37 8 93 0.0 0.01 0.01  192.168.0.104 testserver3 POST /console/displayStudentList.do?action=search HTTP/1.1
1-0 4942 0/5/5 _  0.37 8 2 0.0 0.03 0.03  192.168.0.104 testserver3 GET /js/jquery.bgiframe.js HTTP/1.1
1-0 4942 0/5/5 _  0.37 8 0 0.0 0.02 0.02  192.168.0.104 testserver3 GET /js/HG.Dialog.js HTTP/1.1
1-0 4942 0/5/5 _  0.38 8 2 0.0 0.00 0.00  192.168.0.104 testserver3 GET /js/jquery.dimensions.js HTTP/1.1
1-0 4942 0/5/5 _  0.38 8 1 0.0 0.01 0.01  192.168.0.104 testserver3 GET /js/ajaxfileupload.js HTTP/1.1
1-0 4942 0/5/5 _  0.38 8 0 0.0 0.00 0.00  192.168.0.104 testserver3 GET /js/comment.js HTTP/1.1
1-0 4942 0/5/5 _  0.38 7 0 0.0 0.00 0.00  192.168.0.104 testserver3 GET /css/main.css HTTP/1.1
1-0 4942 0/5/5 _  0.39 7 0 0.0 0.01 0.01  192.168.0.104 testserver3 GET /js/pantoDialog.js HTTP/1.1
1-0 4942 0/5/5 _  0.40 7 0 0.0 0.00 0.00  192.168.0.104 testserver3 GET /img/loading.gif HTTP/1.1
1-0 4942 0/5/5 _  0.40 7 2 0.0 0.00 0.00  192.168.0.104 testserver3 GET /img/n_03.jpg HTTP/1.1
1-0 4942 0/5/5 _  0.40 7 0 0.0 0.02 0.02  192.168.0.104 testserver3 GET /img/n_02.jpg HTTP/1.1

--------------------------------------------------------------------------------
Srv Child Server number - generation
PID OS process ID
Acc Number of accesses this connection / this child / this slot
M Mode of operation
Module Module active
CPU CPU usage, number of seconds
SS Seconds since beginning of most recent request
Req Milliseconds required to process most recent request
Conn Kilobytes transferred this connection
Child Megabytes transferred this child
Slot Total megabytes transferred this slot

--------------------------------------------------------------------------------

IBM_HTTP_Server Server at 192.168.0.66 Port 80


(3)使用LR8.1监控IHS服务
此时可以进行监控了。在LR8.1中,IHS对应服务实际是Apache服务(IBM封装了Apache,并改了名)。添加Apache的计数器之后,可能发现“忙服务器数(Apache)、闲服务器数(Apache)”这两个计数器出错,而其他计数器正常,有输出数据。报错信息如下:
Monitor name :Apache. 正在分析错误,找不到标记: BusyServers。度量: BusyServers|192.168.0.66。提示: 1)此类度量不存在,或者 html 页可能不同于所支持的页。2)尝试将 <Installation>\dat\monitors 中的 Apache.cfg 替换为相应的 Apache_<版本>.cfg 文件,并重新运行应用程序(入口点: CApacheMeasurement::NewData)。 [MsgId: MMSG-47479]

打开LR的默认计数器配置文件,位于<Installation>\dat\monitors下的apache.cfg(其它文件名类似Apache_<version>.cfg的是Apache监视配置的备份,只有apache.cfg是生效的),其内容如下第4部分。对比“IHS服务的汇总信息”可以发现,apache.cfg的默认信息有以下两点与之不同:
Counter0=IdleServers
Counter4=BusyServers
先备份该文件,然后按如下方式修改:
Counter0=IdleWorkers
Counter4=BusyWorkers
严谨起见,建议同时修改apache.cfg的#后面的注释信息。即将:
;Label0=#Idle Servers (Apache)
;Label4=#Busy Servers (Apache)
修改为:
;Label0=#Idle Workers (Apache)
;Label4=#Busy Workers (Apache)
到这里,关闭并重新启动Controller,即可正常监控IHS了。

(4)apache.cfg默认信息
;apache.cfg file, LP version: 284

[Apache]
Counters=5
Counter0=IdleServers
;Label0=#Idle Servers (Apache)
Label0=闲服务器数(Apache)
;Description0=Number of servers in the Idle state.
Description0=处于空闲状态的服务器数。
Counter1=Total Accesses
;Label1=Hits/sec (Apache)
Label1=点击次数/秒(Apache)
;Description1=The HTTP request rate.
Description1=HTTP 请求速率。
KeepPrevValue1=1
Counter2=Total kBytes
;Label2=KBytes Sent/sec (Apache)
Label2=已发送 KB/秒(Apache)
KeepPrevValue2=1
;Description2=The rate at which data bytes are sent from the Web server.
Description2=从 Web 服务器发送数据字节使用的速率。
Counter3=CPULoad
;Label3=Apache CPU Usage (Apache)
Label3=Apache CPU 使用情况(Apache)
;Description3=Percentage of time the CPU is utilized by the Apache server.
Description3=Apache 服务器利用的 CPU 时间的百分比。
Counter4=BusyServers
;Label4=#Busy Servers (Apache)
Label4=忙服务器数(Apache)
;Description4=Number of servers in the Busy state
Description4=处于繁忙状态的服务器数
Delimiter=:
infoURL=/server-status?auto
serverPort=80
SamplingRate=0


[ProxySettings]
useProxy=1
proxyUsername=
proxyPassword=
proxyDomain=
httpProxy=


本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/shwonder/archive/2010/07/22/5756018.aspx
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

  • TA的每日心情
    奋斗
    2022-5-8 19:23
  • 签到天数: 137 天

    连续签到: 1 天

    [LV.7]测试师长

    2#
    发表于 2010-8-1 19:29:10 | 只看该作者
    没做过,有机会试试
    回复 支持 反对

    使用道具 举报

    本版积分规则

    关闭

    站长推荐上一条 /1 下一条

    小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

    GMT+8, 2024-11-14 03:16 , Processed in 0.070977 second(s), 28 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

    快速回复 返回顶部 返回列表