The Squid log analyzer

SquidAnalyzer

 

Installation

Requirement

Since release 5.0 SquidAnalyzer don't need any additionnal library or Perl modules, graphs are now generated with a Javascript library. So a modern Perl installation and an HTTP server like Apache will be enough.

Installation

Generic install

If you want the package to be installed into the Perl distribution just do the following:

	perl Makefile.PL
	make
	make install

Follow the instruction given at the end of install. With this default install everything configurable will be installed under /etc/squidanalyzer. The Perl library SquidAnalyzer.pm will be installed under your site_perl directory and the squid-analyzer Perl script will be copied under /usr/local/bin.

The default output directory for html reports will be /var/www/squidanalyzer/.

Custom install

You can create your fully customized SquidAnalyzer installation by using the Makefile.PL Perl script. Here is a sample:

    perl Makefile.PL \
	    LOGFILE=/var/log/squid3/access.log \
	    BINDIR=/usr/bin \
	    CONFDIR=/etc \
	    HTMLDIR=/var/www/squidreport \
	    BASEURL=/squidreport \
	    MANDIR=/usr/man/man3 \
	    DOCDIR=/usr/share/doc/squidanalyzer

If you want to build a distro package, there are two other options that you may use. The QUIET option is to tell to Makefile.PL to not show the default post install README. The DESTDIR is to create and install all files in a package build base directory. For example for Fedora RPM, thing may look like that:

    # Make Perl and SendmailAnalyzer distrib files
    %{__perl} Makefile.PL \
	INSTALLDIRS=vendor \
	QUIET=1 \
	LOGFILE=/var/log/squid/access.log \
	BINDIR=%{_bindir} \
	CONFDIR=%{_sysconfdir} \
	BASEDIR=%{_localstatedir}/lib/%{uname} \
	HTMLDIR=%{webdir} \
	MANDIR=%{_mandir}/man3 \
	DOCDIR=%{_docdir}/%{uname}-%{version} \
	DESTDIR=%{buildroot} < /dev/null

See spec file in packaging/RPM for full RPM build script.

Local install

You can also have a custom installation. Just copy the SquidAnalyzer.pm and the squid-analyzer perl script into a directory, copy and modify the configuration file and run the script from here with the -c option.

Then copy files flotr2.js, sorttable.js, squidanalyzer.css and the images/ directory into with its content into the output directory.

gilles@devel:~$ ls /var/www/squidanalyzer/
images/      sorttable.js       SquidAnalyzer.current
flotr2.js   squidanalyzer.css

Post installation

1. Modify your httpd.conf to allow access to HTML output like follow:

    Alias /squidreport /var/www/squidanalyzer
    
	Options -Indexes FollowSymLinks MultiViews
	AllowOverride None
	Order deny,allow
	Deny from all
	Allow from 127.0.0.1
    

2. If necessary, give additional host access to SquidAnalyzer in httpd.conf. Restart and ensure that httpd is running.

3. Browse to http://my.host.dom/squidreport/ to ensure that things are working properly.

4. Setup a cronjob to run squid-analyzer daily or more often:

	# SquidAnalyzer log reporting daily
	0 2 * * * /usr/local/bin/squid-analyzer > /dev/null 2>&1

or run it manually. For more information, see README file.

You can use network name instead of network ip addresses by using the network-aliases file. Also if you don't have authentication enable and want to replace client ip addresses by some know user or computer you can use the user-aliases file to do so.

See the file squidanalyzer.conf to customized your output statistics and match your network and file system configuration.

Other links about installation

Install on CentOs-6 in German by Klaus Tachtler : http://www.dokuwiki.tachtler.net/doku.php?id=tachtler:squid_centos_6#squidanalyzer

Install on CentOs-7 in German by Klaus Tachtler : http://www.dokuwiki.tachtler.net/doku.php?id=tachtler:squid_centos_7#squidanalyzer

A RPM is also accessible at a repo of Michael Nausch at: http://repo.mailserver.guru/7/os/x86_64/repoview/squidanalyzer.html

Configuration

For more information on howto use and customize SquidAnalyser take a look at the README file or the configuration link above.

Help support
SquidAnalyzer!

 

Copyright (c) 2001-2012 Gilles Darold - All rights reserved. (GPL v3).