Site icon naschenweng.info

NAS: Analyse your squid logs

In a previous post I described how to install Squid on the Synology. This small tutorial will now explain how to display your usage behaviour in Squid via Webalizer.

You need to have ipkg installed and need to have an understanding on how to include 3rd party apps (i.e. via phpsrc).

  1. Install webalizer: ipkg install webalizer
  2. Create a new config file: cp /opt/etc/webalizer.conf.sample /opt/etc/webalizer.conf
  3. Adjust your log-file entry and point it to your Squid-access log: LogFile /opt/var/squid/logs/access.log
  4. Adjust your output directory (this is the HTML-directory from which you want to display your stats): OutputDir /volume1/webapps/scripts/squid/usage
  5. Create a cronjob entry (remember that the crontab needs to have tabs instead of spaces): 5 0 * * * root /opt/bin/webalizer -F squid -A 100 -C 100 -R 100 -S 100 -U 100 -e 100 -E 100 -Q

The above will create usage statistics every day (5 minutes past midnight) and publish the stats to the output-directory.

Some more cool stuff:

Exit mobile version