1

[1]

Install and configure Sarg

[root ~]# yum --enablerepo=dag -y install sarg   # install from DAG

[root@lan ~]# vi /etc/httpd/conf.d/sarg.conf

Alias /sarg /var/www/sarg

<Directory /var/www/sarg>

DirectoryIndex index.html

Order deny,allow

Deny from all

# add IP address you allow

Allow from 127.0.0.1 192.168.0.

Allow from ::1

# Allow from your-workstation.com

</Directory>

[root@lan ~]# vi sarg.sh# create a execute script

#!/bin/sh

/usr/bin/sarg > /dev/null 2>&1

[root@lan ~]# chmod 755 sarg.sh

[root@lan ~]# ./sarg.sh# run

[root@lan ~]# crontab -e

# run at 1:00 AM every day

00 01 * * * /root/sarg.sh

[2]

 

Access to the site you set with Web browser, then following screen is shown and you can see logs of Squid.

http:// www.worldcm.net/sarg

6) To Generate the logreport, simply run the command sarg

/var/www/html/squid-reports

7) To generate the log report by the cron job you can make entry in “/etc/crontab” file

00 23 * * * root /usr/bin/sarg

Step-7 And now my requirement is to generate this report on hourly basis so for that i have to configure ‘crontab’ i will run this command after every 3 hours.

you can adjust as per your requirements.

Create a schedual

crontab -e

0 */3 * * * sarg

This schedule will generate SARG report after every 3 hours.

If you have any question please use comments area. Thanks!