Sarg / Lightsquid [RESOLVIDO]

1. Sarg / Lightsquid [RESOLVIDO]

Eduardo
vchacal

(usa Debian)

Enviado em 19/07/2022 - 13:50h

Bom dia pessoal,

Estou tentando gerar relatórios do squid no Debian 11, sarg ou lightsquid. Porém estou tendo problemas com ambos.

No lightsquid, fiz a instalação e configurações do apache normal. Executado sem erros o comando p/ gerar os relatórios
/usr/share/lightsquid/lightparser.pl 
.
Qdo acesso pelo navegador p/ visualizar os relatórios é apresentado Error: report folder '/var/lib/lightsquid/report' not contain any valid data! Please run lightparser.pl (and check 'report' folder content).

E realmente, dentro da pasta report não tem nada, até tentei executar
/usr/share/lightsquid/lightparser.pl /var/log/squid/access.log 
, mas não acusa nenhum erro no comando e nem gera nada dentro do report.



E no sarg, como não tem nos repos, estou tentando compilar e no make da erro:
cc1: all warning being treated as errors
make:*** [Makefile:75: util.o] Error 1


Se alguém souber de algo que eu posso estar fazendo de errado ou verificar p/ acertar um dos dois, agradeço d+.

Vlw :)



  


2. MELHOR RESPOSTA

Osama Jr.
/bin/laden

(usa Void Linux)

Enviado em 22/07/2022 - 10:03h

Parece haver um bug com o Lightsquid relacionado a datas.

https://finisky.github.io/2021/01/03/lightsquidhardcodeyear.en/

Vê se isso te ajuda cara.



---------------------------------------------------
echo 1244394795515721490698P | dc

3. Re: Sarg / Lightsquid [RESOLVIDO]

Osama Jr.
/bin/laden

(usa Void Linux)

Enviado em 19/07/2022 - 18:19h

Roda o lightparser em modo debug:

/usr/share/lightsquid/lightparser.pl -d

---------------------------------------------------
echo 1244394795515721490698P | dc


4. Re: Sarg / Lightsquid [RESOLVIDO]

Eduardo
vchacal

(usa Debian)

Enviado em 20/07/2022 - 20:03h


/bin/laden escreveu:

Roda o lightparser em modo debug:

/usr/share/lightsquid/lightparser.pl -d

---------------------------------------------------
echo 1244394795515721490698P | dc


Obrigado pela resposta e desculpa a demora.

Eu executei em modo debug e a saída foi assim:
root@srv-firewall:/etc/lightsquid# /usr/share/lightsquid/lightparser.pl 
>>> use file :: /var/log/squid/access.log
run TIME: 0 sec
LightSquid parser statistic report

53 lines processed (average 53.00 lines per second)
0 lines parsed
0 lines recovered
0 lines notrecovered
0 lines skiped by bad year
53 lines skiped by date filter
0 lines skiped by Denied filter
0 lines skiped by skipURL filter

WARNING !!!!, parsed 0 lines from total : 53
please check confiuration !!!!
may be wrong log format selected ?


Olhando o arquivo de configuração /etc/lightsquid/lightsquid.cfg eu não to achando o que pode estar errado. Segue o arquivo, se achar algo que eu possar estar deixando passar batido, me avise por favor ...
Pode ser alguma cabaçada minha, mas to pesquisando pra tentar achar e corrigir o problema.

Mais uma vez obrigado :)

#!/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 ="/etc/lightsquid";
#path to `tpl` folder
$tplpath ="/usr/share/lightsquid/tpl";
#path to `lang` folder
$langpath ="/usr/share/lightsquid/lang";
#path to `report` folder
$reportpath ="/var/lib/lightsquid/report";
#path to access.log
$logpath ="/var/log/squid";
#path to `ip2name` folder
$ip2namepath ="/usr/share/lightsquid/ip2name";

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

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

#if 1 - lightparser generate some statistic
$debug = 1;
#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 ="eng";

#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 = 2*1024*1024;

#user maximum size per day limit (oversize)
$perusertrafficlimit = 10*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;
}





5. Re: Sarg / Lightsquid [RESOLVIDO]

Eduardo
vchacal

(usa Debian)

Enviado em 22/07/2022 - 10:35h


/bin/laden escreveu:

Parece haver um bug com o Lightsquid relacionado a datas.

https://finisky.github.io/2021/01/03/lightsquidhardcodeyear.en/

Vê se isso te ajuda cara.



---------------------------------------------------
echo 1244394795515721490698P | dc


/bin/laden,

Ajudou d+, realmente tem o bug e depois que apliquei a alteração informada no link deu certo.
Está funcionando normal agora.

Grato pela sua ajuda. Vlw mesmo.









Patrocínio

Site hospedado pelo provedor RedeHost.
Linux banner

Destaques

Artigos

Dicas

Tópicos

Top 10 do mês

Scripts