# https://github.com/GuyCheung/falcon-ngx_metric

yum install -y gcc gcc-c++ gcc-g77 flex bison autoconf automake bzip2-devel zlib-devel ncurses-devel libjpeg-devel libpng-devel libtiff-devel freetype-devel pam-devel openssl-devel libxml2-devel gettext-devel pcre-devel git lua-devel libxslt-devel gd-devel geo ip-devel perl-ExtUtils-Embed geoip-devel


./configure --prefix=/usr/share/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --http-client-body-temp-path=/var/lib/nginx/tmp/client_body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --pid-path=/var/run/nginx.pid --lock-path=/var/lock/subsys/nginx --user=nginx --group=nginx --with-file-aio --with-ipv6 --with-http_ssl_module --with-http_v2_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module=dynamic --with-http_image_filter_module=dynamic --with-http_geoip_module=dynamic --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_slice_module --with-http_stub_status_module --with-http_perl_module=dynamic --with-mail=dynamic --with-mail_ssl_module --with-pcre --with-pcre-jit --with-stream=dynamic --with-stream_ssl_module --with-debug --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' --with-ld-opt=' -Wl,-E'  --add-module=modules/lua-nginx-module-0.10.9rc6


python nginx_collect.py --format=falcon
http://127.0.0.1:9091/monitor/basic_status
/monitor/basic_status
/monitor/basic_status
/monitor/nginx_status

# 需要下载master里面的nginx_collect.py才有 falcon-addr参数,才可以进行上报。已经release的版本里面是不可以上报的。 
python nginx_collect.py --format=falcon --falcon-addr=http://127.0.0.1:1988/v1/push
python nginx_collect.py --format=falcon --use-ngx-host

curl http://127.0.0.1:9091/monitor/basic_status
curl http://127.0.0.1:22280/monitor/basic_status

[root@openfalcon-99 falcon-ngx_metric-0.0.0]# curl http://127.0.0.1:9091/monitor/basic_status
query_count|baobiao.sdgakj.com|/monitor/basic_status|1
latency|baobiao.sdgakj.com|/monitor/basic_status|0,
query_count|baobiao.sdgakj.com|/ims/gitusercodecount|3
latency|baobiao.sdgakj.com|/ims/gitusercodecount|0.041,0.035,0.034,
upstream_contacts|baobiao.sdgakj.com|/ims/gitusercodecount|3
upstream_latency|baobiao.sdgakj.com|/ims/gitusercodecount|0.041,0.035,0.034,
[root@openfalcon-99 falcon-ngx_metric-0.0.0]# curl http://127.0.0.1:22280/monitor/basic_status
query_count|127.0.0.1|/monitor/basic_status|1
latency|127.0.0.1|/monitor/basic_status|0,

# endpoint baobiao.sdgakj.com
query_count/api=/ims/gitusercodecount
query_count/api=/ims/platformonlinesum
upstream_latency_50th/api=/ims/gitusercodecount
upstream_latency_50th/api=/ims/platformonlinesum

下载内容

* nginx_metric 
wget https://github.com/GuyCheung/falcon-ngx_metric/archive/v0.0.0.tar.gz

* nginx lua module
wget https://github.com/openresty/lua-nginx-module/archive/v0.10.9rc6.tar.gz

* nginx metric with push operation
wget https://raw.githubusercontent.com/GuyCheung/falcon-ngx_metric/master/nginx_collect.py

* nginx
http://nginx.org/download/nginx-1.13.2.tar.gz
Copyright © opschina.org 2017 with zzlyzq@gmail.com all right reserved,powered by Gitbook该文件修订时间: 2017-07-11 11:32:48

results matching ""

    No results matching ""