Lighlsquid неправильно считает трафик

Простые/общие вопросы по UNIX системам. Спросите здесь, если вы новичок

Модераторы: vadim64, terminus

Правила форума
Убедительная просьба юзать теги [cоde] при оформлении листингов.
Сообщения не оформленные должным образом имеют все шансы быть незамеченными.
underground
рядовой
Сообщения: 45
Зарегистрирован: 2014-01-30 13:41:40

Lighlsquid неправильно считает трафик

Непрочитанное сообщение underground » 2014-07-18 10:57:00

Всем доброго времени суток!!!
Помогите пожалуйста разобраться – ничего понять не могу…
ОС – FreeBSD 9.2
SQUID – 3.3
Lightsquid – 1.8
Скачал я 17 июля фильм в 1,45 Гига, а по анализу потрачено всего-навсего 20,9 мегабайт.
18 июля скачал еще один фильм, уже 2,47 Гига, а по анализу 1,1 мегабайт.
Вот конфиги SQUID и Lightsquid
Конфиг SQUIDа:

Код: Выделить всё

root@FreeBSD:/ # cat /usr/local/etc/squid/squid.conf
#
# Recommended minimum configuration:
#

visible_hostname squid.router.corbet
connect_timeout 20 second
dns_v4_first on
shutdown_lifetime 1 seconds

# Example rule allowing access from your local networks.
# Adapt to list your (internal) IP networks from where browsing
# should be allowed
##acl localnet src 10.0.0.0/8   # RFC1918 possible internal network
##acl localnet src 172.16.0.0/12        # RFC1918 possible internal network
acl localnet src 192.168.20.0/24        # RFC1918 possible internal network
##acl localnet src fc00::/7       # RFC 4193 local private network range
##acl localnet src fe80::/10      # RFC 4291 link-local (directly plugged) machines

acl SSL_ports port 443
acl Safe_ports port 80          # http
acl Safe_ports port 21          # ftp
acl Safe_ports port 443         # https
acl Safe_ports port 70          # gopher
acl Safe_ports port 210         # wais
acl Safe_ports port 1025-65535  # unregistered ports
acl Safe_ports port 280         # http-mgmt
acl Safe_ports port 488         # gss-http
acl Safe_ports port 591         # filemaker
acl Safe_ports port 777         # multiling http
acl CONNECT method CONNECT
##acl AdminsIP src "/usr/local/etc/squid/AccessLists/AdminsIP.txt"
##acl RestrictedDomains dstdomain "usr/local/etc/squid/AccessLists/RestrictedDomains.txt"
acl MimeAudioVideo rep_mime_type audio video
acl UrlIP url_regex -i ^http://[-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/.*

#
# Recommended minimum Access Permission configuration:
#
# Deny requests to certain unsafe ports
http_access deny !Safe_ports

# Deny CONNECT to other than secure SSL ports
http_access deny CONNECT !SSL_ports

# Only allow cachemgr access from localhost
http_access allow localhost manager
http_access deny manager

# We strongly recommend the following be uncommented to protect innocent
# web applications running on the proxy server who think the only
# one who can access services on "localhost" is a local user
#http_access deny to_localhost

#
# INSERT YOUR OWN RULE(S) HERE TO ALLOW ACCESS FROM YOUR CLIENTS
#

# Example rule allowing access from your local networks.
# Adapt localnet in the ACL section to list your (internal) IP networks
# from where browsing should be allowed
http_access allow localnet
http_access allow localhost

# And finally deny all other access to this proxy
http_access deny all

# Squid normally listens to port 3128
http_port 127.0.0.1:3128
http_port 127.0.0.1:3129 intercept
logfile_rotate 10
access_log /var/log/squid/access.log squid

# Uncomment and adjust the following to add a disk cache directory.
##cache_dir ufs /var/squid/cache 100 16 256

# Leave coredumps in the first cache dir
coredump_dir /var/squid/dump

##access_log daemon: /var/log/squid/access.log squid
##access_log stdio: /var/log/squid/access.log squid

#
# Add any of your own refresh_pattern entries above these.
#
refresh_pattern ^ftp:           1440    20%     10080
refresh_pattern ^gopher:        1440    0%      1440
refresh_pattern -i (/cgi-bin/|\?) 0     0%      0
refresh_pattern .               0       20%     4320
root@FreeBSD:/ #
Конфиг Lightsquid’а

Код: Выделить всё

root@FreeBSD:/ # cat /usr/local/etc/lightsquid/lightsquid.cfg
#!/usr/bin/perl
#
# LightSquid Project (c) 2004-2008 Sergey Erokhin aka ESL
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# detail see in gnugpl.txt

# -------------------- GLOBAL VARIABLES  ---------------------------

#path to additional `cfg` files
$cfgpath             ="/usr/local/etc/lightsquid";
#path to `tpl` folder
$tplpath             ="/usr/local/www/apache24/data/lightsquid/tpl";
#path to `lang` folder
$langpath            ="/usr/local/share/lightsquid/lang";
#path to `report` folder
$reportpath          ="/usr/local/www/apache24/data/lightsquid/report";
#path to access.log
$logpath             ="/var/log/squid";
#path to `ip2name` folder
$ip2namepath         ="/usr/local/libexec/lightsquid";

#path to `lockfile` ;-)
$lockpath            =$reportpath;

#if lockfile older $maxlocktime second, remove old lock file.
$maxlocktime         = 30*60;

#if 1 - lightparser generate some statistic
$debug               = 0;
#if 1 - lightparser generate skip details, 2 ..., 3 ..., ....
$debug2              = 0;

# -------------------- LightParser VARIABLES  ---------------------------
#squid log type
#if native squid format (default squid, see in doc) - must be 0
#if EmulateHttpdLog ON - set 1
#digit - for speed optimization
#try it set to 1 if parser generate warning
#
#see also month2dec below !!!!
#
$squidlogtype        = 0;

#if you want skip some sites from stat, example our local www server
#WARNING !!!, don't leave this variable empty !!!
#example, if you want skip LOCAL site, put it here
#WARNING2
#use '' instead of "" !!!!!!!!!!!

#$skipurl             = 'zdd\.com|192\.168\.1\.|cnn\.com';
$skipurl             = 'zzz\.zzz';

#define sobroutine file for convertion from IP into name
#if you want skip some ip from log - return "SKIP THIS IP" ;-)
#detail see in ip2name folder,

$ip2name="simple";

#use for convert from Text to Dec convertion if EmualteHttpdLog format !!!!
#fix it if need
%month2dec = ( Jan => 1, Feb => 2, Mar => 3, Apr => 4, May => 5,Jun => 6,
               Jul => 7, Aug => 8, Sep => 9, Oct => 10, Nov => 11,Dec => 12);

# -------------------- Common (Parser & Web) VARIABLES  ----------------------
#create & use time report statistic (logsize = logsize*2) ;-))
$timereport          = 1;

# -------------------- WEB VARIABLES  ----------------------------------------

#language
#see `lang` folder (avaible: bg,eng,fr,hu,it,pt_br,ru,sp)
$lang                ="ru";

#html template name
#see template folder `tpl/$templatename/`
$templatename        ="base";
#$templatename        ="ric";
#$templatename        ="base.css";

#define type of decimal output
#fine  123456789 -> 123,456,789
#class 123456789 ->       117.7 G
$DecOutType="class";

# define delimiter for thousands (in `fine` mode)
# = " " -> 12 345 678
# = "," -> 12,345,678
# = ""  ->   12345678
$decdelimiter        = " ";

#if you dont need Group mode, do =0
$showgrouplink       = 1;

#if not zero, groups look like "01. Group1", if zero - "Group1"
$showgroupid         = 1;

#if you dont need oversize report , do =0
$showoversizelink    = 1;

#show how many data user send to internet
$showputpost         = 0;
#if putpost higer this variable (in percent), highlight it
$putpostwarninglevel =15;

#use or not .realname files
#.realname contain pair userid -> Full User Name
$userealname         = 1;

#if url size exceed $bigfilelimit - add this file into report
$bigfilelimit        = 5000*1024*1024;

#user maximum size per day limit (oversize)
$perusertrafficlimit = 10000*1024*1024;

# weekend display mode
# both - select sunday & monday
# monday - only monday
$weekendmode="both";

#how many site show in TopSites report
$topsiteslimit       = 500;

#how many site show in user time report
$usertimelimit       = 200;


#if you want user traffic GRAPHIC report, set it in 1
#WARNING !!!, need libgd, GD.PM & other external modules !!!
#please run check-setup.pl for check library !!!!
$graphreport         = 1;

#higest value on graph report
# for user month report (0.05*(...) = 50mb)
$graphmaxuser=0.05*(1024*1024*1024);
# for all user month report (1.05*(...) = 1 Gb)
$graphmaxall =0.80*(1024*1024*1024);

#color scheme for GRAPHICs, avaible "orange","blue","green","yellow","brown","red"
$barcolor="orange";


#-------------------------------------------------------------------------- Group support
#

sub CreateGroupFile($) {
  my $path=shift;

  open Fi,"<$cfgpath/group.cfg";
  open Fo,">$path/.group";
  while (<Fi>) {
    print Fo $_;
  }
  close Fo;
  close Fi;
}

#-------------------------------------------------------------------------- RealName support
#

sub CreateRealnameFile($) {
  my $path=shift;

  open Fi,"<$cfgpath/realname.cfg";
  open Fo,">$path/.realname";
  while (<Fi>) {
    print Fo $_;
  }
  close Fo;
  close Fi;
}
root@FreeBSD:/ #
В файле access.log строки присутствуют, т.е. статистика Сквидом собирается.
Подскажите пожалуйста, что не так?

И еще один вопрос: автоматом не парсит. Приходится парсинг запускать врусную.
Строка автоматизации парсинга в crontab:
5 * * * * * /usr/local/www/apache24/data/lightsquid/lightparser.pl
Пробовал также:
*/5 * * * * * /usr/local/www/apache24/data/lightsquid/lightparser.pl
и:
*/5 * * * * * /usr/local/www/apache24/data/lightsquid/lightparser.pl today
Не работает.

Заранее благодарен за Ваши советы

С уважением
Илья

Хостинговая компания Host-Food.ru
Хостинг HostFood.ru
 

Услуги хостинговой компании Host-Food.ru

Хостинг HostFood.ru

Тарифы на хостинг в России, от 12 рублей: https://www.host-food.ru/tariffs/hosting/
Тарифы на виртуальные сервера (VPS/VDS/KVM) в РФ, от 189 руб.: https://www.host-food.ru/tariffs/virtualny-server-vps/
Выделенные сервера, Россия, Москва, от 2000 рублей (HP Proliant G5, Intel Xeon E5430 (2.66GHz, Quad-Core, 12Mb), 8Gb RAM, 2x300Gb SAS HDD, P400i, 512Mb, BBU):
https://www.host-food.ru/tariffs/vydelennyi-server-ds/
Недорогие домены в популярных зонах: https://www.host-food.ru/domains/

Аватара пользователя
andrian_freebsd
сержант
Сообщения: 171
Зарегистрирован: 2013-08-21 16:10:16
Откуда: Україна

Re: Lighlsquid неправильно считает трафик

Непрочитанное сообщение andrian_freebsd » 2014-07-30 14:37:09

если нужен подсчет трафика тогда free-sa, намного шустрее, если нужно именно Lightsquid - тогда извените, непомогу.