このチュートリアルでは、Ubuntu 20.04 LTSにNgxtopをインストールする方法を紹介します。知らなかった人のために、Ngxtopは無料で、オープンソースで、柔軟性があり、本物です。 -Nginx Webサーバー用の時間監視ツール。Nginxアクセスログを解析し、リクエスト数、リクエストされたURI、ステータスコードごとのリクエスト数などに関する情報を出力できます。
この記事は、少なくともLinuxの基本的な知識があり、シェルの使用方法を知っていること、そして最も重要なこととして、サイトを独自のVPSでホストしていることを前提としています。インストールは非常に簡単で、ルートアカウントで実行されていますが、そうでない場合は、'sudo
を追加する必要があります。 ‘ルート権限を取得するコマンドに。 Ubuntu 20.04(Focal Fossa)でのNginxサーバーのNgxtopリアルタイムメトリックのステップバイステップのインストールを紹介します。 Ubuntu 18.04、16.04、およびLinuxMintなどの他のDebianベースのディストリビューションでも同じ手順に従うことができます。
前提条件
- 次のオペレーティングシステムのいずれかを実行しているサーバー:Ubuntu 20.04、18.04、およびLinuxMintやエレメンタリーOSなどの他のDebianベースのディストリビューション。
- 潜在的な問題を防ぐために、OSの新規インストールを使用することをお勧めします。
non-root sudo user
またはroot user
へのアクセス 。non-root sudo user
として行動することをお勧めします ただし、ルートとして機能するときに注意しないと、システムに害を及ぼす可能性があるためです。
Ubuntu 20.04 LTSFocalFossaにNgxtopをインストールする
手順1.まず、次のapt
を実行して、すべてのシステムパッケージが最新であることを確認します。 ターミナルのコマンド。
sudo apt update sudo apt upgrade
ステップ2.Pythonをインストールします。
以下のコマンドを実行してPythonPIPをインストールします:
sudo apt install python3 python3-pip
ステップ3.Ubuntu20.04にNgxtopをインストールします。
pythonとpipがインストールされている状態で、以下のコマンドを使用してNgxtopをインストールします。
pip3 install ngxtop
Ngxtopをインストールしたら、次のコマンドを使用してNgxtopのバージョンを確認できます。
ngxtop --version
ステップ3.Ngxtopを使用します。
ngxtop
を使用する リクエスト数、リクエストされたURI、ステータスコードごとのリクエスト数の概要を表示するコマンド。
Usage: ngxtop [options] ngxtop [options] (print|top|avg|sum) <var> ngxtop info Options: -l <file>, --access-log <file> access log file to parse. -f <format>, --log-format <format> log format as specify in log_format directive. --no-follow ngxtop default behavior is to ignore current lines in log and only watch for new lines as they are written to the access log. Use this flag to tell ngxtop to process the current content of the access log instead. -t <seconds>, --interval <seconds> report interval when running in follow mode [default: 2.0] -g <var>, --group-by <var> group by variable [default: request_path] -w <var>, --having <expr> having clause [default: 1] -o <var>, --order-by <var> order of output for default query [default: count] -n <number>, --limit <number> limit the number of records included in report for top command [default: 10] -a <exp> ..., --a <exp> ... add exp (must be aggregation exp: sum, avg, min, max, etc.) into output -v, --verbose more verbose output -d, --debug print every line and parsed record -h, --help print this help message. --version print version information. Advanced / experimental options: -c <file>, --config <file> allow ngxtop to parse nginx config file for log format and location. -i <filter-expression>, --filter <filter-expression> filter in, records satisfied given expression are processed. -p <filter-expression>, --pre-filter <filter-expression> in-filter expression to check in pre-parsing phase.
おめでとうございます。Ngxtopが正常にインストールされました。このチュートリアルを使用して、Ubuntu 20.04 LTSFocalFossaシステムにNginxウェブサーバー用のNgxtopリアルタイム監視ツールをインストールしていただきありがとうございます。情報については、Ngxtopの公式ウェブサイトを確認することをお勧めします。