Squid log monitor using Sarg

In this post i am going to install sarg monitoring tool in Squid proxy server.

[root@proxy ~]# yum install -y gcc make wget httpd
#wget wget http://downloads.sourceforge.net/project/sarg/sarg/sarg-2.3.8/sarg-2.3.8.tar.gz
#mv sarg-2.3.8.tar.gz /opt/
#cd /opt
#tar zxvf sarg-2.3.8.tar.gz
#cd sarg-2.3.7
#./configure
#make
#make install
#vi /usr/local/etc/sarg.conf
#Changes made for this lab
access_log /var/log/squid/access.log   # Squid Access Log file By Default Location
date_format e    # Date format will be DD-MM-YYYY
output_dir /var/www/html/access_reports

#service httpd restart
#chkconfig httpd on
#iptables –I INPUT –p tcp –dport 80 –j ACCEPT

finally you can generate SARG reports.
# sarg -x



Now, http://192.168.0.97/access_reports see the below screen shorts.
Enable cron for sarg report

#crontab -e
5 * * * *  /usr/local/bin/sarg -x

Troubleshooting
Error:

configure: gd.h was not found so the graphs won't be available in the report
configure: pcre.h was not found so the regexp won't be available in the hostalias
Solution:

# yum install pcre-devel
#  yum install gd-devel

Post a Comment

Mới hơn Cũ hơn