Difference between revisions of "Squid log analysis using sarg"

From Notes_Wiki
m
m
Line 10: Line 10:
#:</pre>
#:</pre>
# Download latest sarg code from http://sourceforge.net/projects/sarg/files/latest/download
# Download latest sarg code from http://sourceforge.net/projects/sarg/files/latest/download
#:At time of this writing 2.3.9 was found to work and 2.3.10 was failing on CentOS-6.x
# Extract code and use <tt>./configure; make; make install</tt>
# Extract code and use <tt>./configure; make; make install</tt>
# Edit /usr/local/etc/sarg.conf and set following values:
# Edit /usr/local/etc/sarg.conf and set following values:
Line 21: Line 22:
# Run sarg over cron using:
# Run sarg over cron using:
#:<pre>
#:<pre>
#::  15 1 * * * /usr/local/bin/sarg -x
#::  15 1 * * * /usr/local/bin/sarg -x >/dev/null 2>&1
#:</pre>
#:</pre>
#Restrict access to sarg by creating '/etc/httpd/conf.d/sarg.conf with
#:<pre>
#::<Location /sarg-reports>
#::Options All
#::AllowOverride All
#::Order deny,allow
#::Allow from 10.3.1.2
#::Deny from all
#::</Location>
#:</pre>
#::Here replace 10.3.1.2 with admin networksg
Some of the steps are contributed by Kiran Kollipara.


Steps contributed by Kiran Kollipara.
<yambe:breadcrumb>Squid_proxy_server_configuration|Squid</yambe:breadcrumb>

Revision as of 13:18, 14 October 2015

<yambe:breadcrumb>Squid_proxy_server_configuration|Squid</yambe:breadcrumb>

squid log analysis using sarg

Manual installation of sarg

To install sarg manually use following steps:

  1. Install following packages from base, updates repositories:
    yum -y install gcc gd gd-devel make perl-GD wget httpd pcre-devel
  2. Download latest sarg code from http://sourceforge.net/projects/sarg/files/latest/download
    At time of this writing 2.3.9 was found to work and 2.3.10 was failing on CentOS-6.x
  3. Extract code and use ./configure; make; make install
  4. Edit /usr/local/etc/sarg.conf and set following values:
    access_log /var/log/squid/access.log
    output_dir /var/www/html/sarg-reports
    date_format e
    overwrite_report yes
  5. Generate one time report using sarg -x
  6. Run sarg over cron using:
    15 1 * * * /usr/local/bin/sarg -x >/dev/null 2>&1
  7. Restrict access to sarg by creating '/etc/httpd/conf.d/sarg.conf with
    <Location /sarg-reports>
    Options All
    AllowOverride All
    Order deny,allow
    Allow from 10.3.1.2
    Deny from all
    </Location>
    Here replace 10.3.1.2 with admin networksg

Some of the steps are contributed by Kiran Kollipara.


<yambe:breadcrumb>Squid_proxy_server_configuration|Squid</yambe:breadcrumb>