SARG

22 01 2010

When you have Squid, it is unavoidable to view squid’s access.log.
It is not comfortable to use tail command and view realtime accesses which is hard to analyse. SARG(Squid Analysis Report Generator) is a good choice to tagle this. Before installing sarg, we need squid and apache running on the target system.

I used CentOS5.2, Squid 2.6 stable21 with this version of sarg

1. Install sarg


> wget http://dag.wieers.com/rpm/packages/sarg/sarg-2.2.3.1-1.el5.rf.i386.rpm
> rpm -ivh sarg-2.2.3.1-1.el5.rf.i386.rpm

2. Enable apache by

> /sbin/chkconfig --add httpd

> /sbin/chkconfig –level 2345 httpd on

** Start httpd manually by

> /usr/sbin/apachectl start

3. Edit sarg.conf

> nano /etc/sarg/sarg.conf

4. Remove comment in front of access_log and output_dir. Remind that we need to change its target directory related to the real location in our target system.

5. Our sarg will be ready to run, just type

> sarg -l /var/log/squid/access.log

You will see a html result inside output_dir and now our access log is a lot easier to be analysed.

6. To run sarg periodically, you need to make sure there is a sarg task in /etc/crontab.

Oh, I got this interesting linux certification link during my experiment.


Actions

Information

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s




%d bloggers like this: