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/
125 stars 36 forks source link

SA runs only once on Debian Buster #210

Closed Gill-Bates closed 3 years ago

Gill-Bates commented 4 years ago

When I freshly install SquidAnalyzer on Debian Buster and run the following command:

/usr/local/bin/squid-analyzer > /dev/null 2>&1

If the report is built successfully. If I repeat the command, the Squid Report will not be updated.

As I can see, after running the command follwing file appear:

SquidAnalyzer.current

Why do I need this file? The existence of this file prevents the report from being updated. If I delete it, the report creation works again.

darold commented 4 years ago

This file is use to store information about the last line parsed by SA. If you don't have new report on second run this is because there is no new entry in your log. Do not remove this file unless you want to recreate the reports. You can use option -d to see what squid-analyzer is doing.

Gill-Bates commented 4 years ago

I cannot confirm that there is no new entry in the log. The last manual run works great: image As you can see, there is no update

mysterfr commented 4 years ago

Hi,

some guidance on Debian systems :

  1. tune the /etc/squidanalyzer/squidanalyzer.conf:
  1. If you put the execution command in the /etc/logrotate.d/squid file, then the execution command line should look like this: (Under the postrotate section, note that the path to the binary is different than the one in the project documentation)
    /var/log/squid/*.log {
        daily
        compress
        delaycompress
        rotate 5
        missingok
        nocreate
        sharedscripts
        prerotate
                test ! -x /usr/sbin/sarg-reports || /usr/sbin/sarg-reports daily
        endscript
        postrotate
                test ! -e /var/run/squid.pid || test ! -x /usr/sbin/squid || /usr/sbin/squid -k rotate
                /usr/local/bin/squid-analyzer -d -l /var/log/squid/access.log.1
        endscript
darold commented 3 years ago

Documentation updated wit your example. Thanks.