标签:数据 header cal type location 激活 ati 采集日志 shu
配置访问地址
location /nginxstatus { stub_status on; // 禁止将监控信息写入访问日志 access_log off; }
激活插件http_stub_status_module
cd /usr/local/src/nginx-1.18.0 # 如果不是使用的默认路径,使用 --prefix 指定 ./configure --with-http_stub_status_module make && make install /usr/local/nginx/sbin/nginx -s quit /usr/local/nginx/sbin/nginx
访问地址http://192.168.10.11:8080/nginxstatus,
Active connections: 2 server accepts handled requests 14 14 78 Reading: 0 Writing: 1 Waiting: 1
状态参数如下
安装Logtail。
安装logtail,确认版本号在0.16.0及以上。若低于0.16.0版本请根据文档提示升级到最新版本。
填写采集配置。
样例配置如下
{ "inputs": [ { "type": "metric_http", "detail": { "IntervalMs": 60000, "Addresses": [ "http://10.10.XX.XX/private/nginx_status", "http://10.10.XX.XX/private/nginx_status", "http://10.10.XX.XX/private/nginx_status" ], "IncludeBody": true } } ], "processors": [ { "type": "processor_regex", "detail": { "SourceKey": "content", "Regex": "Active connections: (\\d+)\\s+server accepts handled requests\\s+(\\d+)\\s+(\\d+)\\s+(\\d+)\\s+Reading: (\\d+) Writing: (\\d+) Waiting: (\\d+)[\\s\\S]*", "Keys": [ "connection", "accepts", "handled", "requests", "reading", "writing", "waiting" ], "FullMatch": true, "NoKeyError": true, "NoMatchError": true, "KeepSource": false } } ] }
图表
Logtail详细见阿里云官网:
https://help.aliyun.com/document_detail/65673.html
也可以使用其他开源比如logstash来采集日志。可参考:
https://www.jianshu.com/p/d7e0a502fd52
标签:数据 header cal type location 激活 ati 采集日志 shu
原文地址:https://www.cnblogs.com/starcrm/p/12977630.html