Sistemas‎ > ‎Linux‎ > ‎

SqStat - Squid

SqStat com Squid 3.3.6 monitorando usuários
Fonte: http://www.vivaolinux.com.br/dica/SqStat-com-Squid-336-monitorando-usuarios

# wget http://ufpr.dl.sourceforge.net/project/sqstat/sqstat/sqstat-1.20/sqstat-1.20.tar.gz
# tar -zxvf sqstat-1.20.tar.gz 
# cd sqstat-1.20 
// Para implementar o SqStat nas versões novas (3+) do Squid, tem que ser aplicado um patch.
# wget http://kidun.ru/files/sqstat_squid32.patch
# patch sqstat.class.php sqstat_squid32.patch

# mv config.inc.php.defaults config.inc.php
# cd ..
# mv sqstat-1.20 /var/www/html/sqstat

# vi /etc/squid/squid.conf
...
# Only allow cachemgr access from localhost
http_access allow localhost manager
http_access deny manager
...


O monitoramente pode ser visto em "http://servidor/sqstat/"







Path do site: http://kidun.ru/files/sqstat_squid32.patch

107c107
< 		if($raw[0]!="HTTP/1.0 200 OK"){
---
> 		if($raw[0]!="HTTP/1.1 200 OK"){
131,132c131,132
< 					if(substr($v,0,5)=="peer:") $parsed["con"][$connection]["peer"]=substr($v,6);
< 					if(substr($v,0,3)=="me:") $parsed["con"][$connection]["me"]=substr($v,4);
---
> 					if(substr($v,0,7)=="remote:") $parsed["con"][$connection]["remote"]=substr($v,8);
> 					if(substr($v,0,6)=="local:") $parsed["con"][$connection]["local"]=substr($v,7);
178c178
< 			$ip=substr($v["peer"],0,strpos($v["peer"],":"));
---
> 			$ip=substr($v["remote"],0,strpos($v["remote"],":"));
189c189
< 				$ip=ip2long(substr($v["peer"],0,strpos($v["peer"],":")));
---
> 				$ip=ip2long(substr($v["remote"],0,strpos($v["remote"],":")));

Comments