Sarg (Squid Analysis Report Generator) is a tool that allows administrators view systems in a simple and friendly Internet sites visited (you can even know until the time he visited) users of local network using Squid logs. Generates a list daily, weekly, monthly or custom Internet sites you visit each user, as consumed (MB), etc. It also generates a list of sites (Top Sites).
For an unknown reason, Sarg is not in the repositories of Squeeze. But that does not mean it can not be installed. To install, you must first check what your and install dependencies (libc0.1, libc0.3, libc6, libapache2-mod-php5, apache2, squid). After downloading the package Sid and installed with:
# dpkg-i-1_arquitectura.deb sarg_2.3 Once installed, you must configure in order to generate daily reports and statistics. The configuration files are in " / etc / sarg / ." The main configuration file is " / etc / sarg / sarg.conf " and some of its parameters are: 1
access_log / var / log / squid / access.log
2 output_dir / var / lib / 3 exclude_hosts
sarg / etc / sarg / exclude_hosts
4 and 5 index date_format yes
6 100
topsites_num 1 Indicates the location of the Squid log
2 Directory where reports are saved
3 List of equipment that will be included in reports
4 date format used in reports
5 generates a home page index.html
6 Total sites
TopSites File / etc / sarg / exclude_users contains users who are not part of the reports.
file / etc / sarg / exclude_hosts contains computers that do not want to be part of SARG reports. May contain IP addresses (Example: 192.168.1.10), a complete network (192.168.1.0/24), the name of a computer (equipo.red.local) or all computers on a network (*. red.local)
Configuring apache
To access the reports generated by Sarg to configure apache and it is advisable to restrict access to such reports. Here's how:
file is created / etc/apache2/conf.d/sarg with the following contents:
Alias \u200b\u200b/ sarg / var / lib / sarg
\u0026lt;Directory /var/lib/sarg> DirectoryIndex index.html
order deny, allow deny from all
allow from 127.0.0.1 192.168.1.10 AuthName "Only authorized users." AuthType Basic
require valid-user AuthUserFile / var / www / key-users-sarg
\u0026lt;/ Directory> file is created in which to store the keys, they just read and write permissions only to the owner, is assigned to www -data as the owner of the file:
# touch / var / www / sarg cues
# chmod 0600 / var / www / sarg cues
# chown www-data-data.www / var/www/claves-users- sarg user is generated and assigned password:
# htpasswd / var / www / sarg user cues Then restart apache for the changes to take effect:
# / etc / init.d / apache2 restart In Squeeze is a problem that prevents it from generating daily reports. The problem is that it makes a daily rotation of the Squid logs and such rotation is carried out just before Sarg generate reports. This is the scrip / etc / cron.daily / logrotate runs before / etc / cron.daily / sarg as the latter runs log / var / log / squid / access.log is empty . This simple solution by renaming / etc / cron.daily / sarg:
# mv / etc / cron.daily / sarg / etc/cron.daily/0sarg Now you just have to wait out the time to run the scripts that are in / etc / cron.daily / at the scheduled time in / etc / crontab. Once generated
reports http://IP-del-Server/sarg/ accessed with username and password generated.
0 comments:
Post a Comment