There are many webbased utilites to monitor squid traffice and access logs, like webalizer, lightsquid and sarg etc... but you can't monitor live traffic using them, those are useful to check only the reports at the specific time.
SqStat is a great web based utility that allow you monitor live traffic, the moment user hits www.google.com in the browser it automatically shown on the SqStat utliy using a browser. What a great piece of software is it.
Installtion is quiet a simply. Simply follow the below steps.
- Download the SqStats from http://sourceforge.net/projects/sqstat/
- Install apache on any server, not neccessary that apache should be running on squid server. (in my case i installed on same squid server)
- Unzip and copy all the files from the sqstat folder to /var/www/html
[root@proxy]# yum install httpd -y
[root@proxy]# cd /root/Downloads
[root@proxy]# unzip sqstat-1.20.zip[root@proxy]# cp -rvf sqstat-1.20/* /var/www/html/
Go to /var/www/html/ rename config.inc.php.default to config.inc.php and sqstat.php index.php
[root@proxy]# cd /var/www/html
[root@proxy]# mv config.inc.php.default config.inc.php
[root@proxy]# mv sqstat.php index.php
[root@proxy]# mv config.inc.php.default config.inc.php
[root@proxy]# mv sqstat.php index.php
After renaming the above files we have to add squid server ip and port in /var/www/html/config.inc.php file
[root@proxy]# cd /var/www/html/config.inc.php
/* Squid proxy server ip address or host name */
$squidhost[0]="192.168.10.10";
/* Squid proxy server port */
$squidport[0]=3128;
Once done with configuration with apache, it's time to allow cahe_manager in squid for the webserver ip on which we installed apache and SqStat. So add acl in squid.conf
[root@proxy]# vim /etc/squid/squid.conf
acl manager proto cache_object
acl apache src 192.168.10.10
http_access allow manager apache
acl manager proto cache_object
acl apache src 192.168.10.10
http_access allow manager apache
That's it now restart both squid and apache serivices. Enter web server ip in the browser and hit enter to check the live traffic.
6 Comments
Will the SqStats leave some kind of logs ? Can it be defined in config ?
ReplyDeleteHi Vodoinstalater,
ReplyDeletethanks for visiting our site, coming to ur comment, what kind of logs you are taking about ? what purpose.
Hello,i am sorry for not formulating the question well.. For example if i use SqStats on remote apache server,will the logs persist on apache server,or SqStats will just read the remote logs made by squid ? Off the topic,do you know if user agent logging can be added to squid after regular installation. By regular i mean without adding user agent while compiling the squid. Thank you for your response,i appreciate it :)
ReplyDeleteHi, try below
ReplyDeleteif squid is 2.5-3.1
header_replace User-Agent Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)
#############
if squid is above 3.request_header_access User-Agent deny all
request_header_replace User-Agent Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Win64; x64; Trident/5.0)1
Can anyone help me how to configure SqStat in CentOS 6....Will really appreciate.....
ReplyDeleteHi Maqsood, it's for CentOS only. Start doing it, get back to me if you have any difficulty doing it.
ReplyDelete