Home > Article > Operation and Maintenance > How to monitor nginx log data in real time
ngxtop is a python-based program that can be installed on Python. ngxtop parses nginx access logs in real time and outputs the results (useful indicators of the nginx server) to the terminal.
Main functions
Current valid requests
Summary of total request count (recommended learning: nginx tutorial)
Total number of requests served by status code (2xx, 3xx, 4xx, 5xx)
Average bytes sent
Top remote The address
can not only monitor access to Nginx logs in real time, but also troubleshoot and organize previous logs.
Install ngxtop on Linux
First, you need to install PIP (Python Package Management System)
Use root credentials to log in to your Server
Enable the EPEL repository by installing the following package
wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-6.noarch.rpm rpm -ivh epel-release-7-6.noarch.rpm 然后执行以下命令安装pip yum install python-pip 最后使用下面安装ngxtop pip install ngxtop
ngxtop usage details
Usage:
ngxtop [选项] ngxtop [选项](print | top | avg | sum)<var> ngxtop info
Options:
The above is the detailed content of How to monitor nginx log data in real time. For more information, please follow other related articles on the PHP Chinese website!