LINUXOR.SK ... open source notes ...

2011 - Monitoring the use of a Squid proxy server

category: howtoz · date: 2011-02-16 · source: old.linuxor.sk/PROXY/MONITORING_VYUZIVANIA_PROXY_SERVERA_SQUID.txt

The Slovak original of this document: 2011 - Monitoring využívania proxy servera Squid (slovensky).

asciiart
MONITORING VYUZIVANIA PROXY SERVERA SQUID
=========================================

        Denne/Tyzdenne/Mesacne statistiky
        ---------------------------------
        https://192.168.1.1/sarg

        RealTime statistiky
        -------------------
        https://192.168.1.1/sqstat

 SARG - http://sarg.sourceforge.net/
=====================================

        Instalacia SARG
        ---------------
        # cd /tmp
        # wget http://downloads.sourceforge.net/project/sarg/sarg/sarg-2.3.1/sarg-2.3.1.tar.gz?r=http%3A%2F%2Fsarg.sourceforge.net%2Fsarg.php&ts=1296214728&use_mirror=garr
        # tar -xvf ./sarg-2.3.1.tar.gz
        # cd ./sarg-2.3.1
        # ./configure
        # make
        # make install

        Nastavenie SARG skriptu
        -----------------------
        # nano /usr/local/etc/sarg.conf

        Installing the helper script for SARG (sarg-reports)
        ----------------------------------------------------
        # cd /usr/local/bin
        # wget http://www.initzero.it/products/opensource/sarg-reports/download/sarg-reports
        # chmod +x ./sarg-reports

        Nastavenie sarg-reports
        -----------------------
        # nano /usr/local/bin/sarg-reports
        #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
        ## Slovak Language
        SARG=/usr/local/bin/sarg
        CONFIG=/usr/local/etc/sarg.conf
        HTMLOUT=/var/www/sarg
        PAGETITLE="Statistiky Proxy servera $(hostname)"
        LOGOIMG=http://www.bigcorp.example/html/skin/image/02/common/ko_images/firma_logo.jpg
        LOGOLINK=http://www.bigcorp.example
        DAILY=Denny report
        WEEKLY=Tyzdenny report
        MONTHLY=MEsacny report
        EXCLUDELOG1="SARG: Zaznamov v subore: "
        EXCLUDELOG2="SARG: "
        #@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

        Nastavenie CRONu
        ----------------
        # nano /etc/crontab
        -------------------
        # SARG reporty
        00 *       * * * root /usr/local/bin/sarg-reports today
        00 00      * * * root /usr/local/bin/sarg-reports daily
        00 01      * * 1 root /usr/local/bin/sarg-reports weekly
        30 02      1 * * root /usr/local/bin/sarg-reports monthly
        # SARG reporty

        Restart CRONu
        -------------
        # /etc/init.d/cron restart

 SQSTAT - http://samm.kiev.ua/sqstat/
======================================

        Instalacia SQSTAT
        -----------------
        # cd /tmp
        # wget http://samm.kiev.ua/sqstat/sqstat-1.20.tar.gz
        # tar -xvf ./sqstat-1.20.tar.gz
        # cd ./sqstat-1.20
        # mkdir /var/www/sqstat
        # cp /tmp/sqstat-1.20/* /var/www/sqstat
        # cp /var/www/sqstat/config.inc.php.defaults /var/www/sqstat/config.inc.php

        Konfiguracia SQSTAT
        -------------------
        # nano /var/www/sqstat/config.inc.php
        -------------------------------------
        $squidhost[0]="127.0.0.1";
        $squidport[0]=8080;

 Restricting access to the statistics to certain users only
==========================================================
Potrebny modul: mod_auth_basic: http://httpd.apache.org/docs/2.2/mod/mod_auth_basic.html

# nano /etc/apache2/sites-enabled/default-ssl
---------------------------------------------
<Directory /var/www/sarg>
        Options Indexes MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
        AuthType Basic
        AuthName "pristup"
        AuthUserFile /etc/apache2/basic_passwords
        Require user statistiky
</Directory>

<Directory /var/www/sqstat>
        Options Indexes MultiViews
        AllowOverride None
        Order allow,deny
        Allow from all
        AuthType Basic
        AuthName "pristup"
        AuthUserFile /etc/apache2/basic_passwords
        Require user statistiky
</Directory>
---------------------------------------------

Creating the password for access to the "sarg" and "sqstat" directories
-----------------------------------------------------------------------
# htpasswd -c /etc/apache2/basic_passwords statistiky
------------------------------------------------------------
Adding password for statistiky in realm realm.
New password: PR.843.oxT

LINKz
=====

        SARG - Squid Analysis Report Generator is a tool that allow you to view "where" your users are going to on the Internet.
        ------------------------------------------------------------------------------------------------------------------------
        http://sarg.sourceforge.net/sarg.php

        SARG-REPORTs - pomocny skript na generovanie dennych, tyzdennych, mesacnych reportov
        ------------------------------------------------------------------------------------
        http://www.initzero.it/products/opensource/sarg-reports/download/sarg-reports

        SqStat - realtime statistiky proxy servera Squid
        SqStat is a script which allows to look through active squid users connections. It use cachemgr protocol to get information from squid proxy server.
        ----------------------------------------------------------------------------------------------------------------------------------------------------
        http://samm.kiev.ua/sqstat/

LINKz pomocne
=============

        Nastavenie Jazyka
        -----------------
        http://tech.groups.yahoo.com/group/orso/message/4123
← howtoz(EN | SK)