Tuesday, March 15, 2016

SARG is a tool that analyses the proxy log files and creates beautiful reports out of it. It is handy to see how much bandwidth is used by individual machines on the network and one can check on which websites the network's users are surfing.

Server Descriptions :

     • Hostname   = proxy.rebro.com
     • Services      = DNS, Squid Proxy and SARG.
     • Eth0           = Connected to Internet  
     • Eth1           = Connected to LAN

Please remember without the Squid and DNS setup, no use of installing sarg on the system it will won’t work at all. Before installing Sarg we must configure DNS and Squid as Transparent Proxy. DNS for the name resolution in caching mode.


Step 1 - Installation of required packages for SARG.

Step 2 - Download SARG package, here I am go to my software folder.

Step 3 - Extract sarg package, using below command.

Step 4 -  Compile SARG package using below Commands.

Step 5 - Now, time to edit SARG main configuration file. It has lots of option to edit you should go through all of them before edit anything. However, we will editing only the ones that we need.

Step 6 - After that restart the service.

Step 7 - Configuring firewall, open port 80 for accessing web server.

      iptables –I INPUT –p tcp –dport 80 –j ACCEPT

Step 8 - Now finally you can generate SARG reports.

The above command will generate reports in mentioned directory "/var/www/html/access_reports" which can be accessed from the web browser using the address http://IP-Address/access_reports

Step 9 - SARG Main Page

Step 10 - To automate the process of generating sarg report in given span of time via cron jobs. For example, let’s assume you want to generate reports on hourly basis automatically, to do this, you need to configure a Cron job.

That's it...

3 comments: