apachetop (資訊工具)

最後更新: 2015-06-09

目錄

 


apachetop

 

apachetop 是一個統計當前訪問情況的工具來

它的原理是透過分析 apache 的 access.log 來實現

資訊有 REQS , REQ/S , KB , KB/S , URL

REQS X FileSize = KB

Install

# epel

yum install apachetop

用方 :

每 3 sec 更新分析 10 sec 內指定路徑的 access.log 一次

apachetop -d 3 -T 10 -f /var/log/apache2/datahunter.org/access.log

output:

last hit: 00:00:00         atop runtime:  0 days, 00:00:06             15:27:12
All:            0 reqs (   0.0/sec)          0.0B (    0.0B/sec)       0.0B/req
2xx:       0 ( 0.0%) 3xx:       0 ( 0.0%) 4xx:     0 ( 0.0%) 5xx:     0 ( 0.0%)
R (  6s):       0 reqs (   0.0/sec)          0.0B (    0.0B/sec)       0.0B/req
2xx:       0 ( 0.0%) 3xx:       0 ( 0.0%) 4xx:     0 ( 0.0%) 5xx:     0 ( 0.0%)

...

 


GoAccess

 

HomePage: http://goaccess.io/

另一個類似 apachetop 的工具, 功能更強大:

  • 它有 terminal UI 及 browser UI (Web Socket server)
  • written in C
  • Real Time(200 ms)
  • Only ncurses as a dependency

Install

# epel (Centos7)

yum install goaccess

Usage

Terminal Output

goaccess access.log -c

Static HTML Output

goaccess access.log -o report.html --log-format=COMBINED

Real-Time HTML Output

# WebSocket Server (it pushes the latest data to the browser)

goaccess access.log -o /var/www/html/report.html --log-format=COMBINED --real-time-html