This tutorial will teach you how to check the Top HTTP connections,TOP 10 Ip's using Port 80,Top domains which are using heavy HTTP Hits Follow the below commands.
Note : You must be an Root user to check these details :
The following commands should be of some help:
Show all IPs with connections to port 80 sorted by number of connections:
netstat -pantu |grep :80|awk '{print $5}'|awk -F: '{print $1}'|sort |uniq -c|sort -nr
Show sites accessed for all IPs
for i in ` netstat -pantu |grep :80|awk '{print $5}'|awk -F: '{print $1}'|sort |uniq`; do echo $i; grep -l $i /usr/local/apache/domlogs/*/*; done
Show top 20 IPs
netstat -pantu|grep :80|awk '{print $5}'|awk -F: '{print $1}'|sort |uniq -c|sort -nr|head -20
Show sites accessed by top 20 IPs
for i in ` netstat -pantu |grep :80|awk '{print $5}'|awk -F: '{print $1}'|sort |uniq -c|sort -nr|awk '{print $2}'|head -20`; do echo $i; grep -l $i /usr/local/apache/domlogs/*/*; done
Note : You must be an Root user to check these details :
The following commands should be of some help:
Show all IPs with connections to port 80 sorted by number of connections:
netstat -pantu |grep :80|awk '{print $5}'|awk -F: '{print $1}'|sort |uniq -c|sort -nr
Show sites accessed for all IPs
for i in ` netstat -pantu |grep :80|awk '{print $5}'|awk -F: '{print $1}'|sort |uniq`; do echo $i; grep -l $i /usr/local/apache/domlogs/*/*; done
Show top 20 IPs
netstat -pantu|grep :80|awk '{print $5}'|awk -F: '{print $1}'|sort |uniq -c|sort -nr|head -20
Show sites accessed by top 20 IPs
for i in ` netstat -pantu |grep :80|awk '{print $5}'|awk -F: '{print $1}'|sort |uniq -c|sort -nr|awk '{print $2}'|head -20`; do echo $i; grep -l $i /usr/local/apache/domlogs/*/*; done
0 comments:
Post a Comment