网站首页 > 技术教程 正文
ngxtop是用python开发的一款监控nginx访问日志的工具,
它可以实时动态地查看访问最多的请求。
centos上安装ngxtop
yum install python-pip
pip install ngxtop
用ngxtop -h查看其选项,其中几个选项含义如下:
1)-l 指定访问日志
2) -f 指定日志格式
3) --no-follow 只处理当前已经写入的日志文件,而不是实时处理新增的日志
4) -c 指定nginx.conf路径
5) -n 指定显示行号
内容描述.
ngxtop具体用法
1) $ ngxtop
如果报错: Error: Access 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/nginx
2) $ 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 //
分析远程机器的日志
猜你喜欢
- 2024-10-10 平台进程监控介绍(系统进程监控软件)
- 2024-10-10 Zabbix监控系统系列之八:监控nginx服务
- 2024-10-10 深度|掌握Nginx监控运维,这一篇足矣!
- 2024-10-10 Nginx 监控(nginx监控工具)
- 2024-10-10 如何轻松监控Nginx?(nginx 监控)
- 2024-09-11 这可能是把Nginx讲解的最透彻的一本新书
- 2024-09-11 nginx动态添加nginx-module-vts监控流量
- 2024-09-11 Docker 容器操作:运行、监控与维护
- 2024-09-11 用groovry做简单的nginx日志实时监控脚本
- 2024-09-11 教你三种方法,用 Python实时监控文件
你 发表评论:
欢迎- 最近发表
-
- Win11学院:如何在Windows 11上使用WSL安装Ubuntu
- linux移植(Linux移植freemodbus)
- 独家解读:Win10预览版9879为何无法识别硬盘
- 基于Linux系统的本地Yum源搭建与配置(ISO方式、RPM方式)
- Docker镜像瘦身(docker 减小镜像大小)
- 在linux上安装ollama(linux安装locale)
- 渗透测试系统Kali推出Docker镜像(kali linux渗透测试技术详解pdf)
- Linux环境中部署Harbor私有镜像仓库
- linux之间传文件命令之Rsync傻瓜式教程
- 解决ollama在linux中安装或升级时,通过国内镜像缩短安装时长
- 标签列表
-
- 下划线是什么 (87)
- 精美网站 (58)
- qq登录界面 (90)
- nginx 命令 (82)
- nginx .http (73)
- nginx lua (70)
- nginx 重定向 (68)
- Nginx超时 (65)
- nginx 监控 (57)
- odbc (59)
- rar密码破解工具 (62)
- annotation (71)
- 红黑树 (57)
- 智力题 (62)
- php空间申请 (61)
- 按键精灵 注册码 (69)
- 软件测试报告 (59)
- ntcreatefile (64)
- 闪动文字 (56)
- guid (66)
- abap (63)
- mpeg 2 (65)
- column (63)
- dreamweaver教程 (57)
- excel行列转换 (56)
本文暂时没有评论,来添加一个吧(●'◡'●)