We often need to know the server's real-time monitoring of the health of the server, such as which URLs are the largest number of visits, the server per second requests, which search engine is crawling our site? Faced with these problems, although we can go to the analysis of the statistical access log files, but it can not let us real-time statistics, can not give us intuitive statistical data. Now, apachetop This tool will be able to track log changes in real time, to see which files visitors are looking at, and what information they have on their visitors ' IP.
1. Apachetop Installation
# RPM-IVH http://mirrors.hustunique.com/epel/5/i386/epel-release-5-4.noarch.rpm
# yum Install Apachetop
2. Apapchetop use
# apachetop-h
apachetop v0.12.6-usage:
File options:-
F logfile Open logfile (assumed common/combined) [/va R/log/httpd/access_log]
(repeat option for more than one source)
url/host/referrer munging options:-
Q keep the request string [no
] -L all URLs lowercase [No]-
s num keep URL path segment quantity [all]-
p in front of referrer reserved protocol [No] -R retains each host/IP [no]
Stats options:
two parameters must be supplied. Default: [T]-
h hits keep state only to how many clicks -
t secs keep state only to how many seconds-
d secs Refresh delay time [5]-
h this help
When executed, there are also commands to toggle the display status:
One-touch COMMANDS
D : Toggle urls/referrers/hosts display mode switch
n : Toggle hits & bytes or return code switch
h or? : Help information
P : (un) pause display (freeze update)
Q : Exit Apachetop
up/down : Move star up/down
right/left: Enter/ Exit display Mode
submenu:
S: sort: [The appropriate menu would appear for your display]
R requests r reqs/sec B) bytes b ) bytes/sec
2) 2xx 3) 3xx 4) 4xx 5) 5xx
t: Fixed display on/off:
u) referrers h) hosts
F : Using filter:
a) Add/edit menu C) Clear all s) show active (not done yet)
A:add FILTER submenu
u) to URL R to Referrers h) to hosts
3. apachetop Example
Apachetop can also monitor nginx logs in real time, but the Nginx access log format must be either generic or federated log format, otherwise some information is not statistically available.
Thanks for reading, hope to help everyone, thank you for your reading of this site!