如何监测Apache http,监测Apachehttp
如何监测Apache http,监测Apachehttp
最近在做监控,需要监测Apache http。
看了以下几篇文章,写的很不错,给我提供了很好的思路。
http://www.tecmint.com/monitor-apache-web-server-load-and-page-statistics/
https://anturis.com/apache-monitoring/
可监测的项目整理如下:
1.aggregate CPU consumption of all Apache processes
2.aggregate memory consumption of all Apache processes
3.number of busy workers
4.number of idle workers
5.average number of requests per second/mins
6.average number of Kbytes served per second/mins
7.average number of Kbytes per request
8.CPU usage by all Apache workers
9.thread numbers
也就是:
1.apache占用的cpu
2.Apache占用的mem
3.正在处理任务的work
4.空闲的wordk数
5.每秒(分)请求数量
6.每秒(分)传输的字节数
7.每个请求传输的字节数
8.每个work的cpu使用百分比
9.Apache进程数,如果这个为0 那么就说明 Apache挂了。。。。
那么以上的这些东西怎么去获取?
Apache提供了模块,我们只需要做的是写个脚本解析下页面就可以了。
所以来的模块是:
LoadModule status_module modules/mod_status.so
具体的配置如下:
<Location /server-status>
SetHandler server-status
Order deny,allow
Allow from all
</Location>
而这个配置得到的信息相对还是比较少的,还需要打开个配置:
223 #
224 # ExtendedStatus controls whether Apache will generate "full" status
225 # information (ExtendedStatus On) or just basic information (ExtendedStatus
226 # Off) when the "server-status" handler is called. The default is Off.
227 #
228 ExtendedStatus On
以上可以获取比较全的Apache监控信息了。
评论暂时关闭