Home >Operation and Maintenance >Nginx >How to monitor nginx log data in real time

How to monitor nginx log data in real time

(*-*)浩
(*-*)浩Original
2019-11-01 14:34:523851browse

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.

How to monitor nginx log data in real time

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:

How to monitor nginx log data in real time

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn