在cacti中使用ATS的stats_over_http模块进行监控部分性能
最近要监控ATS,使用stats_over_http.so模块可以使用url来查看ats的状态,在cacti里面加上了几个值来监控,包含:proxy.process.http.completed_requests
所有收到请求,使用count模式统计每秒完成的请求
proxy.process.http.incoming_requests
proxy.process.http.outgoing_requests
进入和出的请求,基本能够描述ats的繁忙程度
proxy.process.http.1xx_responses
proxy.process.http.2xx_responses
proxy.process.http.3xx_responses
proxy.process.http.4xx_responses
proxy.process.http.5xx_responses
给客户端返回的HTTP status code的数量,基本反映服务情况
proxy.process.http.tcp_hit_count_stat
proxy.process.http.tcp_refresh_hit_count_stat
proxy.process.http.tcp_ims_hit_count_stat
proxy.process.http.tcp_miss_count_stat
proxy.process.http.tcp_refresh_miss_count_stat
proxy.process.http.tcp_ims_miss_count_stat
6个来计算命中率(命中/(命中+失败)),基本能够反映命中率
ps:cacti,在用php写script/command的时候,echo输出结果必须一次性输出,否则cacti无法接收到结果,比如 echo "a:"."20 ";echo "b:"."30";只能接收到a的值,必须 echo "a:"."20 "."b:"."30";才可以,但在cli里输出是一样的。这点问题折腾了1个上午。
cacti建立模板和输入就大概写个流程,就不仔细写了
1、Data Input Methods,记得选择script/command 就可以了,Input String里对照程序来写比如:
-q /scripts/flashapp_get_ts_stat.php completed_requests 记得填对应的需求就好了,下面的Output fields,大家根据输出来写吧
2、Data Templates
自己起名字了,什么的。不会看前面的文章,注意下面的Data Source Type 选择就好了
3、Graph Templates
这部分 大家根据喜好自己设置吧。
ps附件 cacti模板和php,php放到scripts目录,xml导入就好了
php代码:
附件:http://down.运维网.com/data/2363942
页:
[1]