Log-Files

squid 日誌文件的問題

  • March 22, 2010

我正在使用 SARG 獲取有關 squid 日誌文件的報告,我得到了這個結果

/usr/local/Sarg/bin/sarg -l /usr/local/squid/var/logs/access.log 
SARG: Records in file: 0, reading: 0.00%
SARG: Records in file: 0, reading: 0.00%
SARG: Records in file: 0, reading: 0.00%
SARG: Records in file: 0, reading: 0.00%
SARG: Records in file: 0, reading: 0.00%
SARG: Records in file: 0, reading: 0.00%
SARG: Records in file: 0, reading: 0.00%
SARG: Records in file: 0, reading: 0.00%
SARG: Records in file: 0, reading: 0.00%
SARG: Records in file: 0, reading: 0.00%
SARG: Records in file: 0, reading: 0.00%
SARG: Records in file: 0, reading: 0.00%
SARG: Records in file: 0, reading: 0.00%
SARG: Records in file: 0, reading: 0.00%
SARG: Records in file: 0, reading: 0.00%
SARG: Records in file: 0, reading: 0.00%
SARG: Records in file: 0, reading: 0.00%
SARG: Records in file: 0, reading: 0.00%
SARG: Records in file: 0, reading: 0.00%
SARG: Records in file: 0, reading: 0.00%
SARG: Records in file: 0, reading: 0.00%
SARG: Records in file: 0, reading: 0.00%
SARG: Records in file: 0, reading: 0.00%
SARG: Records in file: 0, reading: 0.00%
SARG: Records in file: 0, reading: 0.00%
SARG: Records in file: 0, reading: 0.00%
SARG: Records in file: 0, reading: 0.00%
SARG: Records in file: 0, reading: 0.00%
SARG: Records in file: 0, reading: 0.00%
SARG: Records in file: 0, reading: 0.00%
SARG: Records in file: 0, reading: 0.00%
SARG: Records in file: 0, reading: 0.00%
SARG: Records in file: 0, reading: 0.00%
SARG: Records in file: 0, reading: 0.00%
SARG: Records in file: 0, reading: 0.00%
SARG: Records in file: 0, reading: 0.00%
SARG: Records in file: 0, reading: 0.00%
SARG: Records in file: 0, reading: 0.00%
sort: open failed: +6.5nr: No such file or directory
SARG: (index) Cannot open file: /Applications/Sarg/reports/index.sort
SARG: Records in file: 0, reading: 0.00%

可能是什麼問題呢?

這是魷魚日誌的一小部分

   1265783273.234   1139 176.16.1.2 TCP_MISS/200 468 GET http://clients1.google.com/complete/search? - DIRECT/74.125.79.100 text/javascript
1265783275.184   1382 176.16.1.2 TCP_MISS/200 3533 GET http://library.acadiau.ca/tutorials/plagiarism/ - DIRECT/131.162.201.52 text/html
1265783275.873    646 176.16.1.2 TCP_MISS/404 504 GET http://library.acadiau.ca/Scripts/AC_RunActiveContent.js - DIRECT/131.162.201.52 text/html
1265783285.221   9995 176.16.1.2 TCP_MISS/200 22733 GET http://library.acadiau.ca/scripts/swfobject_modified.js - DIRECT/131.162.201.52 application/x-javascript
1265783288.159   1869 176.16.1.2 TCP_MISS/304 408 GET http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif - DIRECT/192.150.8.60 image/gif
1265783288.170   1881 176.16.1.2 TCP_MISS/200 3306 GET http://www.statcounter.com/counter/counter.js - DIRECT/66.114.54.23 application/x-javascript
1265783289.592   1348 176.16.1.2 TCP_MISS/200 574 GET http://c.statcounter.com/t.php? - DIRECT/72.249.55.60 image/gif
1265783290.928   1330 176.16.1.2 TCP_MISS/404 485 GET http://library.acadiau.ca/favicon.ico - DIRECT/131.162.201.52 text/html
1265783300.566  13921 176.16.1.2 TCP_MISS/200 64437 GET http://library.acadiau.ca/tutorials/plagiarism/gmodule3.swf - DIRECT/131.162.201.52 application/x-shockwave-flash
1265783306.794   8271 176.16.1.2 TCP_MISS/200 33609 GET http://library.acadiau.ca/tutorials/plagiarism/aplus.xml - DIRECT/131.162.201.52 application/xml
1265783307.303  75758 176.16.1.253 TCP_MISS/200 274 GET http://stork42.dropbox.com/subscribe? - DIRECT/208.43.202.43 text/html
1265783314.672   1969 176.16.1.2 TCP_MISS/200 5111 POST http://safebrowsing.clients.google.com/safebrowsing/downloads? - DIRECT/74.125.79.102 application/vnd.google.safebrowsing-update
1265783320.217  13347 176.16.1.2 TCP_MISS/200 58432 GET http://library.acadiau.ca/tutorials/plagiarism/scene01.swf - DIRECT/131.162.201.52 application/x-shockwave-flash
1265783331.101   1305 176.16.1.2 TCP_MISS/200 1704 GET http://library.acadiau.ca/tutorials/plagiarism/scene02.swf - DIRECT/131.162.201.52 application/x-shockwave-flash
1265783336.204   1233 176.16.1.2 TCP_MISS/200 3911 GET http://library.acadiau.ca/tutorials/plagiarism/scene03.swf - DIRECT/131.162.201.52 application/x-shockwave-flash
1265783337.774  23100 176.16.1.2 TCP_MISS/200 101970 GET http://safebrowsing-cache.google.com/safebrowsing/rd/ChNnb29nLW1hbHdhcmUtc2hhdmFyEAEYod0BIMDeATIZoW4AAP________3______9__________AA - DIRECT/82.206.179.18 application/vnd.google.safebrowsing-chunk
1265783358.860   3350 176.16.1.2 TCP_MISS/200 1924 GET http://library.acadiau.ca/tutorials/plagiarism/scene05.swf - DIRECT/131.162.201.52 application/x-shockwave-flash
1265783361.661  23808 176.16.1.2 TCP_MISS/200 100536 GET http://safebrowsing-cache.google.com/safebrowsing/rd/ChNnb29nLW1hbHdhcmUtc2hhdmFyEAEYwd4BIJDfATIPQW8AAP____________8A - DIRECT/82.206.179.18 application/vnd.google.safebrowsing-chunk
1265783381.963  74655 176.16.1.253 TCP_MISS/200 274 GET http://stork42.dropbox.com/subscribe? - DIRECT/208.43.202.43 text/html
1265783385.818  24107 176.16.1.2 TCP_MISS/200 111718 GET http://safebrowsing-cache.google.com/safebrowsing/rd/ChNnb29nLW1hbHdhcmUtc2hhdmFyEAEYkd8BIODfATIPkW8AAP____________8A - DIRECT/82.206.179.18 application/vnd.google.safebrowsing-chunk
1265783426.316   8867 176.16.1.2 TCP_MISS/200 23630 GET http://library.acadiau.ca/tutorials/plagiarism/scene06.swf - DIRECT/131.162.201.52 application/x-shockwave-flash
1265783426.467      0 176.16.1.2 TCP_IMS_HIT/304 265 GET http://library.acadiau.ca/tutorials/plagiarism/scene06.swf - NONE/- application/x-shockwave-flash

第一,我起訴的是舊版本的 SARG,最新版本是 2.2.7.1,除了需要更改一個文件 ip2name.c 之外沒有任何問題

void ip2name(char *ip,int ip_len)
{
u_long addr;
struct hostent *hp;
char **p;

by

void ip2name(char *ip,int ip_len)
{
unsigned long addr;
struct hostent *hp;
char **p;

完成此操作後,報告將在 MAC 上執行良好

引用自:https://serverfault.com/questions/122482