darold / squidanalyzer

Squid Analyzer parses Squid proxy access log and reports general statistics about hits, bytes, users, networks, top URLs, and top second level domains. Statistic reports are oriented toward user and bandwidth control.
http://squidanalyzer.darold.net/
126 stars 36 forks source link

After upgrade, does not reporting #131

Closed joseh-henrique closed 8 years ago

joseh-henrique commented 8 years ago

After upgrading to the current version 6.5. The report stopped being generated . Previous version used 6.3

darold commented 8 years ago

Do you have any error reported by squidanalyzer?

joseh-henrique commented 8 years ago

If I run normal /usr/local/squid-analyzer that is created

# ls -la /tmp | grep squid
rw -r - r-- 1 root root 5 May 3 15:30 squid-analyzer.pid

but

# ps aux | grep squid
root      8937  0.0  0.0 103328   888 pts/0    S+   17:41   0:00 grep squid
root     26542  0.0  0.0  77656  7168 ?        Ss   14:50   0:00 squid -f /etc/squid/squid.conf
squid    26544  3.0  0.6 266764 200624 ?       S    14:50   5:11 (squid) -f /etc/squid/squid.conf
squid    26546  0.0  0.0  20084  1104 ?        S    14:50   0:03 (unlinkd)

# rm /tmp/squid-analyzer.pid

with /usr/local/bin/squid-analyzer -d

SquidAnalyzer version 6.5
SQUID LOG HISTORY TIME: Mon May  2 15:30:03 2016 - HISTORY OFFSET: 23738195
Starting to parse logfile /var/log/squid/access.log.
Reading file /var/log/squid/access.log from offset 23738195 to end.
_gethostbyaddr timeout reach for ip: 192.168.1.137, timeout can be adjusted with directive DNSLookupTimeout
Alarme de tempo

My DNSLookupTimeout 0.0005

darold commented 8 years ago

Does it works if UseClientDNSName is disabled? You may want to use a test output directory to not override your current reports, for example:

Output  /var/www/sa_test

in your squidanalyzer.conf file.

joseh-henrique commented 8 years ago

With disabled UseClientDNSName, it worked , but the report generated ... :-( No names

darold commented 8 years ago

What I understand from your debug log is that squid-analyzer dies just after the first timeout in _gethostbyaddr() method, this should not happen. What is your operating system and your Perl version?

If I try to reproduce the issue, I just have lot of messages llike:

_gethostbyaddr timeout reach for ip: 192.168.1.178, timeout can be adjusted with directive DNSLookupTimeout

but everything is completed.

joseh-henrique commented 8 years ago

With enabled UseClientDNSName, squid -analyzer creates squidanalyzer.pid and stop

# perl -v
This is perl, v5.10.1 (*) built for x86_64-linux-thread-multi
...
# lsb_release -a
LSB 
...
Distributor ID: CentOS
Description:    CentOS release 6.7 (Final)
Release:        6.7
Codename:       Final
darold commented 8 years ago

Do you have Time::HiRes Perl module installed?

joseh-henrique commented 8 years ago

Yes, the version

# cpan -D Time::HiRes
CPAN: Storable loaded ok (v2.20)
Going to read '/root/.cpan/Metadata'
  Database was generated on Mon, 09 May 2016 17:17:02 GMT
Time::HiRes
-------------------------------------------------------------------------
        (no description)
        J/JH/JHI/Time-HiRes-1.9733.tar.gz
        /usr/lib64/perl5/Time/HiRes.pm
        Installed: 1.9721
        CPAN:      1.9733  Not up to date
        Jarkko Hietaniemi (JHI)
        jhi@iki.fi
joseh-henrique commented 8 years ago

Hello, any news? Maybe I have not informed correctly, reports are generated , but the name of the machines are not resolved after upgrade

darold commented 8 years ago

Hi,

I was not able to reproduce the issue, I guess it is related to the Perl version or any other system configuration that prevent squid-analyzer to use alarm() as expected. You can always try to increase DNSLookupTimeout on a higher value to not encounter the timeout, but if it still die when a timeout is found you'd better not use the resolver.

Best regards,