ngxtop: A Command-Line Tool for Real-Time Nginx Monitoring

         Nginx web servers in production environmentsRun。,Nagios, Zabbix, and Munin support Nginx monitoring.

If you don’t need comprehensive reports or long-term data statistics, and just need a quick and simple way to monitor Nginx server requests, I recommend a command-line tool called ngxtop 。

          ngxtop top。ngxtop Nginx , top 。, ngxtop 。。

, ngxtop Nginx 。

Linux ngxtop

Linux pip(LCTT:ngxtoppython)。

ngxtop。


  1. $ sudo pip install ngxtop

ngxtop


  1. ngxtop [options]
  2. ngxtop [options] (print|top|avg|sum) <var>
  3. ngxtop info

  • -l : (Nginx Apache2)
  • -f :
  • –no-follow: ,
  • -t :
  • -n :
  • -o : ()
  • -a …, –a …: (: sum, avg, min, max )。
  • -v:
  • -i :

,。

  • bodybytessend
  • http_referer
  • httpuseragent
  • remote_addr
  • remote_user
  • request
  • status
  • time_local

ngxtop Nginx

ngxtop (/etc/nginx/nginx.conf) Nginx Address。, Nginx ,:


  1. $ ngxtop

10 Nginx ,。

20:


  1. $ ngxtop n 20

Nginx:


  1. $ ngxtop info

,。 "print" 。


  1. $ ngxtop print request http_user_agent remote_addr

IPAddress


  1. $ ngxtop top remote_addr

404


  1. $ ngxtop i 'status == 404' print request status

Nginx,ngtop , Apache 。 Apache Server:


  1. $ tail f /var/log/apache2/access.log | ngxtop f common

via: http://xmodulo.com/2014/06/monitor-nginx-web-server-command-line-real-time.html

Leave a Comment

Your email address will not be published.