基于python的ngxtop的安装、监控nginx与用法解析.doc
《基于python的ngxtop的安装、监控nginx与用法解析.doc》由会员分享,可在线阅读,更多相关《基于python的ngxtop的安装、监控nginx与用法解析.doc(1页珍藏版)》请在三一文库上搜索。
1、基于python的ngxtop的安装、监控nginx与用法解析ngxtop是用python开发的一款监控nginx访问日志的工具,它可以实时动态地查看访问最多的请求。centos上安装ngxtopyum install python-pippip install ngxtop用ngxtop -h查看其选项,其中几个选项含义如下:1)-l 指定访问日志2) -f 指定日志格式3) -no-follow 只处理当前已经写入的日志文件,而不是实时处理新增的日志4) -c 指定nginx.conf路径5) -n 指定显示行号内容描述.ngxtop具体用法1) $ ngxtop如果报错:Error: A
2、ccess log file or format was not set and nginx config file cannot be detected. Perhaps nginx is not in your PATH?这是因为ngxtop找不到可执行文件nginx,解决办法是ln -s /usr/local/nginx/sbin/nginx /sbin/nginx2)$ ngxtop -c /usr/local/nginx/conf/nginx.conf -n 20 /指定nginx.conf,显示20行,结果如图3) $ngxtop -c /usr/local/nginx/conf/nginx.conf print request http_user_agent remote_addr /使用print打印指定变量4) $ ssh remote tail -f /var/log/apache2/access.log | ngxtop -f common /分析远程机器的日志
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 基于 python ngxtop 安装 监控 nginx 用法 解析
链接地址:https://www.31doc.com/p-3411664.html