Tente reinstalar apenas o squid e o sarg. Salve a configuração do Squid (/etc/squid/squid.conf), depois execute os comandos abaixo:
sudo apt-get purge squid sarg
sudo apt-get install squid sarg
Toda configuração anterior deve ser apagada com esses comandos, use o arquivo squid.conf salvo como base pra recriar as regras de acesso.
Fiz tudo que foi sugerido e voltei ao estado que estava antes:
root@asterisk:~# sarg
SARG: No records found
SARG: End
porém apliquei o comando sarg -x e o resultado foi esse:
root@asterisk:~# sarg -x
SARG: Init
SARG: Loading configuration from /etc/sarg/sarg.conf
SARG: Loading exclude host file from: /etc/sarg/exclude_hosts
SARG: Loading exclude file from: /etc/sarg/exclude_users
SARG: Parameters:
SARG: Hostname or IP address (-a) =
SARG: Useragent log (-b) =
SARG: Exclude file (-c) = /etc/sarg/exclude_hosts
SARG: Date from-until (-d) =
SARG: Email address to send reports (-e) =
SARG: Config file (-f) = /etc/sarg/sarg.conf
SARG: Date format (-g) = USA (mm/dd/yyyy)
SARG: IP report (-i) = No
SARG: Input log (-l) = /var/log/squid/access.log
SARG: Resolve IP Address (-n) = No
SARG: Output dir (-o) = /var/lib/sarg/
SARG: Use Ip Address instead of userid (-p) = No
SARG: Accessed site (-s) =
SARG: Time (-t) =
SARG: User (-u) =
SARG: Temporary dir (-w) = /tmp
SARG: Debug messages (-x) = Yes
SARG: Process messages (-z) = No
SARG:
SARG: sarg version: 2.3 Jun-21-2010
SARG: Loading User table: /etc/sarg/usertab
SARG: Reading access log file: /var/log/squid/access.log
SARG: Records read: 0, written: 0, excluded: 0
SARG: No records found
SARG: End
procedimento feito:
apt-get purge squid sarg
apt-get install squid sarg
cp /root/squid.conf /etc/squid
cp /root/ip_liberado /etc/squid
cp /root/sites_negados /etc/squid
cp /root/sites_permitidos /etc/squid
cp /root/palavras_negadas /etc/squid
vim /etc/squid/squid.conf - foi alterado a linha do log, pois estava /var/cache e direcionado para /var/log
vim /etc/squid/ip_liberado - foi alterado o endereço ip
mkdir /var/cache/squid
chmod 777 /var/cache/squid
squid -k reconfigure
vim /etc/apache2/conf.d/sarg.conf
sarg -x
sarg-reports today
sarg
e mesmo assim o sarg não funciona e muito menos o log está sendo escrito no lugar certo
editei o arquivo sarg.conf
vim /etc/sarg/sarg.conf
# sarg.conf
#
# TAG: access_log file
# Where is the access.log file
# sarg -l file
#
access_log /var/log/squid/access.log
# TAG: graphs yes|no
# Use graphics where is possible.
# graph_days_bytes_bar_color blue|green|yellow|orange|brown|red
#
#graphs yes
#graph_days_bytes_bar_color orange
# TAG: graph_font
# The full path to the TTF font file to use to create the graphs. It is required
# if graphs is set to yes.
#
#graph_font /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf
# TAG: title
# Especify the title for html page.
#
title "Squid User Access Reports"
# TAG: font_face
# Especify the font for html page.
#
font_face Tahoma,Verdana,Arial
# TAG: header_color
# Especify the header color
#
header_color darkblue
# TAG: header_bgcolor
# Especify the header bgcolor
#
header_bgcolor blanchedalmond
# TAG: font_size
# Especify the text font size
#
font_size 9px
# TAG: header_font_size
# Especify the header font size
#
#header_font_size 9px
# TAG: title_font_size
# Especify the title font size
#
#title_font_size 11px
# TAG: background_color
# TAG: background_color
# Html page background color
#
background_color white
# TAG: text_color
# Html page text color
#
text_color #000000
# TAG: text_bgcolor
# Html page text background color
#
text_bgcolor lavender
# TAG: title_color
# Html page title color
#
title_color green
# TAG: logo_image
# Html page logo.
#
#logo_image none
# TAG: logo_text
# Html page logo text.
#
#logo_text ""
# TAG: logo_text_color
# Html page logo texti color.
#
#logo_text_color #000000
# TAG: logo_image_size
# Html page logo image size.
# width height
#
#image_size 80 45
# TAG: background_image
# Html page background image
#
#background_image none
# TAG: password
# User password file used by Squid authentication scheme
# If used, generate reports just for that users.
#
#password none
# TAG: temporary_dir
# Temporary directory name for work files
# sarg -w dir
#
temporary_dir /tmp
# TAG: output_dir
# The reports will be saved in that directory
# sarg -o dir
#
output_dir /var/www/html/squid-reports
#output_dir /var/www #lib/sarg
# TAG: output_email
# Email address to send the reports. If you use this tag, no html reports will be generated.
# sarg -e email
#
#output_email none
# TAG: resolve_ip yes/no
# Convert ip address to dns name
# sarg -n
resolve_ip
# TAG: user_ip yes/no
# Use Ip Address instead userid in reports.
# sarg -p
user_ip no
# TAG: topuser_sort_field field normal/reverse
# Sort field for the Topuser Report.
# Allowed fields: USER CONNECT BYTES TIME
#
topuser_sort_field BYTES reverse
# TAG: user_sort_field field normal/reverse
# Sort field for the User Report.
# Allowed fields: SITE CONNECT BYTES TIME
#
user_sort_field BYTES reverse
# TAG: exclude_users file
# users within the file will be excluded from reports.
# you can use indexonly to have only index.html file.
#
exclude_users /etc/sarg/exclude_users
...
Coloquei parte do sarg.conf por ele ser muito grande. nele tem uma pequena modificação que eu fiz no output_dir
Desculpa o post grande, mas sou muito detalhista na questão de procedimentos.
Obrigado pela ajuda.