sexta-feira, 18 de janeiro de 2013

Squid                                             


# squid –k reconfigure

# tail -f /var/log/squid3/access.log | gawk '{print strftime("%d/%m/%Y %H:%M:%S", $1), $3, $7}'

18/01/2013 17:51:37 192.168.1.115 http://www.youtube.com/redirect?
18/01/2013 17:51:37 192.168.1.115 http://tags.ads-
18/01/2013 17:51:38 192.168.1.115 http://tags.ads-
18/01/2013 17:51:38 192.168.1.115 http://clients1.google.com/generate_204
18/01/2013 17:51:39 192.168.1.115 http://api15.thetrafficstat.net/related
18/01/2013 17:51:39 192.168.1.115 http://s.youtube.com/s?
18/01/2013 17:51:39 192.168.1.115 http://s2.youtube.com/s?
18/01/2013 17:51:48 192.168.1.115 http://csi.gstatic.com/csi?

_____________________________________________________________________


# awk '{print $7}' /var/log/squid3/access.log | grep -ivE '(\.gif|\.jpg|\.png|\.ico|\.css|\.js)' | sort | uniq -c | sort -rn | head -10

   2318 http://0-ect.channel.facebook.com/pull?
   1676 http://rad.msn.com/ADSAdClient31.dll?
   1258 http://65.55.71.203/gateway/gateway.dll?
    847 http://www.google.com.br/s?
    657 http://www.facebook.com/ai.php?
    585 http://www.facebook.com/ajax/chat/buddy_list.php
    474 http://sn1msg2020116.gateway.messenger.live.com/gateway/gateway.dll?
    443 http://googleads.g.doubleclick.net/pagead/ads?
    410 http://external.ak.fbcdn.net/safe_image.php?
    327 http://www.google.com.br/complete/search?

_____________________________________________________________________

# zcat /var/log/squid3/access*.gz | awk '{print $7}' | sort | uniq -c | sort -n | tail -n 20
   1581 http://googleads.g.doubleclick.net/pagead/ads?
   1586 http://4-pct.channel.facebook.com/pull?
   1657 http://www.facebook.com/ajax/chat/hovercard/sidebar.php?
   1752 http://englishway.com.br/favicon.ico
   2071 http://www.google-analytics.com/__utm.gif?
   2247 http://www.google.com.br/complete/search?
   2467 http://m.adnxs.com/ttj?
   2521 http://6-pct.channel.facebook.com/pull?
   2618 http://192.168.1.13:3128/
   2627 http://external.ak.fbcdn.net/safe_image.php?
   3154 http://2-pct.channel.facebook.com/pull?
   3251 http://3-pct.channel.facebook.com/pull?
   3616 http://0-pct.channel.facebook.com/pull?
   3779 http://www.facebook.com/ajax/chat/buddy_list.php
   3937 http://www.facebook.com/ai.php?
   4141 http://www.google.com.br/s?
   5178 http://5-pct.channel.facebook.com/pull?
   5944 http://oas.americanas.com.br/RealMedia/ads/Creatives/default/empty.gif
   9835 http://rad.msn.com/ADSAdClient31.dll?

_____________________________________________________________________



Listando conteúdo do arquivo squid.conf padrão sem as linhas comentadas.

# grep -v ^# squid.conf | grep -v ^$


_____________________________________________________________________


Vamos ver a porta do squid.

# netstat -anlp | grep squid3
tcp         0       0 0.0.0.0:3128       0.0.0.0:*     LISTEN     4512/(squid)
udp        0       0 0.0.0.0:41789     0.0.0.0:*                    4512/(squid)
udp6      0        0 :::41613            :::*                           4512/(squid)
unix  2   [ ]    DGRAM                   25104                        4508/squid3


_____________________________________________________________________


http://192.168.1.13/squid-reports/
       

# du -sch /var/www/squid-reports/daily/

# du -sch /var/www/squid-reports/weekly/

# du -sch /var/www/squid-reports/monthly/

_____________________________________________________________________


Para ver a data e a hora

# cat /var/log/squid3/access.log 



1357921670.830    444 192.168.1.55 TCP_MISS/200 94534 GET http://static.ak.fbcdn.net/rsrc.php/v2/yL/x/iFxmrwQi0HT.png - DIRECT/189.11.250.35 image/png
1357921671.047    172 192.168.1.55 TCP_MISS/200 36564 GET http://static.ak.fbcdn.net/rsrc.php/v2/yC/r/XQ3tn21V-zn.js - DIRECT/189.11.250.35 application/x-javascript
1357921671.075    803 192.168.1.55 TCP_MISS/200 84468 GET http://static.ak.fbcdn.net/rsrc.php/v2/yz/x/6PuIB0alOau.png - DIRECT/189.11.250.35 image/png


# date -d@1357921671.075
Fri Jan 11 14:27:51 BRST 2013


_____________________________________________________________________

===[ Sharing Knowledge ]=== 

Obrigado - Thank you - Danke - Merci - Grazie - Gracias - arigatou gozaimasu
_____________________________________________________________________



Nenhum comentário:

Postar um comentário