stringuetta
(usa Linux Mint)
Enviado em 10/01/2014 - 12:04h
Olá pessoal, estou tentando configurar o Sqstat para monitoramento juntamento com o Squid em um servidor com Debian Wheezy instalado, porém não está funcionando, quando tento acessar via Iceweasel ele apresenta o seguinte erro:
errno=4; $squidclass->errstr="Error in the configuration file.". 'Please, specify $squidhost['.$config.']/$squidport['.$config.']'; $squidclass->showError(); exit(4); } for($i=0;$ierrno=4; $squidclass->errstr="Error in the configuration file.
". '"group_by" can be only "username" or "host"'; $squidclass->showError(); exit(4); } } else{ $squidclass->errno=4; $squidclass->errstr="Configuration file not found.". "Please copy file config.inc.php.defauts to config.inc.php and edit configuration settings."; $squidclass->showError(); exit(4); } // loading hosts file $hosts_array=array(); if(isset($hosts_file)){ if(is_file($hosts_file)){ $handle = @fopen($hosts_file, "r"); if ($handle) { while (!feof($handle)) { $buffer = fgets($handle, 4096); unset($matches); if(preg_match('/^([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})[ \t]+(.+)$/i',$buffer,$matches)){ $hosts_array[$matches[1]]=$matches[2]; } } fclose($handle); } else { $squidclass->errno=4; $squidclass->errstr="Hosts file not found.". "Cant read '$hosts_file'."; $squidclass->showError(); exit(4); } } else { $squidclass->errno=4; $squidclass->errstr="Hosts file not found.". "Cant read '$hosts_file'."; $squidclass->showError(); exit(4); } } if(!$squidclass->connect($squidhost,$squidport)) { $squidclass->showError(); exit(1); } $data=$squidclass->makeQuery($cachemgr_passwd); if($data==false){ $squidclass->showError(); exit(2); } // print_r($data); if(!isset($use_js)) $use_js=true; echo $squidclass->makeHtmlReport($data,$resolveip,$hosts_array,$use_js); ?>
Já quando tento abrir pelo Google Chrome aparece código fonte da index do arquivo "sqstat.php" abaixo meu arquivo de configuração do sqstat:
<?php
/* global settings */
$use_js=true; // use javascript for the HTML toolkits
// Maximum URL length to display in URI table column
DEFINE("SQSTAT_SHOWLEN",60);
/* proxy settings */
/* Squid proxy server ip address or host name */
$squidhost[0]="192.168.0.1";
/* Squid proxy server port */
$squidport[0]=3128;
/* cachemgr_passwd in squid.conf. Leave blank to disable authorisation */
$cachemgr_passwd[0]="";
/* Resolve user IP addresses or print them as numbers only [true|false] */
$resolveip[0]=true;
/* uncomment next line if you want to use hosts-like file.
See hosts.txt.dist. */
// $hosts_file[0]="hosts.txt"
/* Group users by hostname - "host" or by User - "username". Username work only
with squid 2.6+ */
$group_by[0]="host";
/* you can specify more than one proxy in the configuration file, e.g.: */
// $squidhost[1]="192.168.0.2";
// $squidport[1]=3129;
// $cachemgr_passwd[1]="secret";
// $resolveip[1]=true;
// $hosts_file[1]="otherhosts.txt"
?>
Abaixo a ACL no Squid.conf referente ao webserver para funcionamento do sqstat, conforme encontrado nos tutoriais que achei aqui no VOL
acl webserver src 192.168.0.1/32
acl localhost src 127.0.0.1/32
http_access allow manager localhost
http_access allow manager webserver
http_access deny manager
Alguém saberia me dizer o que tem que fazer? Tentei colocar o Sqstat na minha maquina, e apontando o caminho do Squid para o servidor, porém ocorreu erro de permissão, "SqStat error
Error (1): Cannot get data. Server answered: HTTP/1.0 403 Forbidden"
Grato a qualquer ajuda.
Francisco