|
(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 |
|