ngxtop安装和使用

监控nginx的请求信息,总共收到了多少个请求,有哪些成功的,有哪些失败的

ngxtop安装

1、安装python-pip

1) yum install epel-release

出现如下错误:No package epel-release available

解决方法:

wget http://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm 

rpm -ivh epel-release-latest-7.noarch.rpm

检查是否安装成功:

yum repolist

 

2) yum install python-pie

出现如下错误: No package python-pie available

解决方法:

wget  http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm

rpm -ivh epel-release-6-8.noarch.rpm

3) 安装ngxtop

pip install ngxtop

ngxtop文档: https://github.com/lebinh/ngxtop

4、ngxtop的使用

1、指定配置文件:

 ngxtop -c /usr/local/nginx/conf/nginx.conf

 2、查询状态是200

 ngxtop -c /usr/local/nginx/conf/nginx.conf -i 'status == 200'

3、查询访问最多的ip

ngxtop -c /usr/local/nginx/conf/nginx.conf -g remote_addr

猜你喜欢

转载自www.cnblogs.com/linlf03/p/11241669.html